JavaApiConverter { static Map<String, List<String>> extractJavaHeaders(Request request) { return JavaNetHeaders.toMultimap(request.headers(), null); } private  JavaApiConverter(); static Response createOkResponseForCachePut(URI uri, URLConnection urlConnection); static Request createOkRequest(
      URI uri, String requestMethod, Map<String, List<String>> requestHeaders); static CacheResponse createJavaCacheResponse(final Response response); static java.net.CacheRequest createJavaCacheRequest(final CacheRequest okCacheRequest);  }
@Test public void extractJavaHeaders() throws Exception { Request okRequest = createArbitraryOkRequest().newBuilder() .addHeader("key1", "value1_1") .addHeader("key2", "value2") .addHeader("key1", "value1_2") .build(); Map<String, List<String>> javaHeaders = JavaApiConverter.extractJavaHeaders(okRequest); assertEquals(Arrays.asList("value1_1", "value1_2"), javaHeaders.get("key1")); assertEquals(Arrays.asList("value2"), javaHeaders.get("key2")); }