public static int getFoundsOffline(final ILogin connector) {
        return withAccessLock(() -> {

            int counter = 0;

            try {
                final String logIds = CollectionStream.of(Arrays.asList(LogType.getFoundLogIds())).toJoinedString(",");

                final Cursor cursor = database.rawQuery("SELECT geocode FROM " + dbTableLogsOffline + " WHERE geocode IN (SELECT geocode FROM " + dbTableCaches + ") AND type in (" + logIds + ")", null);
                final Set<String> geocodes = cursorToColl(cursor, new HashSet<>(), GET_STRING_0);

                for (String geocode : geocodes) {
                    if (ConnectorFactory.getConnector(geocode).getName().equals(connector.getName())) {
                        counter++;
                    }
                }
            } catch (final Exception e) {
                Log.e("DataStore.getFoundsOffline", e);
            }

            return counter;
        });
    }
Number of caches stored for a given type and/or list
main/src/main/java/cgeo/geocaching/storage/DataStore.java