code: @SuppressWarnings("unchecked")
    public <T> CompletableFuture<T> apply(Entry entry) {
      LOGGER.trace("{} - Applying {}", state.getCluster().member().address(), entry);
      if (entry instanceof QueryEntry) {
        return (CompletableFuture<T>) apply((QueryEntry) entry);
      } else if (entry instanceof CommandEntry) {
        return (CompletableFuture<T>) apply((CommandEntry) entry);
      } else if (entry instanceof RegisterEntry) {
        return (CompletableFuture<T>) apply((RegisterEntry) entry);
      } else if (entry instanceof KeepAliveEntry) {
        return (CompletableFuture<T>) apply((KeepAliveEntry) entry);
      } else if (entry instanceof UnregisterEntry) {
        return (CompletableFuture<T>) apply((UnregisterEntry) entry);
      } else if (entry instanceof InitializeEntry) {
        return (CompletableFuture<T>) apply((InitializeEntry) entry);
      } else if (entry instanceof ConfigurationEntry) {
        return (CompletableFuture<T>) apply((ConfigurationEntry) entry);
      }
      return Futures.exceptionalFuture(new InternalException("unknown state machine operation"));
    }
docs: Applies an entry to the state machine.
  <p>
  Calls to this method are assumed to expect a result. This means linearizable session events
  triggered by the application of the given entry will be awaited before completing the returned future.
  
  @param entry The entry to apply.
  @return A completable future to be completed with the result.