ApiHelper { public static String getUrlWithHttpMethod(String url, String httpMethod) { if (httpMethod == null) { return url; } return String.format("%s/%s", httpMethod, url ).replaceAll("[/]{2,}", "/"); }  static String getUrlWithHttpMethod(String url, String httpMethod); static String getFormattedUrl(String url); static JavaType constructJavaType(ParamPOJO param);  }
@Test public void testGetUrlWithHttpMethod() throws Exception { String url = "/india String method = "GET"; String result = ApiHelper.getUrlWithHttpMethod(url, method); assertEquals("GET/india/state/", result); }