NumberUtils { public static Double divide(Double dividend, Integer divisor) { return divide(dividend, Double.valueOf(divisor + "")); }  static Double neg(Double value); static Double getStringToDoubleNonRounded(Locale locale,
                                                     String stringToBeParsed); static Double getStringToDoubleRounded(Locale locale,
            String stringToBeParsed); static Double divide(Double dividend, Integer divisor); static DivisionResult divideWithLoss(Double dividend,
            Integer divisor, boolean resultToBeNegative); static Double multiply(Double factorA, Integer factorB); static Double multiply(Double factorA, Double factorB); static Double divide(Double dividend, Double divisor); static Double divideForExchangeRates(Double dividend, Double divisor); static Double ensureExchangeRateMinMax(Double double1); static Double ensureAmountMinMax(Double double1); static boolean isExceedingAmountLimit(Double double1); static Double invertExchangeRateDouble(Double exchangeRate); static Double divide(Double dividend, Double divisor, int scale); static double round(double nonRounded);  }
@Test public void testDivisionJunkFuck() { Assert.assertEquals(Double.valueOf(16.67d), NumberUtils.divide(50d, 3)); Assert.assertEquals(Double.valueOf(16.67d), NumberUtils.divide(50.00d, 3)); }
@Test public void testRoundingDivisionDouble() { Assert.assertEquals(Double.valueOf(13.33d), NumberUtils.divide(40d, 3d)); Assert.assertEquals(Double.valueOf(33.33d), NumberUtils.divide(100d, 3d)); Assert.assertEquals(Double.valueOf(13.33d), NumberUtils.divide(40.00d, 3d)); Assert.assertEquals(Double.valueOf(13.35d), NumberUtils.divide(40.05d, 3d)); Assert.assertEquals(Double.valueOf(13.35d), NumberUtils.divide(40.06d, 3d)); }