LongOperations implements MathOperations<Long>, Comparator<Long> { @Override public Long roundDown( Long value, int decimalShift ) { if (value == 0) return 0l; if (decimalShift >= 0) return value; long shiftedValue = Math.abs(value); for (int i = 0; i != -decimalShift; ++i) shiftedValue /= 10l; shiftedValue *= Long.signum(value); for (int i = 0; i != -decimalShift; ++i) shiftedValue *= 10l; return shiftedValue; }  @Override Class<Long> getOperandClass(); @Override Long add( Long value1,
                     Long value2 ); @Override Long subtract( Long value1,
                          Long value2 ); @Override Long multiply( Long value1,
                          Long value2 ); @Override double divide( Long value1,
                          Long value2 ); @Override Long negate( Long value ); @Override Long increment( Long value ); @Override Long maximum( Long value1,
                         Long value2 ); @Override Long minimum( Long value1,
                         Long value2 ); @Override int compare( Long value1,
                        Long value2 ); @Override BigDecimal asBigDecimal( Long value ); @Override Long fromBigDecimal( BigDecimal value ); @Override Long createZeroValue(); @Override Long create( int value ); @Override Long create( long value ); @Override Long create( double value ); @Override double sqrt( Long value ); @Override Comparator<Long> getComparator(); @Override Long random( Long minimum,
                        Long maximum,
                        Random rng ); @Override double doubleValue( Long value ); @Override float floatValue( Long value ); @Override int intValue( Long value ); @Override long longValue( Long value ); @Override short shortValue( Long value ); @Override int getExponentInScientificNotation( Long value ); @Override Long roundUp( Long value,
                         int decimalShift ); @Override Long roundDown( Long value,
                           int decimalShift ); @Override Long keepSignificantFigures( Long value,
                                        int numSigFigs );  }
@Test public void shouldRoundDownNumbersGreaterThan10() { assertThat(ops.roundDown(-101l, 0), is(-101l)); assertThat(ops.roundDown(-101l, 1), is(-101l)); assertThat(ops.roundDown(-101l, 1), is(-101l)); assertThat(ops.roundDown(-101l, -1), is(-100l)); assertThat(ops.roundDown(-109l, -1), is(-100l)); assertThat(ops.roundDown(101l, 0), is(101l)); assertThat(ops.roundDown(101l, 0), is(101l)); assertThat(ops.roundDown(101l, 1), is(101l)); assertThat(ops.roundDown(101l, 1), is(101l)); assertThat(ops.roundDown(109l, -1), is(100l)); assertThat(ops.roundDown(101l, -1), is(100l)); }