aws-events-connection/src/main/java/software/amazon/events/connection/ListConverter.java
public static <I, O> List<O> toModel(List<I> list, Function<I, O> func) {
        if (list == null || list.isEmpty()) {
            return null;
        }
        return list.stream().map(x -> func.apply(x)).collect(Collectors.toList());
    }
// for knowing if we should return null.
for knowing if we should return null.
for knowing if we should return null .
public static <I, O> List<O> toModel(List<I> list, Function<I, O> func) {
        if (list == null || list.isEmpty()) {
            return null;
        }
        return list.stream().map(x -> func.apply(x)).collect(Collectors.toList());
    }
public static < I , O > List < O > toModel ( List < I > list , Function < I , O > func ) { if ( list == null || list . isEmpty ( ) ) { return null ; } return list . stream ( ) . map ( x -> func . apply ( x ) ) . collect ( Collectors . toList ( ) ) ; }
for knowing if we should return null.
for knowing if we should return null .