AbstractBean { @Override public Object clone() throws CloneNotSupportedException { AbstractBean result = (AbstractBean) super.clone(); result.pcs = new PropertyChangeSupport(result); result.vcs = new VetoableChangeSupport(result); return result; } protected  AbstractBean(); protected  AbstractBean(PropertyChangeSupport pcs, VetoableChangeSupport vcs); final void addPropertyChangeListener(PropertyChangeListener listener); final void removePropertyChangeListener(PropertyChangeListener listener); final PropertyChangeListener[] getPropertyChangeListeners(); final void addPropertyChangeListener(String propertyName, PropertyChangeListener listener); final void removePropertyChangeListener(String propertyName, PropertyChangeListener listener); final PropertyChangeListener[] getPropertyChangeListeners(String propertyName); final void addVetoableChangeListener(VetoableChangeListener listener); final void removeVetoableChangeListener(VetoableChangeListener listener); final VetoableChangeListener[] getVetoableChangeListeners(); final void addVetoableChangeListener(String propertyName,
                VetoableChangeListener listener); final void removeVetoableChangeListener(String propertyName,
                VetoableChangeListener listener); final VetoableChangeListener[] getVetoableChangeListeners(String propertyName); @Override Object clone();  }
@Test public void testClone() { CloneableBean bean = new CloneableBean(); PropertyChangeListener pcl = mock(PropertyChangeListener.class); bean.addPropertyChangeListener(pcl); String property = "dummy"; bean.setProperty(property); ArgumentCaptor<PropertyChangeEvent> captor = ArgumentCaptor.forClass(PropertyChangeEvent.class); verify(pcl).propertyChange(captor.capture()); assertThat(bean, is(captor.getValue().getSource())); assertThat("property", is(captor.getValue().getPropertyName())); CloneableBean clone = bean.clone(); clone.setProperty("other"); assertThat(0, is(clone.getPropertyChangeListeners().length)); verifyNoMoreInteractions(pcl); }