question: private < T > void registerRemoveModification ( PropertyDefinition < T > pd , SortedSet < T > newValues , SortedSet < T > previousValues ) { PropertyEditorModification < ? > mod = getModification ( pd ) ; PropertyEditorModification < T > newMod ; SortedSet < T > originalValues ; if ( mod != null ) { originalValues = new TreeSet < > ( pd ) ; castAndAddValues ( originalValues , mod . getOriginalValues ( ) , pd ) ; if ( newValues . isEmpty ( ) ) { newMod = PropertyEditorModification . createRemoveModification ( pd , originalValues , originalValues ) ; } else if ( mod . getType ( ) == PropertyEditorModification . Type . REMOVE ) { SortedSet < T > removedValues = new TreeSet < > ( originalValues ) ; removedValues . removeAll ( newValues ) ; newMod = PropertyEditorModification . createRemoveModification ( pd , removedValues , originalValues ) ; } else { newMod = PropertyEditorModification . createSetModification ( pd , new TreeSet < T > ( newValues ) , originalValues ) ; } removeModification ( mod ) ; } else { originalValues = new TreeSet < > ( previousValues ) ; SortedSet < T > removedValues = new TreeSet < > ( originalValues ) ; removedValues . removeAll ( newValues ) ; newMod = PropertyEditorModification . createRemoveModification ( pd , removedValues , originalValues ) ; } addModification ( newMod ) ; }
target:  Register a remove modification in the list of modifications.