Flex extends AbstractCssProperty<Flex> implements StateChangeInformer<CssProperty> { public void setAsInherit() { setCssValue(INHERIT); } Flex();  Flex(final String cssValue);  Flex(final Flex flex); @Override String getCssName(); @Override String getCssValue(); @Override String toString(); @Override Flex setCssValue(final String cssValue); static boolean isValid(final String cssValue); void setAsInitial(); void setAsInherit(); void setAsAuto(); FlexBasis getFlexBasis(); FlexShrink getFlexShrink(); FlexGrow getFlexGrow(); Flex setFlexGrow(final FlexGrow flexGrow); Flex setFlexShrink(final FlexShrink flexShrink); Flex setFlexBasis(final FlexBasis flexBasis); @Override void stateChanged(final CssProperty stateChangedObject); static final String INITIAL; static final String INHERIT; static final String AUTO; }
@Test public void testSetAsInherit() { final Flex flex = new Flex("2 5 25px"); final FlexGrow flexGrow = flex.getFlexGrow(); assertNotNull(flexGrow); assertTrue(flexGrow.isAlreadyInUse()); final FlexShrink flexShrink = flex.getFlexShrink(); assertNotNull(flexShrink); assertTrue(flexShrink.isAlreadyInUse()); final FlexBasis flexBasis = flex.getFlexBasis(); assertNotNull(flexBasis); assertTrue(flexBasis.isAlreadyInUse()); flex.setAsInherit(); assertNull(flex.getFlexGrow()); assertNull(flex.getFlexShrink()); assertNull(flex.getFlexBasis()); assertFalse(flexGrow.isAlreadyInUse()); assertFalse(flexShrink.isAlreadyInUse()); assertFalse(flexBasis.isAlreadyInUse()); }