### Question:
ActivityLogger { public void clearActivityItems() { Runnable clear = () -> { activityItems.clear(); }; if (Platform.isFxApplicationThread()) { clear.run(); } else { Platform.runLater(clear); } } ActivityLogger(); void addActivityItem(final ActivityItem item); ObservableList<ActivityItem> getActivityItems(); void clearActivityItems();  }### Answer:
@Test public void testClearActivityItems() { final int itemsToAdd = 20; for (int i = 0; i < itemsToAdd; ++i) { ActivityItem item = ActivityItem.create(); logger.addActivityItem(item); } assertEquals(logger.getActivityItems().size(), itemsToAdd); logger.clearActivityItems(); assertTrue(logger.getActivityItems().isEmpty()); }