@Test public void testDynamodbEventToRecordsV2_FiltersNullRecords() { DynamodbEvent event = dynamodbEvent.clone(); event.setRecords(Arrays.asList(record_event, null)); Assertions.assertEquals(2, event.getRecords().size()); List<Record> convertedRecords = DynamodbEventTransformer.toRecordsV2(event); Assertions.assertEquals(expectedRecordsV2, convertedRecords); Assertions.assertEquals(1, convertedRecords.size()); }
public static List<Record> toRecordsV2(final DynamodbEvent dynamodbEvent) { return dynamodbEvent .getRecords() .stream() .filter(record -> !Objects.isNull(record)) .map(DynamodbRecordTransformer::toRecordV2) .collect(Collectors.toList()); }
DynamodbEventTransformer { public static List<Record> toRecordsV2(final DynamodbEvent dynamodbEvent) { return dynamodbEvent .getRecords() .stream() .filter(record -> !Objects.isNull(record)) .map(DynamodbRecordTransformer::toRecordV2) .collect(Collectors.toList()); } }
DynamodbEventTransformer { public static List<Record> toRecordsV2(final DynamodbEvent dynamodbEvent) { return dynamodbEvent .getRecords() .stream() .filter(record -> !Objects.isNull(record)) .map(DynamodbRecordTransformer::toRecordV2) .collect(Collectors.toList()); }  }
DynamodbEventTransformer { public static List<Record> toRecordsV2(final DynamodbEvent dynamodbEvent) { return dynamodbEvent .getRecords() .stream() .filter(record -> !Objects.isNull(record)) .map(DynamodbRecordTransformer::toRecordV2) .collect(Collectors.toList()); }  static List<Record> toRecordsV2(final DynamodbEvent dynamodbEvent); }
DynamodbEventTransformer { public static List<Record> toRecordsV2(final DynamodbEvent dynamodbEvent) { return dynamodbEvent .getRecords() .stream() .filter(record -> !Objects.isNull(record)) .map(DynamodbRecordTransformer::toRecordV2) .collect(Collectors.toList()); }  static List<Record> toRecordsV2(final DynamodbEvent dynamodbEvent);  }