FieldConfiguration { public static FieldConfiguration parseFmsInfo(FmsInfo info) { Alliance alliance = info.getAlliance(); String message = info.getGameSpecificMessage(); if (alliance == null || message.isEmpty() || message.length() != 3) { return EMPTY; } return new FieldConfiguration( getConfig(Element.NEAR_SWITCH, alliance, message), getConfig(Element.SCALE, alliance, message), getConfig(Element.FAR_SWITCH, alliance, message) ); } FieldConfiguration(Configuration nearSwitch, Configuration scale, Configuration farSwitch); static FieldConfiguration parseFmsInfo(FmsInfo info); Configuration getNearSwitch(); Configuration getScale(); Configuration getFarSwitch();  }
@Test public void testParseFmsInfo() { FmsInfo info = new FmsInfo("LRL", "", 0, 0, MatchType.NONE, Alliance.BLUE, 0, ControlWord.fromBits(0)); FieldConfiguration configuration = FieldConfiguration.parseFmsInfo(info); assertEquals(Configuration.RED_RIGHT, configuration.getNearSwitch()); assertEquals(Configuration.RED_LEFT, configuration.getScale()); assertEquals(Configuration.RED_RIGHT, configuration.getFarSwitch()); }