Opacity extends AbstractCssProperty<Opacity> { @Override public String toString() { return getCssName() + ": " + getCssValue(); } 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 testToString() { Opacity opacity = new Opacity(); assertEquals(Float.valueOf(1F), opacity.getValue()); assertEquals(CssNameConstants.OPACITY + ": 1.0", opacity.toString()); opacity.setAsInherit(); assertEquals(CssNameConstants.OPACITY + ": " + Opacity.INHERIT, opacity.toString()); assertNull(opacity.getValue()); }