RepositoryBackedSession { public List<String> getAttributeNamesWithValues() { ArrayList<String> keys = new ArrayList<>(attrs.size()); for (Map.Entry<String, Attribute> entry : attrs.entrySet()) { if (entry.getValue().value != null) { keys.add(entry.getKey()); } } return keys; } 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 testGetAttributeNamesWithValues() { RepositoryBackedSession rbs = new RepositoryBackedSession(sessionData, manager, factory); rbs.setAttribute("Test", "value"); rbs.setAttribute("TestChanged", "valueOriginal"); rbs.setAttribute("TestChanged", "valueFinal"); rbs.setAttribute("TestToDelete", "value"); rbs.removeAttribute("TestToDelete"); List<String> list = rbs.getAttributeNamesWithValues(); assertThat(list, hasItems("Test", "TestChanged")); assertThat(list, not(hasItems("TestToDelete"))); }