synchronized boolean tryToMoveTo(State to) {
    boolean res = false;
    State currentState = state;
    if (TRANSITIONS.get(currentState).contains(to)) {
      this.state = to;
      res = true;
    }
    LOG.debug("{} tryToMoveTo from {} to {} => {}", Thread.currentThread().getName(), currentState, to, res);
    return res;
  }
@Test
  @UseDataProvider("allStates")
  public void RESTARTING_is_only_allowed_from_STARTING_and_OPERATIONAL(NodeLifecycle.State state) {
    if (state == STARTING || state == OPERATIONAL) {
      verifyMoveTo(newNodeLifecycle(state), RESTARTING);
    } else {
      assertThat(newNodeLifecycle(state).tryToMoveTo(RESTARTING)).isFalse();
    }
  }