@Test
public void testNext() throws Exception {

    VersionIterator delegate = mock(VersionIterator.class);
    VersionIteratorFacade<Session> facade = getFacade(delegate);
    final Version value = mock(Version.class);
    final String path = "/correct/path";
    when(value.getPath()).thenReturn(path);
    when(delegate.nextVersion()).thenReturn(value);
    final Object fromFacade = facade.next();
    assertTrue("is version", fromFacade instanceof Version);
    final Version nodeFromFacade = (Version) fromFacade;
    assertEquals("same path", path, nodeFromFacade.getPath());
    assertTrue("is facade", nodeFromFacade instanceof VersionFacade);
}