### Question:
SizeValue { @Nonnull public static SizeValue sum() { return SUM; } SizeValue(@Nonnull final SizeValueType type);  SizeValue(final int value, @Nonnull final SizeValueType type);  SizeValue(@Nonnull final SizeValueType type, final int calculatedValue);  SizeValue(@Nullable final String valueParam); @Nonnull static SizeValue def(); @Nonnull static SizeValue def(final int pixelValue); @Nonnull static SizeValue px(final int pixelValue); @Nonnull static SizeValue percent(final int percentage); @Nonnull static SizeValue percentHeight(final int percentage); @Nonnull static SizeValue percentWidth(final int percentage); @Nonnull static SizeValue wildcard(); @Nonnull static SizeValue wildcard(final int computedValue); @Nonnull static SizeValue sum(); @Nonnull static SizeValue sum(final int computedValue); @Nonnull static SizeValue max(); @Nonnull static SizeValue max(final int computedValue); boolean isIndependentFromParent(); @Deprecated boolean isPercentOrPixel(); boolean hasValue(); float getValue(final float range); int getValueAsInt(final float range); String getValueAsString(); boolean isPixel(); boolean isPercent(); @Nonnull @Override String toString(); boolean hasDefault(); boolean hasWidthSuffix(); boolean hasHeightSuffix(); boolean hasWildcard(); boolean hasSum(); boolean hasMax(); @Override boolean equals(Object o); @Override int hashCode(); static final float MAX_PERCENT; }### Answer:
@Test public void testSum() { SizeValue value = SizeValue.sum(); assertEquals(-1, value.getValueAsInt(1000.f)); assertEquals(-1, value.getValueAsInt(100.f)); assertEquals(-1.f, value.getValue(1000.f), 1.0e-7); assertEquals(-1.f, value.getValue(100.f), 1.0e-7); assertFalse(value.hasValue()); assertFalse(value.isPercent()); assertFalse(value.isPixel()); assertTrue(value.isIndependentFromParent()); assertFalse(value.hasDefault()); assertFalse(value.hasWildcard()); assertFalse(value.hasMax()); assertTrue(value.hasSum()); assertFalse(value.hasHeightSuffix()); assertFalse(value.hasWidthSuffix()); }
@Test public void testSumEquals() { SizeValue a = SizeValue.sum(); SizeValue b = new SizeValue(SizeValueType.Sum); SizeValue c = new SizeValue("s"); SizeValue d = new SizeValue("sum"); assertEquals(a, b); assertEquals(a, c); assertEquals(a, d); }
@Test public void testSumComputedEquals() { SizeValue a = SizeValue.sum(5); SizeValue b = new SizeValue(SizeValueType.Sum, 5); assertEquals(a, b); }