### Question:
AuthPolicy { @Override public int hashCode() { return Objects.hash(getRequiredFactors(), requireKnowledgeFactor, requireInherenceFactor, requirePossessionFactor, getLocations(), enableJailbreakProtection); } 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 hashCodeEqualWhenObjectsEqual() throws Exception { AuthPolicy left = new AuthPolicy(false, true, false, false, new ArrayList<AuthPolicy.Location>()); AuthPolicy right = new AuthPolicy(false, true, false, false, new ArrayList<AuthPolicy.Location>()); assertEquals(left.hashCode(), right.hashCode()); }
@Test public void hashCodeNotEqualWhenObjectsNotEqual() throws Exception { AuthPolicy left = new AuthPolicy(false, true, false, false, new ArrayList<AuthPolicy.Location>()); AuthPolicy right = new AuthPolicy(false, false, false, false, new ArrayList<AuthPolicy.Location>()); assertNotEquals(left.hashCode(), right.hashCode()); }
@Test public void hashCodeNotEqualWhenObjectsNotEqualDueToIsJailbreakEnabled() throws Exception { AuthPolicy left = new AuthPolicy(false, false, false, false, new ArrayList<AuthPolicy.Location>()); AuthPolicy right = new AuthPolicy(false, false, false, true, new ArrayList<AuthPolicy.Location>()); assertNotEquals(left.hashCode(), right.hashCode()); }