PropertyConfigurationImpl implements PropertyConfiguration<C, P> { @Override public PropertyConfiguration<C, P> readOnly() { data = data.updateReadOnly(true); return this; } PropertyConfigurationImpl(Class<C> componentType, String propertyName,
                                     Class<P> propertyType, P defaultValue); @Override @SuppressWarnings("unchecked") PropertyConfiguration<C, P> onChange(SerializableBiConsumer<C, P> onChangeHandler); @Override PropertyConfiguration<C, P> readOnly(); @Override boolean equals(Object obj); @Override int hashCode(); SerializableBiConsumer<C, Serializable> getOnChangeHandler(); PropertyData<P> getPropertyData();  }
@Test public void readOnly() { intPropertyConf.readOnly(); PropertyData<Integer> data = intPropertyConf.getPropertyData(); Assert.assertEquals("default value is 1", 1, (int)data.getDefaultValue()); Assert.assertTrue("read-only flag should have been set to true", data.isReadOnly()); }