@Test public void testStripSlash() { Assertions.assertThat(UriBuilder.stripLeadingSlash("/plop/")).isEqualTo("/plop"); Assertions.assertThat(UriBuilder.stripLeadingSlash("/plop")).isEqualTo("/plop"); Assertions.assertThat(UriBuilder.stripLeadingSlash("plop")).isEqualTo("plop"); }
static String stripLeadingSlash(String path) { if (path.endsWith("/")) { return path.substring(0, path.length() - 1); } else { return path; } }
UriBuilder { static String stripLeadingSlash(String path) { if (path.endsWith("/")) { return path.substring(0, path.length() - 1); } else { return path; } } }
UriBuilder { static String stripLeadingSlash(String path) { if (path.endsWith("/")) { return path.substring(0, path.length() - 1); } else { return path; } } private  UriBuilder(); }
UriBuilder { static String stripLeadingSlash(String path) { if (path.endsWith("/")) { return path.substring(0, path.length() - 1); } else { return path; } } private  UriBuilder();  }
UriBuilder { static String stripLeadingSlash(String path) { if (path.endsWith("/")) { return path.substring(0, path.length() - 1); } else { return path; } } private  UriBuilder();   }