Testing exceptional conditions

    public void testCantRetrieveFromEmptyList() {
     
        try {
            list.getFirst();
            fail("Got Something from an empty list");
        }
        catch (NoSuchElementException success) {
        }
        
    }

Previous | Next | Top | Cafe con Leche | Cafe au Lait

Copyright 2005 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified August 26, 2005