private void completeOperation(Callback<Void> callback, boolean misbehaveIfRequired) {
      if (misbehaveIfRequired && exceptionToThrow != null) {
        throw exceptionToThrow;
      }
      callback.onCompletion(null, misbehaveIfRequired ? exceptionToReturn : null);
    }
Completes the operation by invoking the {@code callback}.
@param callback the {@link Callback} to invoke.
@param misbehaveIfRequired whether to exhibit misbehavior or not.
ambry-frontend/src/test/java/com/github/ambry/frontend/FrontendRestRequestServiceTest.java