Question: Create a test class that tests all the methods of the following class: (Please create it into a different class, instead of just putting it
Create a test class that tests all the methods of the following class: (Please create it into a different class, instead of just putting it in the main method of this class) Thanks!
import java.util.NoSuchElementException; public class QueueImpl
The class above implements the following interface:
public interface QueueInterface
{
/** Adds a new entry to the back of this queue.
@param newEntry An object to be added. */
public void enqueue(T newEntry);
/** Removes and returns the entry at the front of this queue.
@return The object at the front of the queue.
@throws EmptyQueueException if the queue is empty before the operation. */
public T dequeue();
/** Retrieves the entry at the front of this queue.
@return The object at the front of the queue.
@throws EmptyQueueException if the queue is empty. */
public T getFront();
/** Detects whether this queue is empty.
@return True if the queue is empty, or false otherwise. */
public boolean isEmpty();
/** Removes all entries from this queue. */
public void clear();
/** generates a string containing all data in the queue and returns it
public String toString();
} // end QueueInterface
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
