Julho 06
Prof(s). Eduardo Bezerra & Ismael H. F. Santos                                                2
Best Practices for Designing API (cont.)
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}