SessionResolverImpl implements SessionResolver { @Override public Optional<PaginatedMenuSession> getLastPaginatedSession(Player player) { return Optional.ofNullable(paginatedSessions.get(player)); } SessionResolverImpl(); @Override Collection<MenuSession> findAllByTemplate(MenuTemplate menuTemplate); @Override Optional<MenuSession> getSession(Player player); @Override Optional<PaginatedMenuSession> getLastPaginatedSession(Player player);  }
@Test public void getLastPaginatedSession() { PaginatedMenuTemplate paginatedMenuTemplate = apiInstance.templateBuilder().paginatedTemplate() .setMainPage(randomTemplate) .withPage(randomTemplate) .withPage(veryRandomTemplate) .build(); PaginatedMenuSession paginatedSession = apiInstance.getMenuFactory().createPaginatedSession(vasya, paginatedMenuTemplate); Optional<PaginatedMenuSession> lastPaginatedSession = sessionResolver.getLastPaginatedSession(vasya); assertTrue(lastPaginatedSession.isPresent()); assertEquals(lastPaginatedSession.get(), paginatedSession); }