RepositoryBackedSession { static boolean isImmutableType(Object obj) { return obj instanceof Number || obj instanceof Character || obj instanceof String || obj instanceof Boolean || obj instanceof Enum; } RepositoryBackedSession(SessionData sessionData, SessionManager manager, SessionFactory factory); protected  RepositoryBackedSession(RepositoryBackedSession linked); void setMaxInactiveInterval(int maxInactiveInterval); Object getAttribute(String key); @SuppressWarnings({ "rawtypes" }) Enumeration getAttributeNames(); List<String> getAttributeNamesWithValues(); long getCreationTime(); String getId(); long getLastAccessedTime(); int getMaxInactiveInterval(); void invalidate(); void doInvalidate(boolean expired); boolean isNew(); void removeAttribute(String name); Attribute getAttributeFromCache(String name); void setAttribute(String key, Object value); synchronized void commit(); boolean isValid(); boolean isExpired(); boolean isDirty(); Runnable getCommitter(); SessionData getSessionData(); boolean isCommitted(); void setCommitted(boolean committed); SessionManager getSessionManager(); int getConcurrentUses();  }
@Test public void testIsImmutable() { assertTrue(RepositoryBackedSession.isImmutableType("")); assertTrue(RepositoryBackedSession.isImmutableType(Boolean.FALSE)); assertTrue(RepositoryBackedSession.isImmutableType(Character.valueOf(' '))); assertTrue(RepositoryBackedSession.isImmutableType(Integer.valueOf(1))); assertTrue(RepositoryBackedSession.isImmutableType(Long.valueOf(2))); assertTrue(RepositoryBackedSession.isImmutableType(Float.valueOf(3))); assertTrue(RepositoryBackedSession.isImmutableType(ReplicationTrigger.SET_AND_NON_PRIMITIVE_GET)); assertFalse(RepositoryBackedSession.isImmutableType(new HashSet<>())); assertFalse(RepositoryBackedSession.isImmutableType(mock(Object.class))); }