### Question:
DirectoryUserTotp { @Override public int hashCode() { return Objects.hash(secret, algorithm, digits, period); } DirectoryUserTotp(String secret, String algorithm, int period, int digits); String getSecret(); String getAlgorithm(); int getDigits(); int getPeriod(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test public void hashEqualIfObjectsAreEqual() { assertEquals(new DirectoryUserTotp("secret", "algorithm", 1234, 4321).hashCode(), model.hashCode()); }
@Test public void hashNotEqualWithDifferentSecret() { assertNotEquals(new DirectoryUserTotp("secret1", "algorithm", 1234, 4321).hashCode(), model.hashCode()); }
@Test public void hashNotEqualWithDifferentAlgorithm() { assertNotEquals(new DirectoryUserTotp("secret", "algorithm1", 1234, 4321).hashCode(), model.hashCode()); }
@Test public void hashNotEqualWithDifferentDigits() { assertNotEquals(new DirectoryUserTotp("secret", "algorithm", 12345, 4321).hashCode(), model.hashCode()); }
@Test public void hashNotEqualWithDifferentPeriod() { assertNotEquals(new DirectoryUserTotp("secret", "algorithm", 1234, 43210).hashCode(), model.hashCode()); }