public boolean tryToMoveTo(State to) {
    AtomicReference<State> lastFrom = new AtomicReference<>();
    State newState = this.state.updateAndGet(from -> {
      lastFrom.set(from);
      if (TRANSITIONS.get(from).contains(to)) {
        return to;
      }
      return from;
    });

    boolean updated = newState == to && lastFrom.get() != to;
    LOG.trace("tryToMoveTo from {} to {} => {}", lastFrom.get(), to, updated);
    return updated;
  }
@Test
  public void can_move_to_STARTING_from_RESTARTING() {
    assertThat(newLifeCycle(RESTARTING).tryToMoveTo(STARTING)).isTrue();
  }