PlanningVisitFactory { public static PlanningVisit fromLocation(PlanningLocation location) { return fromLocation(location, DEFAULT_VISIT_DEMAND); } private  PlanningVisitFactory(); static PlanningVisit fromLocation(PlanningLocation location); static PlanningVisit fromLocation(PlanningLocation location, int demand); static PlanningVisit testVisit(long id);  }
@Test void visit_should_have_same_id_as_location_and_default_demand() { long id = 4; PlanningLocation location = PlanningLocationFactory.testLocation(id); PlanningVisit visit = PlanningVisitFactory.fromLocation(location); assertThat(visit.getId()).isEqualTo(location.getId()); assertThat(visit.getLocation()).isEqualTo(location); assertThat(visit.getDemand()).isEqualTo(PlanningVisitFactory.DEFAULT_VISIT_DEMAND); }