PathUtils { public static String getSubPath(String basePath, String path) { if (!path.contains(basePath)) { return path; } return path.substring(path.lastIndexOf(basePath) + basePath.length()); }  static String removePrependedSlash(String path); static String join(String path1, String path2); static String trimPathSeparatorBothSides(String path); static String removeDuplicatedPrependedSlash(String path); static String getSubPath(String basePath, String path);  }
@Test public void testGetSubPath() { String basePath = "/Users/user/dev/intellij-workspace/ngrinder-develop/"; String path = "/Users/user/dev/intellij-workspace/ngrinder-develop/resources/resources.txt"; assertThat(getSubPath(basePath, path)).isEqualTo("resources/resources.txt"); }