List<String> pathParams =
((UriBuilderImpl) UriBuilderImpl.fromTemplate(resourceMethod.getPath())).getPathParamNamesInDeclarationOrder();
int i = 0;
for (String pathParam : pathParams) {
pathValue = pathValue.invoke("replaceFirst", "\\{" + pathParam + "\\}",
marshal(params.getPathParameter(pathParam, i++)));
}
methodBlock.append(Stmt.declareVariable("url", StringBuilder.class,
Stmt.newObject(StringBuilder.class).withParameters(pathValue)));