### Question:
DoubleOperations implements MathOperations<Double>, Comparator<Double> { public Double keepSignificantFigures( Double value, int numSigFigs ) { if (numSigFigs < 0) return value; if (numSigFigs == 0) return 0.0d; int currentExp = getExponentInScientificNotation(value); int decimalShift = -currentExp + numSigFigs - 1; return roundUp(value, decimalShift); }  Class<Double> getOperandClass(); Double add( Double value1,
                       Double value2 ); Double subtract( Double value1,
                            Double value2 ); Double multiply( Double value1,
                            Double value2 ); double divide( Double value1,
                          Double value2 ); Double negate( Double value ); Double increment( Double value ); Double maximum( Double value1,
                           Double value2 ); Double minimum( Double value1,
                           Double value2 ); int compare( Double value1,
                        Double value2 ); BigDecimal asBigDecimal( Double value ); Double fromBigDecimal( BigDecimal value ); Double createZeroValue(); Double create( int value ); Double create( long value ); Double create( double value ); double sqrt( Double value ); Comparator<Double> getComparator(); Double random( Double minimum,
                          Double maximum,
                          Random rng ); double doubleValue( Double value ); float floatValue( Double value ); int intValue( Double value ); long longValue( Double value ); short shortValue( Double value ); int getExponentInScientificNotation( Double value ); Double roundUp( Double value,
                           int decimalShift ); Double roundDown( Double value,
                             int decimalShift ); Double keepSignificantFigures( Double value,
                                          int numSigFigs );  }### Answer:
@Test public void shouldKeepSignificantFigures() { assertEquals(12.012d, ops.keepSignificantFigures(12.0123456, 5), 0.0001d); assertEquals(12.013d, ops.keepSignificantFigures(12.0125456, 5), 0.0001d); assertEquals(12.01d, ops.keepSignificantFigures(12.0123456, 4), 0.0001d); assertEquals(12.0d, ops.keepSignificantFigures(12.0123456, 3), 0.0001d); assertEquals(12.0d, ops.keepSignificantFigures(12.0123456, 2), 0.0001d); assertEquals(10.0d, ops.keepSignificantFigures(12.0123456, 1), 0.0001d); assertEquals(1300.0d, ops.keepSignificantFigures(1320.0d, 2), 0.001d); }