public static Set < ModificationFeature > [ ] getChangedModifications ( PhysicalEntity before , PhysicalEntity after ) { Set < Modification > set1 = collectFeatures ( before ) ; Set < Modification > set2 = collectFeatures ( after ) ; Set < Modification > temp = new HashSet < Modification > ( set1 ) ; set1 . removeAll ( set2 ) ; set2 . removeAll ( temp ) ; // Remove common features that can be deemed semantically equivalent Set < Modification > furtherRemove = new HashSet < Modification > ( ) ; for ( Modification m1 : set1 ) { for ( Modification m2 : set2 ) { if ( furtherRemove . contains ( m2 ) ) continue ; if ( m1 . getKey ( ) . equals ( m2 . getKey ( ) ) ) { furtherRemove . add ( m1 ) ; furtherRemove . add ( m2 ) ; break ; } } } set1 . removeAll ( furtherRemove ) ; set2 . removeAll ( furtherRemove ) ; return new Set [ ] { collectFeatures ( set2 ) , collectFeatures ( set1 ) } ; }
Gets the differential features .