PersistentStateManager implements StateManager { @Override public Map<WorkflowInstance, RunState> getActiveStates() { try { return storage.readActiveStates(); } catch (IOException e) { throw new RuntimeException(e); } } PersistentStateManager(
      Time time,
      ExecutorService executor,
      Storage storage,
      BiConsumer<SequenceEvent, RunState> eventConsumer,
      Executor eventConsumerExecutor,
      OutputHandler outputHandler,
      ShardedCounter shardedCounter);   PersistentStateManager(
      Time time,
      ExecutorService executor,
      Storage storage,
      BiConsumer<SequenceEvent, RunState> eventConsumer,
      Executor eventConsumerExecutor,
      OutputHandler outputHandler,
      ShardedCounter shardedCounter,
      Logger logger); @Override void tick(); @Override void trigger(WorkflowInstance workflowInstance, Trigger trigger, TriggerParameters parameters); @Override void receive(Event event); @Override void receive(Event event, long expectedCounter); @Override Set<WorkflowInstance> listActiveInstances(); @Override Map<WorkflowInstance, RunState> getActiveStates(); @Override Map<WorkflowInstance, RunState> getActiveStatesByTriggerId(String triggerId); @Override Optional<RunState> getActiveState(WorkflowInstance workflowInstance); @Override void close();  }
@Test public void shouldGetRunStates() throws Exception { RunState runState = RunState.create( INSTANCE, State.QUEUED, StateData.zero(), NOW.minusMillis(1), 17); Map<WorkflowInstance, RunState> states = Maps.newConcurrentMap(); states.put(INSTANCE, runState); when(storage.readActiveStates()).thenReturn(states); Map<WorkflowInstance, RunState> returnedRunStates = stateManager.getActiveStates(); assertThat(returnedRunStates.get(INSTANCE), is(runState)); assertThat(returnedRunStates.size(), is(1)); }