Helper extends ErrorAware { public static void deleteDir(File file) { File[] contents = file.listFiles(); if (contents != null) { for (File f : contents) { deleteDir(f); } } file.delete(); }  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 deleteDir() { try{ File temp = File.createTempFile("temporary", ".txt"); assertTrue(temp.exists()); Helper.deleteDir(temp); assertFalse(temp.exists()); }catch(IOException e){ e.printStackTrace(); } }