Polymorphic Accumulator - take 2

package accumulate.poly2;

public interface Accumulable {
    public void incrementBy(Object obj);
    public Object getValue();
}

package accumulate.poly2;

/**
 * An accumulator is an object that starts with an initial value
 * and may be incremented later.
 */
public class Accumulator
{
    private Accumulable value;

    public Accumulator(Accumulable initialValue) {
        value = initialValue;
    }

    public Object incrementBy(Object increment) {
        value.incrementBy(increment);
        return value.getValue();
    }

    public Object getValue() {
        return value.getValue();
    }
}

package accumulate.poly2;

/**
 * An accumulator for integers that accepts any
 * subclass of Number as an argument to the incrementBy method
 */
public class AccumulableInt implements Accumulable {
    private int value;

    public AccumulableInt(int initialValue) {
        value = initialValue;
    }

    /**
     * we have to define what it means for an object
     * of this type to be incremented by an object
     * of some other type.
     @param inc must be a subclass of Number
     @throws ClassCastException if inc is not a subclass of Number
     */
    public void incrementBy(Object inc) {
        // if obj is any kind of number we convert it
        // to int and accumulate it. 
        // Floating point types will be truncated.
        int i = ((Number)inc).intValue();
        value += i;
    }

    public Object getValue() {
        return new Integer(value);
    }
}

package accumulate.poly2;

public class TestOOAccumulator
{

    public static void main(String[] args
    {
        String ln = System.getProperty("line.separator");
        System.out.println(ln + "Testing OO Accumulator" + ln);

        System.out.println("We should get: " (17+19+23+29+31) );

        Accumulator acc = new Accumulatornew AccumulableInt(17) );
        acc.incrementBynew Integer(19) );
        acc.incrementBynew Integer(23) );
        acc.incrementBynew Integer(29) );
        acc.incrementBynew Integer(31) );

        System.out.printlnacc.getValue() );

        try {
            System.out.println(ln+"What happens if we do this:");
            System.out.println("  acc.incrementBy(\"watusi\");");
            acc.incrementBy("watusi");
        catch(Exception e) {
            e.printStackTrace();
        }
    }
}

output:

Testing OO Accumulator

We should get: 119
119

What happens if we do this:
  acc.incrementBy("watusi");
java.lang.ClassCastException
	at accumulate.poly2.AccumulableInt.incrementBy(AccumulableInt.java:24)
	at accumulate.poly2.Accumulator.incrementBy(Accumulator.java:12)
	at accumulate.poly2.TestOOAccumulator.main(TestOOAccumulator.java:25)