ModificationsUtil { public static <T> void registerAddedItems(ModificationsImpl<T> modifications, Iterable<T> items) { if (items != null) { for (T item : items) { modifications.registerAddedItem(item); } } } private  ModificationsUtil(); static Modifications<T2> convertModifications(Modifications<T1> src, Converter<T1, T2> converter); static Modifications<T> createModfications(Collection<T> added, Collection<T> updated,
      Collection<T> removed); static boolean isModified(Modifications<T> modifications, T item); static void registerAddedItems(ModificationsImpl<T> modifications, Iterable<T> items); static void registerUpdatedItems(ModificationsImpl<T> modifications, Iterable<T> items); static void registerRemovedItems(ModificationsImpl<T> modifications, Iterable<T> items); static Modifications<T> joinModifications(Collection<? extends Modifications<T>> modificationSet);  }
@Test public void testRegisterAddedItems() { ModificationsUtil.registerAddedItems(modifications, Arrays.asList("hello", "world")); assertEquals("{added: 2, updated: 0, removed: 0}", modifications.toString()); assertEquals("[hello, world]", modifications.getAddedItems().toString()); }