Program: 60055
Project: 60055
Buggy source:
/** 
 * Returns the elements of   {@code unfiltered} that satisfy a predicate. Thereturned collection is a live view of  {@code unfiltered}; changes to one affect the other. <p>The resulting collection's iterator does not support   {@code remove()}, but all other collection methods are supported. When given an element that doesn't satisfy the predicate, the collection's   {@code add()} and {@code addAll()} methods throw an {@link IllegalArgumentException}. When methods such as   {@code removeAll()} and {@code clear()} are called on the filteredcollection, only elements that satisfy the filter will be removed from the underlying collection. <p>The returned collection isn't threadsafe or serializable, even if {@code unfiltered} is.<p>Many of the filtered collection's methods, such as  {@code size()}, iterate across every element in the underlying collection and determine which elements satisfy the filter. When a live view is <i>not</i> needed, it may be faster to copy   {@code Iterables.filter(unfiltered, predicate)}and use the copy. <p><b>Warning:</b>   {@code predicate} must be <i>consistent with equals</i>,as documented at  {@link Predicate#apply}. Do not provide a predicate such as   {@code Predicates.instanceOf(ArrayList.class)}, which is inconsistent with equals. (See   {@link Iterables#filter(Iterable,Class)} for relatedfunctionality.) <p><b> {@code Stream} equivalent:</b> {@link Stream#filter}.
 */
public static <E>Collection<E> filter(Collection<E> unfiltered,Predicate<? super E> predicate){
  if (unfiltered instanceof FilteredCollection) {
    return ((FilteredCollection<E>)unfiltered).createCombined(predicate);
  }
  return new FilteredCollection<E>(checkNotNull(unfiltered),checkNotNull(predicate));
}

Fixed version (ground truth):
/** 
 * Returns the elements of   {@code unfiltered} that satisfy a predicate. Thereturned collection is a live view of  {@code unfiltered}; changes to one affect the other. <p>The resulting collection's iterator does not support   {@code remove()}, but all other collection methods are supported. When given an element that doesn't satisfy the predicate, the collection's   {@code add()} and {@code addAll()} methods throw an {@link IllegalArgumentException}. When methods such as   {@code removeAll()} and {@code clear()} are called on the filteredcollection, only elements that satisfy the filter will be removed from the underlying collection. <p>The returned collection isn't threadsafe or serializable, even if {@code unfiltered} is.<p>Many of the filtered collection's methods, such as  {@code size()}, iterate across every element in the underlying collection and determine which elements satisfy the filter. When a live view is <i>not</i> needed, it may be faster to copy   {@code Iterables.filter(unfiltered, predicate)}and use the copy. <p><b>Warning:</b>   {@code predicate} must be <i>consistent with equals</i>,as documented at  {@link Predicate#apply}. Do not provide a predicate such as   {@code Predicates.instanceOf(ArrayList.class)}, which is inconsistent with equals. (See   {@link Iterables#filter(Iterable,Class)} for relatedfunctionality.) <p><b> {@code Stream} equivalent:</b> {@link java.util.stream.Stream#filter Stream.filter}.
 */
public static <E>Collection<E> filter(Collection<E> unfiltered,Predicate<? super E> predicate){
  if (unfiltered instanceof FilteredCollection) {
    return ((FilteredCollection<E>)unfiltered).createCombined(predicate);
  }
  return new FilteredCollection<E>(checkNotNull(unfiltered),checkNotNull(predicate));
}