### Question:
ModifyBeanPropertyEdit extends AbstractUndoableEdit { @Override public void redo() throws CannotRedoException { try { super.redo(); setter.invoke(bean, newValue); } 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 testRedo() throws NoSuchMethodException { System.out.println("redo"); ABean bean = new ABean("123", 123, false); ModifyBeanPropertyEdit instance = new ModifyBeanPropertyEdit<>(Integer.class, bean, "intProp", 123, 321); instance.undo(); assertEquals(123, bean.getIntProp().intValue()); instance.redo(); assertEquals(321, bean.getIntProp().intValue()); instance = new ModifyBeanPropertyEdit<>(String.class, bean, "stringProp", "123", "321"); instance.undo(); assertEquals("123", bean.stringProp); instance.redo(); assertEquals("321", bean.stringProp); instance = new ModifyBeanPropertyEdit<>(Boolean.class, bean, "boolProp", false, null); instance.undo(); assertEquals(false, bean.getBoolProp()); instance.redo(); assertNull(bean.getBoolProp()); try { instance = new ModifyBeanPropertyEdit<>(Double.class, bean, "cost", 12.3, 32.2); fail("Edit found non-existant methods"); } catch (NoSuchMethodException ex) { System.out.println("Non-existant property 'cost' lead to error. Fine!"); } try { instance = new ModifyBeanPropertyEdit<>(String.class, bean, "boolProp", "false", "true"); fail("Edit allowed creation with values incompatible to property type."); } catch (NoSuchMethodException ex) { System.out.println("Assignment of String to boolProp lead to exception. Fine!"); } }