Helper extends ErrorAware { public static long folderSize(File directory) { long length = 0; File[] content = directory.listFiles(); if (content != null) { for (File file : content) { if (file.isFile()) length += file.length(); else length += folderSize(file); } } return length; }  static void deleteDir(File file); static long folderSize(File directory); static String getResultString(HttpURLConnection http); static boolean saveUrlToFile(String url, File file); static String doubleTo15DigitString(double d); static AlertDialog.Builder getAlertBuilder(Context context); static boolean setBitmapFromFileOrNull(File file, ImageView imageView); static double metersToDegrees(double distanceInMeters); static int directionFromPositionToPositionAsResourceId(IPosition me, IPosition other); static int directionFromPositionToPositionAsResourceId(
            double fromLongitude, double fromLatitude, double toLongitude, double toLatitude); static double distanceInMetersBetween(double longitude1, double latitude1, double longitude2, double latitude2); static void trustAllConnections(); static int compare(long a , long b); static Map<String, List<String>> splitQuery(String query);  }
@Test public void testFolderSize() throws IOException { File dir = Files.createTempDir(); assertEquals(Helper.folderSize(dir), 0); byte data[] = new byte[100]; FileOutputStream out = new FileOutputStream(dir.toString() + "/test.txt"); out.write(data); out.close(); long size = Helper.folderSize(dir); assertEquals(size, 100); }