SessionData { @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((id == null) ? 0 : id.hashCode()); result = prime * result + (int)(originalLastAccessed ^ (originalLastAccessed >>> 32)); return result; } SessionData(String id, long lastAccessedTime, int maxInactiveInterval, long creationTime,
      String previousOwner);  SessionData(String sessionId, long creationTime, int maxInactiveInterval); String getId(); void setId(String id); long getCreationTime(); void setCreationTime(long creationTime); long getLastAccessedTime(); void setLastAccessedTime(long lastAccessedTime); int getMaxInactiveInterval(); void setMaxInactiveInterval(int maxInactiveInterval); boolean isNew(); void setNew(boolean isNew); boolean isMaybeInRepository(String name); Set<String> getRepositoryKeys(); Set<String> getMandatoryRemoteKeys(); void setMandatoryRemoteKeys(Set<String> mandatoryRemoteKeys); long getOriginalLastAccessed(); String getPreviousOwner(); long expiresAt(); boolean isNonCacheable(String key); String getOldSessionId(); void setNewSessionId(String newSessionId); String getOriginalId(); boolean isIdChanged(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }
@Test public void testHashCode() { assertEquals(hash("1", 100L, 200), hash("1", 100L, 300)); assertNotEquals(hash("1", 100L, 200), hash("2", 100L, 300)); assertNotEquals(hash("1", 100L, 200), hash("1", 200L, 300)); }