Here is the current list code (note it is three classes):

public abstract class List {
    
    static List create() {
        EmptyList e = new EmptyList();
        NEList ne1 = new NEList(42, e);
        NEList ne2 = new NEList(141, ne1);
        NEList ne3 = new NEList(42, ne2);
        NEList ne4 = new NEList(123, ne3);
        return ne4;
    }
    
    abstract public int length();
    
    abstract public boolean contains(int val);
    
    abstract public int sum();
    
    abstract public void print();
    
    abstract public int numOccurrences(int val);
    //return number of times val occurs in the list
    
    abstract public int get(int index);
    //return the index'th element of the list
    //return -1 if index is too large
    
    abstract public int indexOf(int val);
    //return index where val first occurs in the list
    //if val is not in the list, return -1
}

public class EmptyList extends List {

    public int length() {
        return 0;
    }
    
    public boolean contains(int val) {
        return false;
    }
    
    public int sum() {
        return 0;
    }
    
    public void print() {
        System.out.println();
    }
    
    public int numOccurrences(int val) {
        return 0;
    }
    
    public int get(int index) {
        return -1;
    }
    
    public int indexOf(int val) {
        return -1;
    }
}

public class NEList extends List {

    private int value;  //value at this node
    private List next;  //next node in sequence

    public NEList(int Value, List Next) {
        value = Value;
        next = Next;
    }
    
    public int length() {
        return next.length() + 1;
    }
    
    public boolean contains(int val) {
        if(val == value) {
            return true;
        }
        return next.contains(val);
    }
    
    public int sum() {
        return next.sum() + value;
    }    

    public void print() {
        System.out.print(value + " ");
        next.print();
    }
    
    public int numOccurrences(int val) {
        if(val == value) {
            return 1 + next.numOccurrences(val);
        }
        return next.numOccurrences(val);
    }
    
    public int get(int index) {
        if(index == 0) {
            return value;
        }
        return next.get(index-1);
    }
    
    public int indexOf(int val) {
        if(val == value) {
            return 0;
        }
        int answer = next.indexOf(val);
        if(answer == -1) {
            return -1;
        }
        return answer + 1;
    }
}