BindFiltersToIndexedFormParams implements Binder { @Override public <R extends HttpRequest> R bindToRequest(R request, Object input) { checkArgument(checkNotNull(input, "input") instanceof Multimap, "this binder is only valid for Multimap"); @SuppressWarnings("unchecked") Multimap<String, String> filters = (Multimap<String, String>) input; return AWSUtils.indexMultimapToFormValuesWithPrefix(request, "Filter", "Name", "Value", filters); }  @Override R bindToRequest(R request, Object input);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void testMustBeMultimap() { HttpRequest request = HttpRequest.builder().method("POST").endpoint("http: binder.bindToRequest(request, new File("foo")); }
@Test(expectedExceptions = NullPointerException.class) public void testNullIsBad() { HttpRequest request = HttpRequest.builder().method("GET").endpoint("http: binder.bindToRequest(request, null); }