@Test public void testRemove() { TitleInfoDefinition obj1 = new TitleInfoDefinition(); TitleInfoDefinition obj2 = new TitleInfoDefinition(); IdentifierDefinition obj3 = new IdentifierDefinition(); TitleInfoDefinition obj4 = new TitleInfoDefinition(); IdentifierDefinition obj5 = new IdentifierDefinition(); List<Object> list = new ArrayList<Object>(Arrays.asList(obj1, obj2, obj3, obj4, obj5)); List<Object> expected = Arrays.<Object>asList(obj1, obj2, obj4); Class type = IdentifierDefinition.class; MapperUtils.remove(list, type); assertThat(expected, Is.is(list)); }
public static void remove(List<?> list, Class<?> type) { for (Iterator<?> it = list.iterator(); it.hasNext();) { Object item = it.next(); if (type.isInstance(item)) { it.remove(); } } }
MapperUtils { public static void remove(List<?> list, Class<?> type) { for (Iterator<?> it = list.iterator(); it.hasNext();) { Object item = it.next(); if (type.isInstance(item)) { it.remove(); } } } }
MapperUtils { public static void remove(List<?> list, Class<?> type) { for (Iterator<?> it = list.iterator(); it.hasNext();) { Object item = it.next(); if (type.isInstance(item)) { it.remove(); } } }  }
MapperUtils { public static void remove(List<?> list, Class<?> type) { for (Iterator<?> it = list.iterator(); it.hasNext();) { Object item = it.next(); if (type.isInstance(item)) { it.remove(); } } }  static String normalize(String s); static String toString(StringPlusLanguage textElement); static String toString(JAXBElement<String> textElement); static boolean isEmpty(Collection<?> l); static List<StringPlusLanguage> toStringPlusLanguage(List<String> strings); static List<StringPlusLanguagePlusAuthority> toStringPlusLanguagePlusAuthority(List<String> strings); static List<String> toStringPlusLanguageValue(List<? extends StringPlusLanguage> spls); static List<JAXBElement<String>> toJaxb(List<String> values, QName name); static T findFirst(List<?> list, Class<T> type); static List<T> find(List<?> list, Class<T> type); static T findFirst(List<JAXBElement<?>> elms, Class<T> type, QName... names); static JAXBElement<?> findFirst(List<JAXBElement<?>> elms, QName... names); static List<T> find(List<JAXBElement<?>> elms, Class<T> type, QName name); static List<JAXBElement<?>> findAny(List<JAXBElement<?>> elms, QName... names); static List<JAXBElement<T>> find(List<JAXBElement<T>> elms, QName... names); static T findFirst(List<T> list, Selector<T> selector); static List<T> find(List<T> list, Selector<T> selector); static Selector<JAXBElement<T>> jaxbElementSelector(final QName name); static void remove(List<?> list, Class<?> type); static List<T> mergeList(List<? extends T> list1, List<? extends T> list2, List<? extends T>... rest); static List<T> noNull(List<T> list); static List<T> noNull(List<T> list, boolean liveList); static T asNull(T collection); }
MapperUtils { public static void remove(List<?> list, Class<?> type) { for (Iterator<?> it = list.iterator(); it.hasNext();) { Object item = it.next(); if (type.isInstance(item)) { it.remove(); } } }  static String normalize(String s); static String toString(StringPlusLanguage textElement); static String toString(JAXBElement<String> textElement); static boolean isEmpty(Collection<?> l); static List<StringPlusLanguage> toStringPlusLanguage(List<String> strings); static List<StringPlusLanguagePlusAuthority> toStringPlusLanguagePlusAuthority(List<String> strings); static List<String> toStringPlusLanguageValue(List<? extends StringPlusLanguage> spls); static List<JAXBElement<String>> toJaxb(List<String> values, QName name); static T findFirst(List<?> list, Class<T> type); static List<T> find(List<?> list, Class<T> type); static T findFirst(List<JAXBElement<?>> elms, Class<T> type, QName... names); static JAXBElement<?> findFirst(List<JAXBElement<?>> elms, QName... names); static List<T> find(List<JAXBElement<?>> elms, Class<T> type, QName name); static List<JAXBElement<?>> findAny(List<JAXBElement<?>> elms, QName... names); static List<JAXBElement<T>> find(List<JAXBElement<T>> elms, QName... names); static T findFirst(List<T> list, Selector<T> selector); static List<T> find(List<T> list, Selector<T> selector); static Selector<JAXBElement<T>> jaxbElementSelector(final QName name); static void remove(List<?> list, Class<?> type); static List<T> mergeList(List<? extends T> list1, List<? extends T> list2, List<? extends T>... rest); static List<T> noNull(List<T> list); static List<T> noNull(List<T> list, boolean liveList); static T asNull(T collection);  }