HttpUtil { public static Multimap<String, String> toMultimap(String... params) { checkArgument(params.length % 2 == 0); ImmutableMultimap.Builder<String, String> mmap = ImmutableMultimap.builder(); for (int i = 0; i < params.length; i += 2) { mmap.put(params[i], params[i + 1]); } return mmap.build(); } private  HttpUtil(); static URI buildUri(String uri); static Instant parseHttpDate(String dateText); static String formatHttpDate(Instant instant); static String concatPaths(String... paths); static Multimap<String, String> toMultimap(String... params); static HttpRequest built(HttpRequestOrBuilder rob); static HttpRequest.Builder builder(HttpRequestOrBuilder rob); static HttpResponse built(HttpResponseOrBuilder rob); static HttpResponse.Builder builder(HttpResponseOrBuilder rob); static Cookie built(CookieOrBuilder cookieOrBuilder); static Cookie.Builder builder(CookieOrBuilder cob); static String readContentString(HttpMessage msg); static final DateTimeFormatter HTTP_DATE_FORMAT; }
@Test public void testToMultimap() { assertEquals( ImmutableMultimap.of("a", "x", "a", "y"), HttpUtil.toMultimap("a", "x", "a", "y")); }