StringHelper { public static String appendSlant(String url) { if (url == null ) { return null; } url = url.replace("\\", "/"); if (url.endsWith("/")) { return url; } return url + "/"; }  static String appendSlant(String url); static byte[] getBytes(String s); static String getString(byte[] bytes); static String[] mergeArray(String[] a, String[] b); static String[] emptyArray(); static String emptyString(); static boolean isEmpty(String s); static boolean isEmpty(String[] s); static String[] checkEmpty(String[] s); static String isEmpty(String value, String defaultValue); static String[] split(String s); static List<String> splitToList(String s);  }
@Test public void appendSlant() { Assert.assertNull(StringHelper.appendSlant(null)); Assert.assertEquals("api/v1/", StringHelper.appendSlant("api/v1/")); Assert.assertEquals("api/v1/", StringHelper.appendSlant("api/v1")); }