### Question:
ServicePolicy { @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof ServicePolicy)) return false; ServicePolicy that = (ServicePolicy) o; if (requiredFactors != that.requiredFactors) return false; if (requireKnowledgeFactor != that.requireKnowledgeFactor) return false; if (requireInherenceFactor != that.requireInherenceFactor) return false; if (requirePossessionFactor != that.requirePossessionFactor) return false; if (jailBreakProtectionEnabled != that.jailBreakProtectionEnabled) return false; if (locations != null ? !locations.equals(that.locations) : that.locations != null) return false; return timeFences != null ? timeFences.equals(that.timeFences) : that.timeFences == null; } 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 equalsIsTrueForSameValues() throws Exception { assertTrue(new ServicePolicy().equals(new ServicePolicy())); }
@Test public void equalsIsFalseForDifferentRequiredFactors() throws Exception { assertFalse(new ServicePolicy(1, false).equals(new ServicePolicy(2, false))); }
@Test public void equalsIsFalseForDifferentKnowledgeFactorRequired() throws Exception { assertFalse(new ServicePolicy(true, false, false, false).equals(new ServicePolicy(false, false, false, false))); }
@Test public void equalsIsFalseForDifferentInherenceFactorRequired() throws Exception { assertFalse(new ServicePolicy(false, true, false, false).equals(new ServicePolicy(false, false, false, false))); }
@Test public void equalsIsFalseForDifferentPossessionFactorRequired() throws Exception { assertFalse(new ServicePolicy(false, false, true, false).equals(new ServicePolicy(false, false, false, false))); }
@Test public void equalsIsFalseForDifferentJailBreakProtectedEnabled() throws Exception { assertFalse(new ServicePolicy(false, false, false, true).equals(new ServicePolicy(false, false, false, false))); }