### Question:
Utils { public static List<String> collectCommonPathFragments(String path1, String path2) { List<String> fragments1 = splitPath(path1); List<String> fragments2 = splitPath(path2); return collectCommonPathFragments(fragments1, fragments2); }  static Object getSubdocumentValue(Document document, String key); static Object getSubdocumentValueCollectionAware(Document document, String key); static String getDatabaseNameFromFullName(String fullName); static String getCollectionNameFromFullName(String fullName); static boolean isTrue(Object value); static Number normalizeNumber(Number value); static void markOkay(Document result); static String join(List<?> values, String delimiter); static void changeSubdocumentValue(Object document, String key, Object newValue); static void validateFieldNames(Document document); static Object removeSubdocumentValue(Object document, String key); static String describeType(Object value); static String joinTail(List<String> pathFragments); static String firstFragment(String input); static List<String> splitPath(String input); static String getShorterPathIfPrefix(String path1, String path2); static List<String> collectCommonPathFragments(String path1, String path2); static String getHostName(); static void copySubdocumentValue(Document input, Document result, String key); static final String PATH_DELIMITER; }### Answer:
@Test void testCollectCommonPathFragments() throws Exception { assertThat(Utils.collectCommonPathFragments("a", "b")).isEmpty(); assertThat(Utils.collectCommonPathFragments("aaa", "a.aab")).isEmpty(); assertThat(Utils.collectCommonPathFragments("a.a", "a.b")).containsExactly("a"); assertThat(Utils.collectCommonPathFragments("a.a", "a.a.b")).containsExactly("a", "a"); assertThat(Utils.collectCommonPathFragments("foo.bar", "foo.bar.bla")).containsExactly("foo", "bar"); assertThat(Utils.collectCommonPathFragments("a.a", "a.b.c")).containsExactly("a"); assertThat(Utils.collectCommonPathFragments("ab.c", "a.b.c")).isEmpty(); }