question: @ Nullable private Collection < GridClientNode > intersection ( @ Nullable Collection < ? extends GridClientNode > first , @ Nullable Collection < ? extends GridClientNode > second ) { if ( first == null && second == null ) return null ; if ( first != null && second != null ) { Collection < GridClientNode > res = new LinkedList < > ( first ) ; res . retainAll ( second ) ; return res ; } else return new ArrayList < > ( first != null ? first : second ) ; }
target:  Calculates intersection of two collections. Returned collection always a new collection.