public static Object add ( Object list , Object item ) { if ( list == null ) { if ( item instanceof List || item == null ) { List l = new ArrayList ( ) ; l . add ( item ) ; return l ; } return item ; } if ( list instanceof List ) { ( ( List ) list ) . add ( item ) ; return list ; } List l = new ArrayList ( ) ; l . add ( list ) ; l . add ( item ) ; return l ; }
Add an item to a LazyList