### Question:
Utils { @TargetApi(Build.VERSION_CODES.N) public static File getVolumeDirectory(StorageVolume volume) { try { Field f = StorageVolume.class.getDeclaredField("mPath"); f.setAccessible(true); return (File) f.get(volume); } catch (Exception e) { throw new RuntimeException(e); } }  static float clamp(float min, float max, float value); static float getViewRawY(View view); static void setTint(Context context, CheckBox box, int color); static String getDate(@NonNull Context c, long f); @SuppressWarnings("deprecation") static int getColor(Context c, @ColorRes int color); static int dpToPx(Context c, int dp); static String differenceStrings(String str1, String str2); static void disableScreenRotation(@NonNull Activity activity); static void enableScreenRotation(@NonNull Activity activity); static boolean isDeviceInLandScape(Activity activity); static String sanitizeInput(String input); static Uri getUriForBaseFile(
      @NonNull Context context, @NonNull HybridFileParcelable baseFile); static int nthToLastCharIndex(int elementNumber, String str, char element); static String formatTimer(long timerInSeconds); @TargetApi(Build.VERSION_CODES.N) static File getVolumeDirectory(StorageVolume volume); static boolean isNullOrEmpty(final Collection<?> list); static boolean isNullOrEmpty(final String string); static void invalidateFab(
      MainActivity mainActivity, @Nullable Runnable callback, boolean open); static Snackbar showThemedSnackbar(
      MainActivity mainActivity,
      CharSequence text,
      int length,
      @StringRes int actionTextId,
      Runnable actionCallback);  }### Answer:
@Test @Config(minSdk = N) public void testGetVolumeDirectory() throws Exception { StorageVolume mock = mock(StorageVolume.class); Field f = StorageVolume.class.getDeclaredField("mPath"); f.setAccessible(true); f.set(mock, new File("/storage/emulated/0")); File result = Utils.getVolumeDirectory(mock); assertNotNull(result); assertEquals(new File("/storage/emulated/0"), result); }