class LongOperations implements MathOperations<Long>, Comparator<Long> {

    @Override
    public Long roundUp( Long value,
                         int decimalShift ) {
        if (value == 0) return 0l;
        if (decimalShift >= 0) return value;
        long shiftedValueP5 = Math.abs(value);
        for (int i = 0; i != (-decimalShift - 1); ++i)
            shiftedValueP5 /= 10l;
        shiftedValueP5 += 5l;
        long shiftedValue = shiftedValueP5 / 10l;
        if (shiftedValue * 10l - shiftedValueP5 >= 5) ++shiftedValue;
        shiftedValue *= Long.signum(value);
        for (int i = 0; i != -decimalShift; ++i)
            shiftedValue *= 10l;
        return shiftedValue;
    }

}