Angle implements AttributeValue { @Override public String getValue() { String ret = ""; switch (this.unit) { case DEG: ret = String.valueOf((int) this.value); break; case GRAD: ret = this.value + "grad"; break; case RAD: ret = this.value + "rad"; break; } return ret; } Angle(final double value, final Unit unit); static Angle deg(final double degs); static Angle grad(final double grads); static Angle rad(final double rads); @Override String toString(); @Override String getValue(); static final Angle NO_ROTATING; static final Angle ROTATE_90; static final Angle ROTATE_180; static final Angle ROTATE_270; }
@Test(expected = NullPointerException.class) public void testOther() { final Angle r = new Angle(12, null); r.getValue(); }