### Question:
Property extends ReadOnlyProperty<T> { public void set(T aValue) { if (aValue == value) { return; } if (value != null && value.equals(aValue)) { return; } if (aValue != null && aValue.equals(value)) { return; } if (value == null && aValue == null) { return; } T theOldValue = value; value = aValue; lastChanged = System.currentTimeMillis(); if (changeListener.length > 0) { PropertyChanged theEvent = new PropertyChanged(this, theOldValue); for (GameEventListener<PropertyChanged> theListener : changeListener) { theListener.handleGameEvent(theEvent); } } } Property(Class<T> aType, Object aOwner, String aName, T aDefaultValue, GameEventListener<PropertyChanged> aListener);  Property(Class<T> aType, Object aOwner, String aName, GameEventListener<PropertyChanged> aListener);  Property(Class<T> aType, Object aOwner, String aName, T aDefaultValue); void set(T aValue); void setQuietly(T aValue); long getLastChanged(); List<GameEventListener<PropertyChanged>> getChangeListener(); void addChangeListener(GameEventListener<PropertyChanged> aListener); void removeChangeListener(GameEventListener<PropertyChanged> aListener);  }### Answer:
@Test public void testSetWithChange() throws Exception { GameEventListener theListener = mock(GameEventListener.class); Property<String> theProperty = new Property<String>(String.class, this, "property", "value", theListener); assertEquals("value", theProperty.get()); theProperty.set("value1"); assertEquals("value1", theProperty.get()); verify(theListener).handleGameEvent(any(PropertyChanged.class)); }
@Test public void testSetWithoutChange() throws Exception { GameEventListener theListener = mock(GameEventListener.class); Property<String> theProperty = new Property<String>(String.class, this, "property", "value", theListener); assertEquals("value", theProperty.get()); theProperty.set("value"); assertEquals("value", theProperty.get()); verifyZeroInteractions(theListener); }