/** * Test merging of calendars. */ public void testMerge() throws IOException, ParserException { Calendar result = calendars[0]; for (int i = 1; i < calendars.length; i++) { result = Calendars.merge(result, calendars[i]); } for (int i = 0; i < calendars.length; i++) { for (Property p : calendars[i].getProperties()) { assertTrue("Property [" + p + "] not found in merged calendar", result.getProperties().contains(p)); } for (Component c : calendars[i].getComponents()) { assertTrue("Component [" + c + "] not found in merged calendar", result.getComponents().contains(c)); } } }