### Question:
NumberHelper { public static double round(double value, int decimalPlaces) { if (decimalPlaces < 0) { throw new IllegalArgumentException( "decimalPlaces can not be less than 0: " + decimalPlaces); } return java.math.BigDecimal.valueOf(value).setScale(decimalPlaces, java.math.RoundingMode.HALF_UP).doubleValue(); } private  NumberHelper(); static int boundInteger(int toBound, IntRange range); static int boundInteger(int toBound, int minimum, int maximum); static long boundLong(long toBound, LongRange range); static long boundLong(long toBound, long minimum, long maximum); static int parseInt(final String string, final int defaultValue); static int parseInt(final String string); static int parseInt(final String string, final int defaultValue,
      final int minimum, final int maximum); static long parseLong(final String string, final long defaultValue); static long parseLong(final String string); static long parseLong(final String string, final long defaultValue,
      final long minimum, final long maximum); static boolean isNumber(final String string); static int parseIntPermissive(String numStr, int defaultValue); static float parseFloat(String numStr, float defaultValue); static double parseDouble(String numStr, double defaultValue); static double round(double value, int decimalPlaces); static int getPageStartOffset(int page, int pageSize); static int getPageStartOffset(int page, int pageSize, int maximum); static int getPageEndOffset(int page, int pageSize, int maximum); static int getPageCount(int items, int pageSize); static Double getMedian(List<Integer> values); static boolean almostEquals(double a, double b); static boolean almostEquals(double a, double b, double epsilon);  }### Answer:
@Test public void round() { assertEquals(1.0d, NumberHelper.round(1.01d, 1), 0.0d); assertEquals(1.0d, NumberHelper.round(0.99d, 1), 0.0d); assertNotEquals(1.0d, NumberHelper.round(1.51d, 1), 0.0d); assertNotEquals(1.0d, NumberHelper.round(0.49d, 1), 0.0d); assertEquals(1.0f, NumberHelper.round(1.2f, 0), 0.01f); assertEquals(1.2f, NumberHelper.round(1.22f, 1), 0.001f); assertEquals(-1.0f, NumberHelper.round(-1.2f, 0), 0.01f); assertEquals(-1.2f, NumberHelper.round(-1.22f, 1), 0.001f); }