Add a method length to the LispList interface of Exercise P15.10 that returns the length of the list. Implement the method in the EmptyList and NonEmptyList classes.

Complete the following files:

Use the following files:

public interface LispList
   LispList NIL = new EmptyList();
   boolean isEmpty();
   Object head();
   LispList tail();
   LispList cons(Object obj);
   int length();

public class LispListTester
   public static void main(String[] args)
      LispList list1 = new EmptyList();
      System.out.println("Expected: 0");

      LispList list2 = new NonEmptyList("A", new EmptyList());
      System.out.println("Expected: 1");

      LispList list3 = new NonEmptyList("A", new NonEmptyList("B",
         new NonEmptyList("C", new EmptyList())));
      System.out.println("Expected: 3");

      LispList list4 = LispList.NIL.cons("E").cons("D").cons("C").cons("B").cons("A");
      System.out.println("Expected: 5");