### Question:
FilePickerFragment extends AbstractFilePickerFragment<File> { @NonNull @Override public File getParent(@NonNull final File from) { if (from.getPath().equals(getRoot().getPath())) { return from; } else if (from.getParentFile() != null) { return from.getParentFile(); } else { return from; } } FilePickerFragment(); void showHiddenItems(boolean showHiddenItems); boolean areHiddenItemsShown(); @Override void onRequestPermissionsResult(int requestCode,
                                           @NonNull String[] permissions,
                                           @NonNull int[] grantResults); @Override boolean isDir(@NonNull final File path); @NonNull @Override String getName(@NonNull File path); @NonNull @Override File getParent(@NonNull final File from); @NonNull @Override File getPath(@NonNull final String path); @NonNull @Override String getFullPath(@NonNull final File path); @NonNull @Override File getRoot(); @NonNull @Override Uri toUri(@NonNull final File file); @NonNull @Override Loader<SortedList<File>> getLoader(); @Override void onNewFolder(@NonNull final String name);  }### Answer:
@Test public void testGetParent() throws Exception { assertEquals("/path/to/some", fragment.getParent(somePath).getPath()); assertEquals(fragment.getRoot().getPath(), fragment.getParent(new File("/path")).getPath()); assertEquals(fragment.getRoot().getPath(), fragment.getParent(new File("/")).getPath()); }