4.Document exceptions
nYou can use Javadoc's @throws tag to document both checked and unchecked exceptions that your
API throws. Or
write unit tests to document exceptions.
n
npublic void testIndexOutOfBoundsException() {
n
ArrayList blankList = new ArrayList();
n try
{
n
blankList.get(10);
n fail("Should raise an
IndexOutOfBoundsException");
n }
catch (IndexOutOfBoundsException success) {}
n}