@Override
    public Iterable<K> loadAllKeys() {
        // If loadAllKeys property is disabled, don't load anything
        if (!genericMapStoreProperties.loadAllKeys) {
            return Collections.emptyList();
        }

        awaitSuccessfulInit();

        String sql = queries.loadAllKeys();
        SqlResult keysResult = sqlService.execute(sql);

        // The contract for loadAllKeys says that if iterator implements Closable
        // then it will be closed when the iteration is over
        return () -> new MappingClosingIterator<>(
                keysResult.iterator(),
                (SqlRow row) -> row.getObject(genericMapStoreProperties.idColumn),
                keysResult::close
        );
    }
@Test
    public void givenNoRows_whenLoadAllKeys_thenEmptyIterable() {
        objectProvider.createObject(mapName, false);
        mapLoader = createMapLoader();

        Iterable<Integer> ids = mapLoader.loadAllKeys();
        assertThat(ids).isEmpty();
    }