Opacity extends AbstractCssProperty<Opacity> { public void setValue(final float value) { if (value > 1 || value < 0) { throw new InvalidValueException( "the value should be in between 0 to 1."); } this.value = value; cssValue = String.valueOf(value); if (getStateChangeInformer() != null) { getStateChangeInformer().stateChanged(this); } } Opacity();  Opacity(final String cssValue);  Opacity(final Opacity opacity);  Opacity(final float value); @Override String getCssName(); @Override String getCssValue(); @Override String toString(); Float getValue(); void setValue(final float value); @Override Opacity setCssValue(final String cssValue); void setAsInitial(); void setAsInherit(); static boolean isValid(final String cssValue); static final String INITIAL; static final String INHERIT; }
@Test public void testSetValue() { Opacity opacity = new Opacity(); opacity.setValue(0.5F); assertEquals(Float.valueOf(0.5F), opacity.getValue()); opacity.setAsInherit(); assertNull(opacity.getValue()); }