CreateServerOptions implements MapBinder { public CreateServerOptions withSharedIpGroup(int id) { checkArgument(id > 0, "id must be positive or zero. was: " + id); this.sharedIpGroupId = id; return this; }  @Override R bindToRequest(R request, Map<String, Object> postParams); CreateServerOptions withFile(String path, byte[] contents); CreateServerOptions withSharedIpGroup(int id); CreateServerOptions withMetadata(Map<String, String> metadata); CreateServerOptions withSharedIp(String publicIp); @Override R bindToRequest(R request, Object input);  }
@Test public void testWithSharedIpGroup() { CreateServerOptions options = new CreateServerOptions(); options.withSharedIpGroup(3); HttpRequest request = buildRequest(options); assertSharedIpGroup(request); }
@Test public void testWithSharedIpGroupStatic() { CreateServerOptions options = withSharedIpGroup(3); HttpRequest request = buildRequest(options); assertSharedIpGroup(request); }