### Question:
PredicateUtils { @VisibleForTesting @SuppressWarnings("deprecation") static boolean isOnlyDictionaryEncodingPages(ColumnChunkMetaData columnMetaData) { EncodingStats stats = columnMetaData.getEncodingStats(); if (stats != null) { return stats.hasDictionaryPages() && !stats.hasNonDictionaryEncodedPages(); } Set<Encoding> encodings = columnMetaData.getEncodings(); if (encodings.contains(PLAIN_DICTIONARY)) { return Sets.difference(encodings, ImmutableSet.of(PLAIN_DICTIONARY, RLE, BIT_PACKED)).isEmpty(); } return false; } private  PredicateUtils(); static boolean isStatisticsOverflow(Type type, ParquetIntegerStatistics parquetIntegerStatistics); static Predicate buildPredicate(
            MessageType requestedSchema,
            TupleDomain<ColumnDescriptor> parquetTupleDomain,
            Map<List<String>, RichColumnDescriptor> descriptorsByPath,
            DateTimeZone timeZone); static boolean predicateMatches(Predicate parquetPredicate, BlockMetaData block, ParquetDataSource dataSource, Map<List<String>, RichColumnDescriptor> descriptorsByPath, TupleDomain<ColumnDescriptor> parquetTupleDomain, boolean failOnCorruptedParquetStatistics);  }### Answer:
@Test @SuppressWarnings("deprecation") public void testDictionaryEncodingV1() { Set<Encoding> required = ImmutableSet.of(BIT_PACKED); Set<Encoding> optional = ImmutableSet.of(BIT_PACKED, RLE); Set<Encoding> repeated = ImmutableSet.of(RLE); Set<Encoding> notDictionary = ImmutableSet.of(PLAIN); Set<Encoding> mixedDictionary = ImmutableSet.of(PLAIN_DICTIONARY, PLAIN); Set<Encoding> dictionary = ImmutableSet.of(PLAIN_DICTIONARY); assertFalse(isOnlyDictionaryEncodingPages(createColumnMetaDataV1(union(required, notDictionary))), "required notDictionary"); assertFalse(isOnlyDictionaryEncodingPages(createColumnMetaDataV1(union(optional, notDictionary))), "optional notDictionary"); assertFalse(isOnlyDictionaryEncodingPages(createColumnMetaDataV1(union(repeated, notDictionary))), "repeated notDictionary"); assertFalse(isOnlyDictionaryEncodingPages(createColumnMetaDataV1(union(required, mixedDictionary))), "required mixedDictionary"); assertFalse(isOnlyDictionaryEncodingPages(createColumnMetaDataV1(union(optional, mixedDictionary))), "optional mixedDictionary"); assertFalse(isOnlyDictionaryEncodingPages(createColumnMetaDataV1(union(repeated, mixedDictionary))), "repeated mixedDictionary"); assertTrue(isOnlyDictionaryEncodingPages(createColumnMetaDataV1(union(required, dictionary))), "required dictionary"); assertTrue(isOnlyDictionaryEncodingPages(createColumnMetaDataV1(union(optional, dictionary))), "optional dictionary"); assertTrue(isOnlyDictionaryEncodingPages(createColumnMetaDataV1(union(repeated, dictionary))), "repeated dictionary"); }
@Test @SuppressWarnings("deprecation") public void testDictionaryEncodingV2() { assertTrue(isOnlyDictionaryEncodingPages(createColumnMetaDataV2(RLE_DICTIONARY))); assertTrue(isOnlyDictionaryEncodingPages(createColumnMetaDataV2(PLAIN_DICTIONARY))); assertFalse(isOnlyDictionaryEncodingPages(createColumnMetaDataV2(PLAIN))); assertFalse(isOnlyDictionaryEncodingPages(createColumnMetaDataV2(RLE_DICTIONARY, PLAIN))); }