@Test public void testCapFileCount_returnsNumberOfRetainedFilesIfMoreThanMax() throws Exception { folder.newFile(); folder.newFile(); folder.newFile(); folder.newFile(); final int numRetained = Utils.capFileCount(folder.getRoot(), ALL_FILES, 3, SMALLEST_FILENAME_FIRST); assertEquals(3, numRetained); }
static int capFileCount(File directory, int maxAllowed, Comparator<File> sortComparator) { return capFileCount(directory, ALL_FILES_FILTER, maxAllowed, sortComparator); }
Utils { static int capFileCount(File directory, int maxAllowed, Comparator<File> sortComparator) { return capFileCount(directory, ALL_FILES_FILTER, maxAllowed, sortComparator); } }
Utils { static int capFileCount(File directory, int maxAllowed, Comparator<File> sortComparator) { return capFileCount(directory, ALL_FILES_FILTER, maxAllowed, sortComparator); } private  Utils(); }
Utils { static int capFileCount(File directory, int maxAllowed, Comparator<File> sortComparator) { return capFileCount(directory, ALL_FILES_FILTER, maxAllowed, sortComparator); } private  Utils(); static Task<T> race(Task<T> t1, Task<T> t2); static Task<T> callTask(Executor executor, Callable<Task<T>> callable); static T awaitEvenIfOnMainThread(Task<T> task); }
Utils { static int capFileCount(File directory, int maxAllowed, Comparator<File> sortComparator) { return capFileCount(directory, ALL_FILES_FILTER, maxAllowed, sortComparator); } private  Utils(); static Task<T> race(Task<T> t1, Task<T> t2); static Task<T> callTask(Executor executor, Callable<Task<T>> callable); static T awaitEvenIfOnMainThread(Task<T> task);  }