@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));
}