SessionResolverImpl implements SessionResolver { @Override public Collection<MenuSession> findAllByTemplate(MenuTemplate menuTemplate) { return ImmutableSet.copyOf(activeSessionsByTemplates.get(menuTemplate)); } SessionResolverImpl(); @Override Collection<MenuSession> findAllByTemplate(MenuTemplate menuTemplate); @Override Optional<MenuSession> getSession(Player player); @Override Optional<PaginatedMenuSession> getLastPaginatedSession(Player player);  }
@Test public void findAllByTemplate() { MenuSession vasyaSes = apiInstance.getMenuFactory().createSingleSession(vasya, randomTemplate); sessionResolver.addNewSession(vasyaSes); MenuSession petyaSes = apiInstance.getMenuFactory().createSingleSession(petya, randomTemplate); sessionResolver.addNewSession(petyaSes); Collection<MenuSession> allByTemplate = sessionResolver.findAllByTemplate(randomTemplate); assertEquals(allByTemplate.size(), 2); assertTrue(allByTemplate.contains(vasyaSes)); assertTrue(allByTemplate.contains(petyaSes)); }