### Question:
CheckTransforms extends PTransform<PCollection<T>, PCollection<T>> { public static boolean checkRecordType(Set<String> types, InterpretationType... type) { boolean matchType = Arrays.stream(type).anyMatch(x -> types.contains(x.name())); boolean all = Arrays.stream(type).anyMatch(x -> types.contains(x.all())); return all || matchType; }  @Override PCollection<T> expand(PCollection<T> input); static boolean checkRecordType(Set<String> types, InterpretationType... type);  }### Answer:
@Test public void checkRecordTypeAllValueTest() { Set<String> set = Collections.singleton(RecordType.ALL.name()); boolean result = CheckTransforms.checkRecordType(set, RecordType.BASIC, RecordType.AUDUBON); Assert.assertTrue(result); }
@Test public void checkRecordTypeMatchValueTest() { Set<String> set = Collections.singleton(RecordType.BASIC.name()); boolean result = CheckTransforms.checkRecordType(set, RecordType.BASIC, RecordType.AUDUBON); Assert.assertTrue(result); }
@Test public void checkRecordTypeMatchManyValueTest() { Set<String> set = new HashSet<>(); set.add(RecordType.BASIC.name()); set.add(RecordType.AUDUBON.name()); boolean result = CheckTransforms.checkRecordType(set, RecordType.BASIC, RecordType.AUDUBON); Assert.assertTrue(result); }
@Test public void checkRecordTypeMismatchOneValueTest() { Set<String> set = Collections.singleton(RecordType.AMPLIFICATION.name()); boolean result = CheckTransforms.checkRecordType(set, RecordType.BASIC, RecordType.AUDUBON); Assert.assertFalse(result); }
@Test public void checkRecordTypeMismatchManyValueTest() { Set<String> set = new HashSet<>(); set.add(RecordType.AMPLIFICATION.name()); set.add(RecordType.IMAGE.name()); boolean result = CheckTransforms.checkRecordType(set, RecordType.BASIC, RecordType.AUDUBON); Assert.assertFalse(result); }