package hello;

import com.google.common.net.MediaType;
import io.undertow.server.HttpHandler;
import io.undertow.server.HttpServerExchange;
import io.undertow.util.Headers;

import static hello.HelloWebServer.TEXT_PLAIN;

/**
 * Handles the plaintext test.
 */
final class PlaintextHandler implements HttpHandler {
  @Override
  public void handleRequest(HttpServerExchange exchange) throws Exception {
    exchange.getResponseHeaders().put(
        Headers.CONTENT_TYPE, TEXT_PLAIN);
    exchange.getResponseSender().send("Hello, World!");
  }
}

@@ -166,16 +166,44 @@
 Headers;
+%0Aimport java.nio.ByteBuffer;
 %0A%0Aimport
@@ -337,16 +337,364 @@
 ndler %7B%0A
+  private static final ByteBuffer buffer;%0A  private static final String MESSAGE = %22Hello, World!%22;%0A%0A  static %7B%0A      buffer = ByteBuffer.allocateDirect(MESSAGE.length());   %0A      try %7B%0A          buffer.put(MESSAGE.getBytes(%22US-ASCII%22));%0A      %7D catch (Exception e) %7B%0A          throw new RuntimeException(e);%0A      %7D%0A      buffer.flip();%0A  %7D%0A     %0A
   @Overr
@@ -893,31 +893,34 @@
 ().send(
-%22Hello, World!%22
+buffer.duplicate()
 );%0A  %7D%0A%7D

Make test apples to apples with other framework tests that have started caching the response buffer