Using only the public interface of the linked list class, write a method
public static void downsize(LinkedList staff)
that removes every other employee from a linked list.
You need to supply the following class in your solution:
Business
Use the following class as your tester class:
import java.util.LinkedList;
import java.util.ListIterator;
/**
A test class for the downsize method.
*/
public class DownsizeTester
{
public static void main(String[] args)
{
LinkedList staff = new LinkedList();
staff.addLast("Dick");
staff.addLast("Harry");
staff.addLast("Romeo");
staff.addLast("Tom");
Business.downsize(staff);
System.out.println(staff);
System.out.println("Expected: [Dick, Romeo]");
}
}