/** Tests finding index of registered and unregistered guides. */ public void testIndexOf() { IGuide guide1 = new StandardGuide(); guide1.setTitle("1"); set.add(guide1); assertEquals("Wrong index.", 0, set.indexOf(guide1)); assertEquals("Wrong index.", -1, set.indexOf(new StandardGuide())); }
/** Tests handling of incorrect input for index finding method. */ public void testIndexOfFail() { try { set.indexOf(null); fail("Guide should be specified. NPE is expected."); } catch (NullPointerException e) { // Expected } }