All pastes #334966 Raw Edit

Untitled

public text v1 · immutable
·published 2007-02-01 01:10 UTC
rendered paste body
/**
 * A class to test LinkedList.java
 * 
 * @author Josef Nilsen 
 * @version v1.0 BETA
 */
public class testList
{
    /**
     * Tests an empty linked list with the method isEmpty()
     */
    public void testEmpty()
    {
        LinkedList<String> testList = new LinkedList<String>();
        System.out.println("1. Testing isEmpty() with an empty LinkedList!");
        if(testList.isEmpty())
        {
            System.out.println("Success! isEmpty() returned true for an empty list!\n");
        } else {
            System.out.println("Error! isEmpty() returned false for an empty list!\n");
        }
    }
}