SessionRepository { public LocalSession createSession(File applicationDirectory, ApplicationId applicationId, TimeoutBudget timeoutBudget) { applicationRepo.createApplication(applicationId); Optional<Long> activeSessionId = applicationRepo.activeSessionOf(applicationId); return create(applicationDirectory, applicationId, activeSessionId, false, timeoutBudget); } SessionRepository(TenantName tenantName,
                             GlobalComponentRegistry componentRegistry,
                             TenantApplications applicationRepo,
                             FlagSource flagSource,
                             SessionPreparer sessionPreparer); synchronized void addLocalSession(LocalSession session); LocalSession getLocalSession(long sessionId); Collection<LocalSession> getLocalSessions(); ConfigChangeActions prepareLocalSession(LocalSession session,
                                                   DeployLogger logger,
                                                   PrepareParams params,
                                                   Path tenantPath,
                                                   Instant now); void deleteExpiredSessions(Map<ApplicationId, Long> activeSessions); void deleteLocalSession(LocalSession session); void close(); RemoteSession getRemoteSession(long sessionId); List<Long> getRemoteSessions(); int deleteExpiredRemoteSessions(Clock clock, Duration expiryTime); void deactivate(RemoteSession remoteSession); void deleteRemoteSessionFromZooKeeper(RemoteSession session); synchronized void sessionAdded(long sessionId); void delete(RemoteSession remoteSession); ApplicationSet ensureApplicationLoaded(RemoteSession session); LocalSession createSession(File applicationDirectory, ApplicationId applicationId, TimeoutBudget timeoutBudget); synchronized RemoteSession createRemoteSession(long sessionId); LocalSession createSessionFromExisting(Session existingSession,
                                                  DeployLogger logger,
                                                  boolean internalRedeploy,
                                                  TimeoutBudget timeoutBudget); Optional<ApplicationSet> getActiveApplicationSet(ApplicationId appId); void createLocalSessionUsingDistributedApplicationPackage(long sessionId); Path getSessionPath(long sessionId); @Override String toString(); Clock clock(); Transaction createActivateTransaction(Session session);  }
@Test public void testInitialize() throws Exception { setup(); createSession(10L, false); createSession(11L, false); assertRemoteSessionExists(10L); assertRemoteSessionExists(11L); }