@Test
public void testSetAttribute() {

  RepositoryBackedSession rbs = new RepositoryBackedSession(sessionData, manager, factory);
  rbs.setAttribute("Test", "value");
  verify(repository).getSessionAttribute(sessionData("1"), "Test");
  verify(repository, never()).setSessionAttribute(any(SessionData.class), any(String.class), any());
  verify(notifier, never()).attributeHasBeenRestored(refEq(rbs), eq("Test"), any());
  verify(notifier, never()).attributeReplaced(refEq(rbs), eq("Test"), any());
  verify(notifier).attributeAdded(refEq(rbs), eq("Test"), eq("value"));
  assertEquals("value", rbs.getAttribute("Test"));
}