package pipe.historyActions;

import javax.swing.undo.AbstractUndoableEdit;
import javax.swing.undo.UndoableEdit;
import java.util.Arrays;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;

public class MultipleEdit extends AbstractUndoableEdit {

    private final Collection<UndoableEdit> multipleEdits = new LinkedList<>();


    public MultipleEdit(Collection<UndoableEdit> multipleEdits) {
        this.multipleEdits.addAll(multipleEdits);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof MultipleEdit)) {
            return false;
        }

        MultipleEdit that = (MultipleEdit) o;

        if (!multipleEdits.equals(that.multipleEdits)) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        return multipleEdits.hashCode();
    }

    /** */
    @Override
    public void undo() {
        super.undo();

        for (UndoableEdit edit : multipleEdits) {
            edit.undo();
        }
    }


    /** */
    @Override
    public void redo() {
        super.redo();
        for (UndoableEdit edit : multipleEdits) {
            edit.redo();
        }
    }

}

@@ -111,33 +111,8 @@
 it;%0A
-import java.util.Arrays;%0A
 impo
@@ -136,16 +136,16 @@
 ection;%0A
+
 import j
@@ -168,31 +168,8 @@
 ist;
-%0Aimport java.util.List;
 %0A%0Apu
@@ -420,32 +420,122 @@
 eEdits);%0A    %7D%0A%0A
+    @Override%0A    public int hashCode() %7B%0A        return multipleEdits.hashCode();%0A    %7D%0A%0A
     @Override%0A  
@@ -844,32 +844,32 @@
 lse;%0A        %7D%0A%0A
+
         return t
@@ -884,98 +884,8 @@
  %7D%0A%0A
-    @Override%0A    public int hashCode() %7B%0A        return multipleEdits.hashCode();%0A    %7D%0A%0A
     

Remove unused imports