InjectorDependencyNode implements DependencyNode { @Override public boolean canBe(State state) { return (state == State.STOPPED && running); }  @Override Class<?> getRepresentedType(); @Override Set<Dependency> getDependencies(); @Override List<Execution<?>> getExecutions(); @Override State getCurrentState(); @Override void setState(State newState); @Override boolean canBe(State state); @Override boolean is(State state);  }
@Test void canBe() { assertFalse(instance.canBe(State.CREATED)); assertFalse(instance.canBe(State.INITIALIZED)); assertFalse(instance.canBe(State.RESOLVED)); assertFalse(instance.canBe(State.STARTED)); assertTrue(instance.canBe(State.STOPPED)); instance.setState(State.STOPPED); assertFalse(instance.canBe(State.CREATED)); assertFalse(instance.canBe(State.INITIALIZED)); assertFalse(instance.canBe(State.RESOLVED)); assertFalse(instance.canBe(State.STARTED)); assertFalse(instance.canBe(State.STOPPED)); }