/** A WeirdList holds a sequence of integers. */ public class WeirdList { /** The empty sequence of integers. */ public static WeirdList EMPTY = null; // REPLACE THIS LINE WITH THE RIGHT ANSWER. /** A new WeirdList whose head is HEAD and tail is * TAIL. */ public WeirdList (int head, WeirdList tail) { /* FILL IN */ } /** The number of elements in the sequence that * starts with THIS. */ public int length () { return 0; // REPLACE THIS LINE WITH THE RIGHT ANSWER. } /** Apply func.apply to every element of THIS WeirdList in * sequence, and return a WeirdList of the resulting values. */ public WeirdList map (IntUnaryFunction x) { return null; // REPLACE THIS LINE WITH THE RIGHT ANSWER. } /** Print the contents of THIS WeirdList on the standard output * (on one line, each followed by a blank). Does not print * an end-of-line. */ public void print () { /* FILL IN */ } // FILL IN WITH *PRIVATE* FIELDS ONLY. // You should NOT need any more methods here. } // FILL IN OTHER CLASSES HERE (HINT, HINT). class User { /** The result of adding N to each element of L. */ static WeirdList add (WeirdList L, int n) { return null; // REPLACE THIS LINE WITH THE RIGHT ANSWER. } /** The sum of the elements in L */ static int sum (WeirdList L) { return 0; // REPLACE THIS LINE WITH THE RIGHT ANSWER. } }