test_class.file: runelite-client/src/test/java/net/runelite/client/plugins/raids/RotationSolverTest.java
test_class.identifier: RotationSolverTest
test_case.body: @Test
  	public void testSolve2()
  	{
  		RaidRoom[] rooms = new RaidRoom[]{UNKNOWN_COMBAT, UNKNOWN_COMBAT, MUTTADILES, TEKTON};
  		RotationSolver.solve(rooms);
  		assertArrayEquals(new RaidRoom[]{VESPULA, GUARDIANS, MUTTADILES, TEKTON}, rooms);
  	}
test_case.class_method_signature: RotationSolverTest.testSolve2()
test_case.full_signature: @Test public void testSolve2()
test_case.identifier: testSolve2
test_case.invocations: solve assertArrayEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSolve2()
focal_class.declarator: ROTATIONS =
  		{
  			Arrays.asList(TEKTON, VASA, GUARDIANS, MYSTICS, SHAMANS, MUTTADILES, VANGUARDS, VESPULA),
  			Arrays.asList(TEKTON, MUTTADILES, GUARDIANS, VESPULA, SHAMANS, VASA, VANGUARDS, MYSTICS),
  			Arrays.asList(VESPULA, VANGUARDS, MUTTADILES, SHAMANS, MYSTICS, GUARDIANS, VASA, TEKTON),
  			Arrays.asList(MYSTICS, VANGUARDS, VASA, SHAMANS, VESPULA, GUARDIANS, MUTTADILES, TEKTON)
  		}
focal_class.modifier: private static final
focal_class.original_string: private static final List[] ROTATIONS =
  		{
  			Arrays.asList(TEKTON, VASA, GUARDIANS, MYSTICS, SHAMANS, MUTTADILES, VANGUARDS, VESPULA),
  			Arrays.asList(TEKTON, MUTTADILES, GUARDIANS, VESPULA, SHAMANS, VASA, VANGUARDS, MYSTICS),
  			Arrays.asList(VESPULA, VANGUARDS, MUTTADILES, SHAMANS, MYSTICS, GUARDIANS, VASA, TEKTON),
  			Arrays.asList(MYSTICS, VANGUARDS, VASA, SHAMANS, VESPULA, GUARDIANS, MUTTADILES, TEKTON)
  		};
focal_class.type: List[]
focal_class.var_name: ROTATIONS
focal_class.file: runelite-client/src/main/java/net/runelite/client/plugins/raids/RotationSolver.java
focal_class.identifier: RotationSolver
focal_class.class_method_signature: RotationSolver.solve(RaidRoom[] rooms)
focal_class.full_signature: static boolean solve(RaidRoom[] rooms)
focal_class.identifier: solve
focal_class.modifiers: static
focal_class.parameters: (RaidRoom[] rooms)
focal_class.return: boolean
focal_class.signature: boolean solve(RaidRoom[] rooms)
focal_method.body: static boolean solve(RaidRoom[] rooms)
  	{
  		if (rooms == null)
  		{
  			return false;
  		}
  
  		List<RaidRoom> match = null;
  		Integer start = null;
  		Integer index = null;
  		int known = 0;
  
  		for (int i = 0; i < rooms.length; i++)
  		{
  			if (rooms[i] == null || rooms[i].getType() != RoomType.COMBAT || rooms[i] == UNKNOWN_COMBAT)
  			{
  				continue;
  			}
  
  			if (start == null)
  			{
  				start = i;
  			}
  
  			known++;
  		}
  
  		if (known < 2)
  		{
  			return false;
  		}
  
  		if (known == rooms.length)
  		{
  			return true;
  		}
  
  		for (List rotation : ROTATIONS)
  		{
  			COMPARE:
  			for (int i = 0; i < rotation.size(); i++)
  			{
  				if (rooms[start] == rotation.get(i))
  				{
  					for (int j = start + 1; j < rooms.length; j++)
  					{
  						if (rooms[j].getType() != RoomType.COMBAT || rooms[j] == UNKNOWN_COMBAT)
  						{
  							continue;
  						}
  
  						if (rooms[j] != rotation.get(floorMod(i + j - start, rotation.size())))
  						{
  							break COMPARE;
  						}
  					}
  
  					if (match != null && match != rotation)
  					{
  						return false;
  					}
  
  					index = i - start;
  					match = rotation;
  				}
  			}
  		}
  
  		if (match == null)
  		{
  			return false;
  		}
  
  		for (int i = 0; i < rooms.length; i++)
  		{
  			if (rooms[i] == null)
  			{
  				continue;
  			}
  
  			if (rooms[i].getType() != RoomType.COMBAT || rooms[i] == UNKNOWN_COMBAT)
  			{
  				rooms[i] = match.get(floorMod(index + i, match.size()));
  			}
  		}
  
  		return true;
  	}
focal_method.class_method_signature: RotationSolver.solve(RaidRoom[] rooms)
focal_method.full_signature: static boolean solve(RaidRoom[] rooms)
focal_method.identifier: solve
focal_method.invocations: getType size get getType get floorMod size getType get floorMod size
focal_method.modifiers: static
focal_method.parameters: (RaidRoom[] rooms)
focal_method.return: boolean
focal_method.signature: boolean solve(RaidRoom[] rooms)