public Refs < T > addAll ( Refs < T > add ) { List < Ref < T >> overlap = new ArrayList <> ( ) ; for ( Map . Entry < T , Ref < T > > e : add . references . entrySet ( ) ) { if ( this . references . containsKey ( e . getKey ( ) ) ) overlap . add ( e . getValue ( ) ) ; else this . references . put ( e . getKey ( ) , e . getValue ( ) ) ; } add . references . clear ( ) ; release ( overlap ) ; return this ; }
Merge two sets of references ensuring only one reference is retained between the two sets