StateUtil { public static boolean isConsumingResources(RunState.State state) { return List.of( RunState.State.PREPARE, RunState.State.SUBMITTING, RunState.State.SUBMITTED, RunState.State.RUNNING).contains(state); } private  StateUtil(); static Set<String> workflowResources(boolean globalConcurrenyEnabled,
                                              Optional<Workflow> workflowOpt); static boolean hasTimedOut(Optional<Workflow> workflowOpt, RunState runState, Instant instant,
                                     Duration timeout); static boolean isConsumingResources(RunState.State state);  }
@Test public void shouldConsumeResource() { assertTrue(StateUtil.isConsumingResources(RunState.State.PREPARE)); assertTrue(StateUtil.isConsumingResources(RunState.State.SUBMITTING)); assertTrue(StateUtil.isConsumingResources(RunState.State.SUBMITTED)); assertTrue(StateUtil.isConsumingResources(RunState.State.RUNNING)); }
@Test public void shouldNotConsumeResource() { assertFalse(StateUtil.isConsumingResources(RunState.State.NEW)); assertFalse(StateUtil.isConsumingResources(RunState.State.QUEUED)); assertFalse(StateUtil.isConsumingResources(RunState.State.TERMINATED)); assertFalse(StateUtil.isConsumingResources(RunState.State.FAILED)); assertFalse(StateUtil.isConsumingResources(RunState.State.ERROR)); assertFalse(StateUtil.isConsumingResources(RunState.State.DONE)); }