### Question:
ValueType extends Number { public static ValueType<?> compose(Number number, MetricType type) { switch (type) { case ABSOLUTE: return new Absolute(UnsignedLong.fromLongBits(number.longValue())); case COUNTER: return new Counter(UnsignedLong.fromLongBits(number.longValue())); case DERIVE: return new Derive(UnsignedLong.fromLongBits(number.longValue())); case GAUGE: return new Gauge(number.doubleValue()); default: throw new IllegalArgumentException(String.format("Unknown metric type: %s", type)); } }  abstract ValueType<T> plus(Number value); abstract ValueType<T> minus(Number value); abstract ValueType<T> delta(Number value); abstract ValueType<T> times(Number value); abstract ValueType<T> divideBy(Number value); boolean isNan(); abstract MetricType getType(); @Override abstract int intValue(); @Override abstract long longValue(); @Override abstract float floatValue(); @Override abstract double doubleValue(); @Override boolean equals(Object o); @Override String toString(); static ValueType<?> compose(Number number, MetricType type); static ValueType<?> compose(ByteBuffer data); static ByteBuffer decompose(ValueType<?> value);  }### Answer:
@Test public void testAbsoluteFromNumber() { assertTrue(ValueType.compose(100, MetricType.ABSOLUTE) instanceof Absolute); }
@Test public void testCounterFromNumber() { assertTrue(ValueType.compose(100, MetricType.COUNTER) instanceof Counter); }
@Test public void testDeriveFromNumber() { assertTrue(ValueType.compose(100, MetricType.DERIVE) instanceof Derive); }
@Test public void testGaugeFromNumber() { assertTrue(ValueType.compose(100, MetricType.GAUGE) instanceof Gauge); }