### Question:
ServicePolicy { public List<Location> getLocations() { return locations; } ServicePolicy(int requiredFactors, boolean jailBreakProtectionEnabled);  ServicePolicy(boolean requireKnowledgeFactor, boolean requireInherenceFactor,
                         boolean requirePossessionFactor, boolean jailBreakProtectionEnabled);  ServicePolicy();  ServicePolicy(Integer requiredFactors, Boolean requireKnowledgeFactor, Boolean requireInherenceFactor,
                         Boolean requirePossessionFactor, Boolean jailBreakProtectionEnabled, List<Location> locations,
                         List<TimeFence> timeFences); Integer getRequiredFactors(); Boolean isKnowledgeFactorRequired(); Boolean isInherenceFactorRequired(); Boolean isPossessionFactorRequired(); void addLocations(List<Location> locations); List<Location> getLocations(); void addTimeFences(List<TimeFence> timeFences); List<TimeFence> getTimeFences(); Boolean isJailBreakProtectionEnabled(); @Override boolean equals(Object o); @Override String toString();  }### Answer:
@Test public void getLocations() throws Exception { List<ServicePolicy.Location> expected = Arrays.asList(mock(ServicePolicy.Location.class), mock( ServicePolicy.Location.class)); ServicePolicy policy = new ServicePolicy(); policy.addLocations(expected); assertEquals(expected, policy.getLocations()); }