PROBLEM STATEMENT: In this assignment, you will complete DoubleEndedList.java that implements the ListInterface as well as an interface called DoubleEndedInterface which represents the list's entries by using a chain of nodes that has both a head reference and a tail reference. Be sure to read through the code and understand the implementation. WHAT IS PROVIDED: - A driver class to test your code. You should not modify this file! - A list interface (ListInterface.java) - A double ended interface (DoubleEndedInterface.java) - An incomplete DoubleEndedList class (DoubleEndedList.java) WHAT YOU NEED TO DO: 4. Complete the DoubleEndedList class 4. Run the driver and make sure your output is exactly the same as mine (at the bottom of Driver.java) \} // end else numberofEntries--; else throw new IndexOut0fBoundsException("Illegal position given to remove operation."); return result; // Return removed entry }//endreturnreve public T replace(int givenPosition, T newEntry) \{ T replace(int givenPosition, T newEntry) \{ if ((givenPosition >=1)&& (givenPosition <= numberOfEntries)) \{ // Assertion: The list is not empty Node desiredNode = getNodeAt (givenPosition); ToriginalEntry = desiredNode.getData(); desiredNode.setData(newEntry); return originalEntry; f // end if else throw new IndexOut0fBoundsException("Illegal position given to replace operation."); replace if (( givenPosition >=1)&& (givenPosition <= number0fEntries)) \{ // Assertion: The list is not empty Node desiredNode = getNodeAt ( givenPosition); T originalEntry = desiredNode. getData( ); desiredNode.setData(newEntry); return originalentry; \} // end if throw new Index0ut0fBoundsException("Illegal position given to replace operation."); \} // end replace public T getEntry(int givenPosition) \{ if ((givenPosition >=1) \&\& (givenPosition < = number0fEntries ) ) \{ // Assertion: The list is not empty return getNodeAt (givenPosition). getData(); else // end if throw new IndexOut0fBoundsException("Illegal position given to getEntry operation."); \} // end getEntry public boolean contains ( T anEntry) \{ boolean found = false; Node currentNode = firstNode; while (!found && (currentNode != null)) \{ if (anEntry.equals (currentNode.getData())) else found = true; \} // end while currentNode = currentNode. getNextNode () ; return found; \} // end contains public int getLength() \{ return numberofEntries; \} // end getLength public boolean isEmpty() \{ return number0fEntries ==0; \} // end isEmpty public T[] toArray() \{ // The cast is safe because the new array contains null entries aSuppressWarnings ("unchecked") T[] result =(T[]) new 0bject [numberofEntries]; // Unchecked cast int index =0; Node currentNode = firstNode; while ((index < numberOfEntries) \&\& (currentNode != null)) \& result [ index ]= currentNode. getData () ; currentNode = currentNode.getNextNode ( ); index++; 3 // end while return result; 3 // end toArray // Returns a reference to the node at a given position. // Precondition: L.