@Override
    public int size() {
        if (cachedSize == SIZE_UNINITIALIZED) {
            int calculatedSize = 0;
            for (Iterator<QueryableEntry> it = iterator(); it.hasNext(); it.next()) {
                calculatedSize++;
            }
            cachedSize = calculatedSize;
        }
        return cachedSize;
    }
@Test
    // https://github.com/hazelcast/hazelcast/issues/9614
    public void size_matchingPredicate_noOtherResult() {
        Set<QueryableEntry> entries = generateEntries(100000);
        List<Set<QueryableEntry>> otherIndexedResults = new ArrayList<>();
        AndResultSet resultSet = new AndResultSet(entries, otherIndexedResults, asList(Predicates.alwaysTrue()));

        int size = resultSet.size();
        int countedSize = 0;
        for (QueryableEntry queryableEntry : resultSet) {
            countedSize++;
        }

        assertEquals(100000, countedSize);
        assertEquals(size, countedSize);
    }