Change { public boolean isRedundant() { if (isListChange()) { return Objects.equals(oldList.get(),newList.get()); } return oldValue.get().equals(newValue.get()); } protected  Change(Setting setting, boolean listChange);  Change(Setting setting, ObservableList<P> oldList, ObservableList<P> newList);  Change(Setting setting, P oldValue, P newValue); boolean isRedundant(); void undo(); void redo(); ObservableList<P> getOldList(); ObservableList<P> getNewList(); void setNewList(ObservableList<P> newList); boolean isListChange(); ReadOnlyBooleanProperty listChangeProperty(); P getOldValue(); P getNewValue(); void setNewValue(P newValue); Setting getSetting(); String getTimestamp(); ReadOnlyObjectProperty<P> oldValueProperty(); ReadOnlyObjectProperty<P> newValueProperty(); ReadOnlyListProperty<P> oldListProperty(); ReadOnlyListProperty<P> newListProperty();  }
@Test public void isRedundantTwoEmptyLists() { c = new Change(mockSetting, list1, list2); assertTrue(c.isRedundant()); list1.add(s1); assertTrue(c.isRedundant()); }
@Test public void isRedundantOneEmptyList() { list1.add(s1); c = new Change(mockSetting, list1, list2); assertFalse(c.isRedundant()); list1.remove(s1); list2.add(s1); c = new Change(mockSetting, list1, list2); assertFalse(c.isRedundant()); }
@Test public void isRedundantSameObjects() { list1.addAll(s1, s2, s3); list2.addAll(s1, s2, s3); c = new Change(mockSetting, list1, list2); assertTrue(c.isRedundant()); }
@Test public void isRedundantSameObjectsDifferentOrder() { list1.addAll(s1, s2, s3); list2.addAll(s1, s3, s2); c = new Change(mockSetting, list1, list2); assertFalse(c.isRedundant()); }
@Test public void isRedundantDifferentObjects() { list1.addAll(s1, s2); list2.addAll(s3, s4); c = new Change(mockSetting, list1, list2); assertFalse(c.isRedundant()); }
@Test public void isRedundantSameObjectsDifferentCardinalities() { list1.addAll(s1, s2, s2); list2.addAll(s1, s1, s2); c = new Change(mockSetting, list1, list2); assertFalse(c.isRedundant()); }