SessionManager { public Collection<Session> getUserSessions(String httpid) { return Collections.unmodifiableCollection(getValidSessionsElseRemove(httpid, ISOPEN)); }  void linkWsToHttp(Session ws, String httpid); void unlinkWs(String wsid); Collection<Session> getUserSessions(String httpid);  }
@Test(expected = UnsupportedOperationException.class) public void testGetUserSessions() { System.out.println("getUserSessions"); String httpid = "HTTPID"; Collection wss = mock(Collection.class); doReturn(wss).when(instance).getValidSessionsElseRemove(eq(httpid), any(Predicate.class)); Collection<Session> result = instance.getUserSessions(httpid); result.add(getMockWs()); }