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