private Future<Long> markFutureInvokeCallback(Callback<Long> callback, long totalBytesWritten, Exception exception) {
    FutureResult<Long> futureResult = new FutureResult<Long>();
    futureResult.done(totalBytesWritten, exception);
    if (callback != null) {
      callback.onCompletion(totalBytesWritten, exception);
    }
    return futureResult;
  }
Creates and marks a future as done and invoked the callback with paramaters {@code totalBytesWritten} and
{@code Exception}.
@param callback the {@link Callback} to invoke.
@param totalBytesWritten the number of bytes successfully written.
@param exception the {@link Exception} that occurred if any.
@return the {@link Future} that will contain the result of the operation.
ambry-rest/src/test/java/com/github/ambry/rest/NettyRequestTest.java