AdbPathUtil { @NotNull public static String getEscapedPath(@NotNull String path) { if (FILE_SEPARATOR.equals(path)) { return path; } return getSegments(path) .stream() .map(x -> FILE_SEPARATOR + FileListingService.FileEntry.escape(x)) .collect(Collectors.joining()); }  @NotNull static String getFileName(@NotNull String path); @NotNull static String getParentPath(@NotNull String path); @NotNull static String resolve(@NotNull String basePath, @NotNull String other); @NotNull static String getEscapedPath(@NotNull String path); @NotNull static List<String> getSegments(@NotNull String path); @NotNull
  static final String FILE_SEPARATOR; @NotNull
  static final String DEVICE_TEMP_DIRECTORY; }
@Test public void testGetEscapedPath() { assertThat(AdbPathUtil.getEscapedPath("")).isEqualTo(""); assertThat(AdbPathUtil.getEscapedPath("/")).isEqualTo("/"); assertThat(AdbPathUtil.getEscapedPath("/foo\\")).isEqualTo("/foo\\\\"); assertThat(AdbPathUtil.getEscapedPath("/foo/&")).isEqualTo("/foo/\\&"); assertThat(AdbPathUtil.getEscapedPath("/foo/blah/bar-#test.txt")).isEqualTo("/foo/blah/bar-\\#test.txt"); }