@Test public void testHasSessionWithUUID() { final SessionManager sessionManager = SessionManager.getInstance(); assertFalse(sessionManager.hasSessionWithUUID(UUID.randomUUID().toString())); sessionManager.createSession(Source.USER_ENTERED, TEST_URL); assertTrue(sessionManager.hasSession()); final Session session = sessionManager.getCurrentSession(); assertNotNull(session); assertTrue(sessionManager.hasSessionWithUUID(session.getUUID())); assertNotNull(sessionManager.getSessionByUUID(session.getUUID())); }
public boolean hasSessionWithUUID(@NonNull String uuid) { for (Session session : sessions.getValue()) { if (uuid.equals(session.getUUID())) { return true; } } return false; }
SessionManager { public boolean hasSessionWithUUID(@NonNull String uuid) { for (Session session : sessions.getValue()) { if (uuid.equals(session.getUUID())) { return true; } } return false; } }
SessionManager { public boolean hasSessionWithUUID(@NonNull String uuid) { for (Session session : sessions.getValue()) { if (uuid.equals(session.getUUID())) { return true; } } return false; } private  SessionManager(); }
SessionManager { public boolean hasSessionWithUUID(@NonNull String uuid) { for (Session session : sessions.getValue()) { if (uuid.equals(session.getUUID())) { return true; } } return false; } private  SessionManager(); static SessionManager getInstance(); boolean hasSession(); Session getCurrentSession(); boolean isCurrentSession(@NonNull Session session); boolean hasSessionWithUUID(@NonNull String uuid); Session getSessionByUUID(@NonNull String uuid); int getNumberOfSessions(); int getPositionOfCurrentSession(); NonNullLiveData<List<Session>> getSessions(); void createSession(@NonNull Source source, @NonNull String url); void removeAllSessions(); void removeCurrentSession(); }
SessionManager { public boolean hasSessionWithUUID(@NonNull String uuid) { for (Session session : sessions.getValue()) { if (uuid.equals(session.getUUID())) { return true; } } return false; } private  SessionManager(); static SessionManager getInstance(); boolean hasSession(); Session getCurrentSession(); boolean isCurrentSession(@NonNull Session session); boolean hasSessionWithUUID(@NonNull String uuid); Session getSessionByUUID(@NonNull String uuid); int getNumberOfSessions(); int getPositionOfCurrentSession(); NonNullLiveData<List<Session>> getSessions(); void createSession(@NonNull Source source, @NonNull String url); void removeAllSessions(); void removeCurrentSession();  }