RgbCssValue extends AbstractBean<RgbCssValue> { public void setB(final int b) { if (b < 0 || b > 255) { throw new InvalidValueException( "b paramater accept values only from 0 to 255."); } this.b = b; rgb = "rgb(" + r + ", " + g + ", " + b + ")"; if (getStateChangeInformer() != null) { getStateChangeInformer().stateChanged(this); } } RgbCssValue();  RgbCssValue(final String rgbCssValue);  RgbCssValue(final RgbCssValue rgbCssValue);  RgbCssValue(final int r, final int g, final int b); void setRgb(final String rgb); int getR(); void setR(final int r); int getG(); void setG(final int g); int getB(); void setB(final int b); @Override String toString(); @Override String getValue(); static boolean isValid(final String rgbString);  }
@Test public void testSetB() { testGetB(); }
@Test(expected = InvalidValueException.class) public void testSetBInvalidValue() { RgbCssValue rgbCssValue = new RgbCssValue(); try { rgbCssValue.setB(256); } catch (InvalidValueException e) { rgbCssValue.setB(-1); } }