ComplexNumber extends Number { @Override public long longValue() { throw new UnsupportedOperationException("Cannot get the longValue of a ComplexNumber"); } ComplexNumber(final double real);  ComplexNumber(final double real, final double imaginary); double getReal(); double getImaginary(); @Override String toString(); @Override int hashCode(); @Override boolean equals(final Object obj); @Override double doubleValue(); @Override float floatValue(); @Override int intValue(); @Override long longValue(); static final ComplexNumber I; static final ComplexNumber MINUS_I; static final ComplexNumber ZERO; }
@Test(expectedExceptions = UnsupportedOperationException.class) public void testLongValue() { Z1.longValue(); }