IntegerOperations implements MathOperations<Integer>, Comparator<Integer> { @Override public int getExponentInScientificNotation( Integer value ) { int v = Math.abs(value); int exp = 0; if (v > 1) { while (v >= 10) { v /= 10; ++exp; } } return exp; }  @Override Class<Integer> getOperandClass(); @Override Integer add( Integer value1,
                        Integer value2 ); @Override Integer subtract( Integer value1,
                             Integer value2 ); @Override Integer multiply( Integer value1,
                             Integer value2 ); @Override double divide( Integer value1,
                          Integer value2 ); @Override Integer negate( Integer value ); @Override Integer increment( Integer value ); @Override Integer maximum( Integer value1,
                            Integer value2 ); @Override Integer minimum( Integer value1,
                            Integer value2 ); @Override int compare( Integer value1,
                        Integer value2 ); @Override BigDecimal asBigDecimal( Integer value ); @Override Integer fromBigDecimal( BigDecimal value ); @Override Integer createZeroValue(); @Override Integer create( int value ); @Override Integer create( long value ); @Override Integer create( double value ); @Override double sqrt( Integer value ); @Override Comparator<Integer> getComparator(); @Override Integer random( Integer minimum,
                           Integer maximum,
                           Random rng ); @Override double doubleValue( Integer value ); @Override float floatValue( Integer value ); @Override int intValue( Integer value ); @Override long longValue( Integer value ); @Override short shortValue( Integer value ); @Override int getExponentInScientificNotation( Integer value ); @Override Integer roundUp( Integer value,
                            int decimalShift ); @Override Integer roundDown( Integer value,
                              int decimalShift ); @Override Integer keepSignificantFigures( Integer value,
                                           int numSigFigs );  }
@Test public void shouldReturnProperExponenentInScientificNotation() { assertEquals(0, ops.getExponentInScientificNotation(0)); assertEquals(0, ops.getExponentInScientificNotation(1)); assertEquals(0, ops.getExponentInScientificNotation(2)); assertEquals(0, ops.getExponentInScientificNotation(9)); assertEquals(1, ops.getExponentInScientificNotation(10)); assertEquals(1, ops.getExponentInScientificNotation(20)); assertEquals(1, ops.getExponentInScientificNotation(99)); assertEquals(2, ops.getExponentInScientificNotation(100)); assertEquals(2, ops.getExponentInScientificNotation(200)); assertEquals(2, ops.getExponentInScientificNotation(999)); assertEquals(3, ops.getExponentInScientificNotation(1000)); assertEquals(3, ops.getExponentInScientificNotation(2000)); assertEquals(3, ops.getExponentInScientificNotation(9999)); }