### Question:
RecordHandler { public boolean test(final @NonNull Record record) { final RecordConfig config = getRecordConfig(record); return config.getAllowedTypes().contains(record.getRecordType()); } RecordHandler(final @NonNull RecordsConfig configuration); @NonNull ProducerRecord<RecordId, Record> transform(final @NonNull Record record); boolean test(final @NonNull Record record);  }### Answer:
@Test public void shouldTestRecordAsNotAllowed() { final Record<DeploymentRecordValue> record = buildDeploymentRecord().recordType(RecordType.COMMAND).build(); final RecordHandler recordHandler = new RecordHandler(newRecordsConfig(RecordType.EVENT)); assertThat(recordHandler.test(record)).isFalse(); }
@Test public void shouldTestRecordAsAllowed() { final Record<DeploymentRecordValue> record = buildDeploymentRecord().recordType(RecordType.EVENT).build(); final RecordHandler recordHandler = new RecordHandler(newRecordsConfig(RecordType.EVENT)); assertThat(recordHandler.test(record)).isTrue(); }