private boolean handlePrechecks(FutureResult futureResult, Callback callback) {
    boolean continueOp = true;
    if (!routerOpen.get()) {
      continueOp = false;
      completeOperation(futureResult, callback, null,
          new RouterException("Cannot accept operation because Router is closed", RouterErrorCode.RouterClosed));
    } else if (verifiableProperties.containsKey(OPERATION_THROW_EARLY_RUNTIME_EXCEPTION)) {
      throw new RuntimeException(OPERATION_THROW_EARLY_RUNTIME_EXCEPTION);
    } else if (verifiableProperties.containsKey(OPERATION_THROW_LATE_RUNTIME_EXCEPTION)) {
      continueOp = false;
      completeOperation(futureResult, callback, null, new RuntimeException(OPERATION_THROW_LATE_RUNTIME_EXCEPTION));
    } else if (verifiableProperties.containsKey(OPERATION_THROW_ROUTER_EXCEPTION)) {
      continueOp = false;
      RouterErrorCode errorCode = RouterErrorCode.UnexpectedInternalError;
      try {
        errorCode = RouterErrorCode.valueOf(verifiableProperties.getString(OPERATION_THROW_ROUTER_EXCEPTION));
      } catch (IllegalArgumentException e) {
        // it's alright.
      }
      RouterException routerException = new RouterException(OPERATION_THROW_ROUTER_EXCEPTION, errorCode);
      completeOperation(futureResult, callback, null, routerException);
    }
    return continueOp;
  }
Does pre checks and throws exceptions if necessary or requested for.
@param futureResult the {@link FutureResult} to update in case the operation has to be completed.
@param callback the {@link Callback} that needs to be invoked in case the operation has to be completed. Can be
                null.
@return if {@code true}, the rest of the code can continue.
ambry-test-utils/src/main/java/com/github/ambry/router/InMemoryRouter.java