class Empty extends List1 { public int head() { throw new NullPointerException(); } public List1 tail() { throw new NullPointerException(); } public boolean isEmpty() { return true; } public String toString() { return "[]"; } }