@Override
    public boolean hasNext() {
        while (innerIter == null || !innerIter.hasNext()) {
            if (!outerIter.hasNext()) {
                return false;
            }

            StateDescriptor<?, ?> descriptor = outerIter.next();
            Stream<K> stream = backend.getKeys(descriptor.getName(), VoidNamespace.INSTANCE);
            innerIter = stream.iterator();
            try {
                registry.registerCloseable(stream::close);
            } catch (IOException e) {
                throw new RuntimeException("Failed to read keys from configured StateBackend", e);
            }
        }
        return true;
    }
@Test
    public void testIteratorPullsSingleKeyFromAllDescriptors() throws AssertionError {
        CountingKeysKeyedStateBackend keyedStateBackend =
                createCountingKeysKeyedStateBackend(100_000_000);
        MultiStateKeyIterator<Integer> testedIterator =
                new MultiStateKeyIterator<>(descriptors, keyedStateBackend);

        testedIterator.hasNext();

        Assert.assertEquals(
                "Unexpected number of keys enumerated",
                1,
                keyedStateBackend.numberOfKeysEnumerated);
    }