public static < E > List < E > clean ( List < E > list ) { if ( iterable ( list ) ) { return list . stream ( ) . filter ( e -> { if ( Objects . isNull ( e ) ) { return false ; } if ( e instanceof Nullable ) { return ! ( ( Nullable ) e ) . isNull ( ) ; } return true ; } ) . collect ( Collectors . toList ( ) ) ; } return list ; }
clean null element