RebuildServerOptions implements MapBinder { public RebuildServerOptions withImage(int id) { checkArgument(id > 0, "server id must be a positive number"); this.imageId = id; return this; }  @Override R bindToRequest(R request, Map<String, Object> postParams); @Override R bindToRequest(R request, Object toBind); RebuildServerOptions withImage(int id);  }
@Test public void testWithServer() { RebuildServerOptions options = new RebuildServerOptions(); options.withImage(3); HttpRequest request = buildRequest(options); assertRebuild(request); }
@Test public void testWithServerStatic() { RebuildServerOptions options = withImage(3); HttpRequest request = buildRequest(options); assertRebuild(request); }