### Question:
ModifyBeanPropertyEdit extends AbstractUndoableEdit { @Override public void undo() throws CannotUndoException { try { super.undo(); setter.invoke(bean, oldValue); } catch (IllegalAccessException ex) { Logger.getLogger(ModifyBeanPropertyEdit.class.getName()).log(Level.SEVERE, null, ex); throw new CannotRedoException(); } catch (IllegalArgumentException ex) { Logger.getLogger(ModifyBeanPropertyEdit.class.getName()).log(Level.SEVERE, null, ex); throw new CannotRedoException(); } catch (InvocationTargetException ex) { Logger.getLogger(ModifyBeanPropertyEdit.class.getName()).log(Level.SEVERE, null, ex); throw new CannotRedoException(); } } ModifyBeanPropertyEdit(Class<T> clazz, Object bean, String propertyName, T oldValue, T newValue); @Override void die(); @Override void redo(); @Override void undo(); static void showNoSetterError(final JComponent parent, final String propertyName, final Object bean);  }### Answer:
@Test public void testUndo() throws NoSuchMethodException { System.out.println("undo"); ABean bean = new ABean("321", 321, true); ModifyBeanPropertyEdit instance = new ModifyBeanPropertyEdit<>(Integer.class, bean, "intProp", 123, 321); assertEquals(321, bean.getIntProp().intValue()); instance.undo(); assertEquals(123, bean.getIntProp().intValue()); instance = new ModifyBeanPropertyEdit<>(String.class, bean, "stringProp", "123", "321"); assertEquals("321", bean.stringProp); instance.undo(); assertEquals("123", bean.stringProp); }