public static < S , R > List < R > convert ( List < S > source , Function < S , R > converter ) { return ( source == null ) ? null : source . stream ( ) . filter ( Objects :: nonNull ) . map ( converter ) . filter ( Objects :: nonNull ) . collect ( Collectors . toList ( ) ) ; }
Convert a list of a given type using converter .