@NonNull
    public static Map<String, Set<Integer>> loadLists(final Collection<String> geocodes) {

        return withAccessLock(() -> {

            final Map<String, Set<Integer>> cacheLists = new HashMap<>();

            final String query = "SELECT list_id, geocode FROM " + dbTableCachesLists +
                    " WHERE " +
                    whereGeocodeIn(geocodes);

            try (Cursor cursor = database.rawQuery(query, null)) {
                while (cursor.moveToNext()) {
                    final Integer listId = cursor.getInt(0);
                    final String geocode = cursor.getString(1);

                    Set<Integer> listIds = cacheLists.get(geocode);
                    if (listIds != null) {
                        listIds.add(listId);
                    } else {
                        listIds = new HashSet<>();
                        listIds.add(listId);
                        cacheLists.put(geocode, listIds);
                    }
                }
            }

            return cacheLists;
        });
    }
creates a Cache from the cursor. Doesn't next.

@return Cache from DB
main/src/main/java/cgeo/geocaching/storage/DataStore.java