/** This class tests your implementation of the Numeric interface, using * a main function. The version here is just to get you started. * The graders will actually do a more rigorous test of your implementation, * so you should extend this file yourself to test that everything is * really working to your satisfaction. */ public class NumericTest { /** Print "s: n" using System.out.println. * The Numeric object n is printed as a long and also using toString. * Typically used to print the answer of a test. */ public static void printit(String s, Numeric n) { System.out.println(s + ": " + n.longValue() + " " + n); } /** Test the RussianDoll implementation of Numeric. */ public static void main(String[] args) { Numeric n1 = RussianDoll.valueOf(20L); Numeric n2 = RussianDoll.valueOf(7L); printit("20", n1); printit(" 7", n2); printit("sum", n1.add(n2)); Numeric[] qr = n1.divideAndRemainder(n2); printit(" quotient", qr[0]); printit(" remainder", qr[1]); } }