SurfMover { List<SurfOption> getSortedSurfOptions() { List<SurfOption> surfOptions = Arrays.asList(SurfOption.values()); for (int x = 0; x < surfOptions.size(); x++) { double lowestDanger = getSurfOptionDanger(surfOptions.get(x)); for (int y = x + 1; y < surfOptions.size(); y++) { if (getSurfOptionDanger(surfOptions.get(y)) < lowestDanger) { lowestDanger = getSurfOptionDanger(surfOptions.get(y)); SurfOption temp = surfOptions.get(x); surfOptions.set(x, surfOptions.get(y)); surfOptions.set(y, temp); } } } return surfOptions; } SurfMover(AdvancedRobot robot, BattleField battleField,
      Collection<RoboGraphic> renderables, OutputStream out); void initRound(); void move(RobotState myRobotState, MoveEnemy duelEnemy,
      int wavesToSurf, boolean painting); void roundOver(MoveEnemy duelEnemy);  }
@Test public void testGetSortedSurfOptions() { SurfMover mover = newSurfMover(); Map<SurfOption, Double> surfOptionDangers = mover.getSurfOptionDangers(); surfOptionDangers.put(SurfOption.CLOCKWISE, 3.0); surfOptionDangers.put(SurfOption.COUNTER_CLOCKWISE, 1.0); surfOptionDangers.put(SurfOption.STOP, 2.0); List<SurfOption> sortedSurfOptions = mover.getSortedSurfOptions(); assertEquals(SurfOption.COUNTER_CLOCKWISE, sortedSurfOptions.get(0)); assertEquals(SurfOption.STOP, sortedSurfOptions.get(1)); assertEquals(SurfOption.CLOCKWISE, sortedSurfOptions.get(2)); }