### Question:
Utils { @NonNull public static String appendPath(@NonNull String first, @NonNull String second) { String result = first + SEP + second; while (result.contains(" result = result.replaceAll(" } if (result.length() > 1 && result.endsWith(SEP)) { return result.substring(0, result.length() - 1); } else { return result; } }  static boolean isValidFileName(@Nullable String name); @NonNull static String appendPath(@NonNull String first,
                                    @NonNull String second); @NonNull static File getFileForUri(@NonNull Uri uri); @NonNull static List<Uri> getSelectedFilesFromResult(@NonNull Intent data);  }### Answer:
@Test public void appendSlashesSlashesSlashes() throws Exception { assertEquals("A/B", Utils.appendPath("A assertEquals("/", Utils.appendPath(" }
@Test public void appendPathSimple() throws Exception { assertEquals("A/B", Utils.appendPath("A", "B")); assertEquals("A/B", Utils.appendPath("A", "B/")); assertEquals("/A/B", Utils.appendPath("/A", "B")); assertEquals("/A/B/C/D", Utils.appendPath("/A/B", "C/D")); assertEquals("A/B/C/D", Utils.appendPath("A/B", "C/D/")); }
@Test public void appendPathDot() throws Exception { assertEquals("A/./B", Utils.appendPath("A", "./B")); assertEquals("A/./B", Utils.appendPath("A", "./B/")); assertEquals("/A/./B", Utils.appendPath("/A", "./B")); assertEquals("/A/B/./C/D", Utils.appendPath("/A/B", "./C/D")); assertEquals("A/B/./C/D", Utils.appendPath("A/B", "./C/D/")); }
@Test public void appendPathDotDot() throws Exception { assertEquals("A/../B", Utils.appendPath("A", "../B")); assertEquals("A/../B", Utils.appendPath("A", "../B/")); assertEquals("/A/../B", Utils.appendPath("/A", "../B")); assertEquals("/A/B/../C/D", Utils.appendPath("/A/B", "../C/D")); assertEquals("A/B/C/../D", Utils.appendPath("A/B", "C/../D/")); }
@Test public void appendPathRoot() throws Exception { assertEquals("A/B", Utils.appendPath("A", "/B")); assertEquals("/A/B", Utils.appendPath("/A", "/B")); assertEquals("/A/B/C/D", Utils.appendPath("/A/B", "/C/D")); assertEquals("/A/B/C/D", Utils.appendPath("/A/B", "/C/D/")); }