HslaCssValue extends AbstractBean<HslaCssValue> { public void setL(final float l) { if (l < 0 || l > 100) { throw new InvalidValueException( "l paramater accept values only from 0 to 100."); } this.l = l; hsl = "hsla(" + h + ", " + s + "%, " + l + "%, " + a + ")"; if (getStateChangeInformer() != null) { getStateChangeInformer().stateChanged(this); } } HslaCssValue();  HslaCssValue(final String hslCssValue);  HslaCssValue(final HslaCssValue hslCssValue);  HslaCssValue(final int h, final float s, final float l,
            final float a); void setHsla(final String hsl); int getH(); void setH(final int h); float getS(); void setS(final float s); float getL(); static CssLengthUnit getSUnit(); static CssLengthUnit getLUnit(); void setL(final float l); void setA(final float a); float getA(); @Override String toString(); @Override String getValue(); static boolean isValid(final String hslString);  }
@Test public void testSetL() { HslaCssValue hslaCssValue = new HslaCssValue(120, 10, 100, 0.5F); assertEquals("hsla(120, 10.0%, 100.0%, 0.5)", hslaCssValue.getValue()); assertEquals(100F, hslaCssValue.getL(), 0); hslaCssValue.setL(55); assertEquals(55F, hslaCssValue.getL(), 0); assertEquals(0.5F, hslaCssValue.getA(), 0); }
@Test(expected = InvalidValueException.class) public void testSetLInvalidValue() { HslaCssValue hslaCssValue = new HslaCssValue(); try { hslaCssValue.setL(101); } catch (InvalidValueException e) { hslaCssValue.setL(-1); } }