BindUserGroupsToIndexedFormParams implements Binder { @Override public <R extends HttpRequest> R bindToRequest(R request, Object input) { checkArgument(checkNotNull(input, "input") instanceof Iterable<?>, "this binder is only valid for Iterable<?>: " + input.getClass()); checkValidUserGroup(input); return AWSUtils.indexIterableToFormValuesWithPrefix(request, "UserGroup", input); }  @Override R bindToRequest(R request, Object input);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void testOnlyAllIsValid() { HttpRequest request = HttpRequest.builder().method("POST").endpoint("http: binder.bindToRequest(request, ImmutableSet.of("alpha")); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testMustBeIterable() { 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); }