Source:
<code>private static <T> void testType(Type type, List<T> uniqueValues, T inBloomFilter, T notInBloomFilter) throws Exception { <START> ArrayList<T> writeValues = newArrayList(limit(cycle(uniqueValues), 30_000)); <END> try (TempFile tempFile = new TempFile()) { writeOrcColumnHive(tempFile.getFile(), ORC_12, SNAPPY, type, writeValues); try (OrcBatchRecordReader recordReader = createCustomOrcRecordReader(tempFile, OrcPredicate.TRUE, type, MAX_BATCH_SIZE)) { assertEquals(recordReader.nextBatch(), 1024); } TupleDomainOrcPredicate<String> noBloomFilterPredicate = new TupleDomainOrcPredicate<>( fromFixedValues(ImmutableMap.of("test", NullableValue.of(type, notInBloomFilter))), ImmutableList.of(new ColumnReference<>("test", 0, type)), false, Optional.empty()); try (OrcBatchRecordReader recordReader = createCustomOrcRecordReader(tempFile, noBloomFilterPredicate, type, MAX_BATCH_SIZE)) { assertEquals(recordReader.nextBatch(), 1024); } TupleDomainOrcPredicate<String> notMatchBloomFilterPredicate = new TupleDomainOrcPredicate<>( fromFixedValues(ImmutableMap.of("test", NullableValue.of(type, notInBloomFilter))), ImmutableList.of(new ColumnReference<>("test", 0, type)), true, Optional.empty()); try (OrcBatchRecordReader recordReader = createCustomOrcRecordReader(tempFile, notMatchBloomFilterPredicate, type, MAX_BATCH_SIZE)) { assertEquals(recordReader.nextBatch(), -1); } TupleDomainOrcPredicate<String> matchBloomFilterPredicate = new TupleDomainOrcPredicate<>( fromFixedValues(ImmutableMap.of("test", NullableValue.of(type, inBloomFilter))), ImmutableList.of(new ColumnReference<>("test", 0, type)), true, Optional.empty()); try (OrcBatchRecordReader recordReader = createCustomOrcRecordReader(tempFile, matchBloomFilterPredicate, type, MAX_BATCH_SIZE)) { assertEquals(recordReader.nextBatch(), 1024); } } }</code><technical_language>List<T> for variable type</technical_language>

Target:
private static <T> void testType(Type type, List<T> uniqueValues, T inBloomFilter, T notInBloomFilter) throws Exception { List<T> writeValues = newArrayList(limit(cycle(uniqueValues), 30_000)); try (TempFile tempFile = new TempFile()) { writeOrcColumnHive(tempFile.getFile(), ORC_12, SNAPPY, type, writeValues); try (OrcBatchRecordReader recordReader = createCustomOrcRecordReader(tempFile, type, Optional.empty(), true)) { assertEquals(recordReader.nextBatch(), MAX_BATCH_SIZE); } try (OrcBatchRecordReader recordReader = createCustomOrcRecordReader(tempFile, type, Optional.empty(), false)) { assertEquals(recordReader.nextBatch(), MAX_BATCH_SIZE); } try (OrcBatchRecordReader recordReader = createCustomOrcRecordReader(tempFile, type, Optional.of(notInBloomFilter), true)) { assertEquals(recordReader.nextBatch(), -1); } try (OrcBatchRecordReader recordReader = createCustomOrcRecordReader(tempFile, type, Optional.of(notInBloomFilter), false)) { assertEquals(recordReader.nextBatch(), MAX_BATCH_SIZE); } try (OrcBatchRecordReader recordReader = createCustomOrcRecordReader(tempFile, type, Optional.of(inBloomFilter), true)) { assertEquals(recordReader.nextBatch(), MAX_BATCH_SIZE); } try (OrcBatchRecordReader recordReader = createCustomOrcRecordReader(tempFile, type, Optional.of(inBloomFilter), false)) { assertEquals(recordReader.nextBatch(), MAX_BATCH_SIZE); } } }