@Test public void testSquareListRecursive() { IntList L = IntList.of(1, 2, 3); IntList res = IntList.squareListRecursive(L); assertEquals(IntList.of(1, 2, 3), L); assertEquals(IntList.of(1, 4, 9), res); }
public static IntList squareListRecursive(IntList L) { if (L == null) { return null; } return new IntList(L.first * L.first, squareListRecursive(L.rest)); }
IntList { public static IntList squareListRecursive(IntList L) { if (L == null) { return null; } return new IntList(L.first * L.first, squareListRecursive(L.rest)); } }
IntList { public static IntList squareListRecursive(IntList L) { if (L == null) { return null; } return new IntList(L.first * L.first, squareListRecursive(L.rest)); } IntList(int first0, IntList rest0);  IntList(); }
IntList { public static IntList squareListRecursive(IntList L) { if (L == null) { return null; } return new IntList(L.first * L.first, squareListRecursive(L.rest)); } IntList(int first0, IntList rest0);  IntList(); static void dSquareList(IntList L); static IntList squareListIterative(IntList L); static IntList squareListRecursive(IntList L); static IntList dcatenate(IntList A, IntList B); static IntList catenate(IntList A, IntList B); static IntList reverse(IntList A); @Override int hashCode(); static IntList of(Integer... args); boolean equals(Object x); @Override /** Outputs the IntList as a String. You are not expected to read * or understand this method. */ String toString(); }
IntList { public static IntList squareListRecursive(IntList L) { if (L == null) { return null; } return new IntList(L.first * L.first, squareListRecursive(L.rest)); } IntList(int first0, IntList rest0);  IntList(); static void dSquareList(IntList L); static IntList squareListIterative(IntList L); static IntList squareListRecursive(IntList L); static IntList dcatenate(IntList A, IntList B); static IntList catenate(IntList A, IntList B); static IntList reverse(IntList A); @Override int hashCode(); static IntList of(Integer... args); boolean equals(Object x); @Override /** Outputs the IntList as a String. You are not expected to read * or understand this method. */ String toString();  }