public T subtract ( T subtrahend ) { if ( subtrahend == null ) { throw new IllegalArgumentException ( "invalid (null) subtrahend" ) ; } BigDecimal difference = this . value . subtract ( subtrahend . value ) ; return newInstance ( difference , difference . scale ( ) ) ; }
Wraps BigDecimal s subtract method to accept and return T instances instead of BigDecimals so that users of the class don t have to typecast the return value .