public static < K > NumberMap < K , BigInteger > newBigIntegerMap ( ) { return new NumberMap < K , BigInteger > ( ) { @ Override public void add ( K key , BigInteger addend ) { put ( key , containsKey ( key ) ? get ( key ) . add ( addend ) : addend ) ; } @ Override public void sub ( K key , BigInteger subtrahend ) { put ( key , ( containsKey ( key ) ? get ( key ) : BigInteger . ZERO ) . subtract ( subtrahend ) ) ; } } ; }
Creates a NumberMap for BigIntegers .