SurveyUpdater { public static boolean update(Survey survey, List<Leg> legs, InputMode inputMode) { boolean anyStationsAdded = false; for (Leg leg : legs) { anyStationsAdded = anyStationsAdded || update(survey, leg, inputMode); } return anyStationsAdded; }  static boolean update(Survey survey, List<Leg> legs, InputMode inputMode); static boolean update(Survey survey, List<Leg> legs); static boolean update(Survey survey, Leg leg); static synchronized boolean update(Survey survey, Leg leg, InputMode inputMode); static void updateWithNewStation(Survey survey, Leg leg); static void upgradeSplayToConnectedLeg(Survey survey, Leg leg, InputMode inputMode); static synchronized void editLeg(
            final Survey survey, final Leg toEdit, final Leg edited); static void renameStation(Survey survey, Station station, String name); static void moveLeg(Survey survey, Leg leg, Station newSource); static void deleteStation(final Survey survey, final Station toDelete); static void deleteSplay(Survey survey, Station station, Leg splay); static boolean areLegsBacksights(Leg fore, Leg back); static Leg averageLegs(List<Leg> repeats); static Leg averageBacksights(Leg fore, Leg back); static void reverseLeg(final Survey survey, final Station toReverse); static void setDirectionOfSubtree(Survey survey, Station station, Direction direction);  }
@Test public void testUpdateWithOneLegAddsOneLegToSurvey() { Leg leg = new Leg(5, 0, 0); Survey survey = new Survey("Test Survey"); SurveyUpdater.update(survey, leg); Assert.assertEquals(survey.getAllLegs().size(), 1); }
@Test public void testUpdateWithThreeSimilarLegsLeadsToNewStation() { Leg leg = new Leg(5, 0, 0); Leg similarLeg = new Leg(5, 0.001, 0); Leg anotherSimilarLeg = new Leg(5, 0, 0.001); Survey survey = new Survey("Test Survey"); SurveyUpdater.update(survey, leg); SurveyUpdater.update(survey, similarLeg); SurveyUpdater.update(survey, anotherSimilarLeg); Assert.assertEquals(survey.getAllStations().size(), 2); }