### Question:
AuthPolicy { public List<Location> getLocations() { return locations; } AuthPolicy(List<Location> locations);  AuthPolicy(int requiredFactors);  AuthPolicy(Integer requiredFactors, List<Location> locations);  AuthPolicy(Integer requiredFactors, Boolean enableJailbreakProtection, List<Location> locations);  AuthPolicy(Boolean requireKnowledgeFactor, Boolean requireInherenceFactor, Boolean requirePossessionFactor);  AuthPolicy(Boolean requireKnowledgeFactor, Boolean requireInherenceFactor, Boolean requirePossessionFactor,
                      List<Location> locations);  AuthPolicy(Boolean requireKnowledgeFactor, Boolean requireInherenceFactor, Boolean requirePossessionFactor,
                      Boolean enableJailbreakProtection, List<Location> locations); Integer getRequiredFactors(); Boolean isKnowledgeFactorRequired(); Boolean isInherenceFactorRequired(); Boolean isPossessionFactorRequired(); Boolean isJailbreakProtectionEnabled(); List<Location> getLocations(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void getLocationsReturnsEmptyListForRequiredFactorsConstructor() throws Exception { assertEquals(new ArrayList<AuthPolicy.Location>(), new AuthPolicy(99).getLocations()); }
@Test public void getLocationsReturnsEquivalentListForRequiredFactorsLocationsConstructor() throws Exception { List<AuthPolicy.Location> expected = new ArrayList<>(); expected.add(new AuthPolicy.Location(1.1, 2.2, 3.3)); assertEquals(expected, new AuthPolicy(99, expected).getLocations()); }
@Test public void getLocationsReturnsEquivalentListForRequiredFactorsJailbreakProtectionLocationsConstructor() throws Exception { List<AuthPolicy.Location> expected = new ArrayList<>(); expected.add(new AuthPolicy.Location(1.1, 2.2, 3.3)); assertEquals(expected, new AuthPolicy(99, true, expected).getLocations()); }
@Test public void getLocationsReturnsEquivalentListForLocationsConstructor() throws Exception { List<AuthPolicy.Location> expected = new ArrayList<>(); expected.add(new AuthPolicy.Location(1.1, 2.2, 3.3)); assertEquals(expected, new AuthPolicy(expected).getLocations()); }
@Test public void getLocationsReturnsEmptyListForFactorRequiredConstructor() throws Exception { assertEquals(new ArrayList<AuthPolicy.Location>(), new AuthPolicy(true, true, true).getLocations()); }
@Test public void getLocationsReturnsEquivalentListForFactorRequiredLocationsConstructor() throws Exception { List<AuthPolicy.Location> expected = new ArrayList<>(); expected.add(new AuthPolicy.Location(1.1, 2.2, 3.3)); assertEquals(expected, new AuthPolicy(true, true, true, expected).getLocations()); }
@Test public void getLocationsReturnsEquivalentListForFactorRequiredJailbreakProtectionLocationsConstructor() throws Exception { List<AuthPolicy.Location> expected = new ArrayList<>(); expected.add(new AuthPolicy.Location(1.1, 2.2, 3.3)); assertEquals(expected, new AuthPolicy(true, true, true, true, expected).getLocations()); }
@Test public void getLocationsIsNotTheSameListPassedInConstructor() throws Exception { List<AuthPolicy.Location> expected = new ArrayList<>(); expected.add(new AuthPolicy.Location(1.1, 2.2, 3.3)); assertNotSame(expected, new AuthPolicy(expected).getLocations()); }