private static <T, U extends Collection<? super T>> U cursorToColl(final Cursor cursor, final U result, final Func1<? super Cursor, ? extends T> func) {
        return withAccessLock(() -> {
            try {
                while (cursor.moveToNext()) {
                    result.add(func.call(cursor));
                }
                return result;
            } finally {
                cursor.close();
            }
        });
    }
Number of caches stored for a given type and/or list
main/src/main/java/cgeo/geocaching/storage/DataStore.java