Top extends AbstractCssProperty<Top> { public void setPercent(final float percent) { value = percent; cssLengthUnit = CssLengthUnit.PER; cssValue = String.valueOf(percent) + cssLengthUnit; if (getStateChangeInformer() != null) { getStateChangeInformer().stateChanged(this); } } Top();  Top(final String cssValue);  Top(final Top top);  Top(final float percent);  Top(final float value, final CssLengthUnit cssLengthUnit); Top setValue(final float value, final CssLengthUnit cssLengthUnit); void setPercent(final float percent); @Override String getCssName(); @Override String getCssValue(); @Override String toString(); Float getValue(); CssLengthUnit getUnit(); @Override Top setCssValue(final String cssValue); void setAsInitial(); void setAsInherit(); void setAsAuto(); static boolean isValid(final String cssValue); static final String AUTO; static final String INITIAL; static final String INHERIT; }
@Test public void testSetPercent() { { Top top = new Top(); top.setPercent(75); assertEquals("75.0%", top.getCssValue()); assertEquals(CssLengthUnit.PER, top.getUnit()); assertTrue(top.getValue() == 75); } }