@VisibleForTesting
    boolean isUsefulCheckRequired(int dictionaryMemoryBytes)
    {
        if (dictionaryMemoryBytes < dictionaryUsefulCheckColumnSizeBytes) {
            return false;
        }

        dictionaryUsefulCheckCounter++;
        if (dictionaryUsefulCheckCounter == dictionaryUsefulCheckPerChunkFrequency) {
            dictionaryUsefulCheckCounter = 0;
            return true;
        }

        return false;
    }
@Test
    public void testIsDictionaryUsefulCheckRequired()
    {
        TestDictionaryColumn directColumn = directColumn(1024, 1);
        int dictionaryColumnSizeCheckBytes = megabytes(1);
        int dictionaryUsefulCheckPerChunkFrequency = 3;
        DataSimulator simulator = new DataSimulator(megabytes(100),
                megabytes(200),
                10_000_000,
                megabytes(100),
                0,
                DICTIONARY_ALMOST_FULL_MEMORY_RANGE,
                dictionaryUsefulCheckPerChunkFrequency,
                dictionaryColumnSizeCheckBytes,
                directColumn);

        for (int loop = 0; loop < 3; loop++) {
            assertFalse(simulator.isUsefulCheckRequired(dictionaryColumnSizeCheckBytes + 1));
            assertFalse(simulator.isUsefulCheckRequired(dictionaryColumnSizeCheckBytes));
            // Calling with 1 byte less should not increment the counter
            assertFalse(simulator.isUsefulCheckRequired(dictionaryColumnSizeCheckBytes - 1));

            // 3rd time, it should return true as dictionaryUsefulCheckPerChunkFrequency is set to 3.
            assertTrue(simulator.isUsefulCheckRequired(dictionaryColumnSizeCheckBytes));
        }
    }