### Question:
ForClassFilter { public <E> Collection<E> apply(Collection<E> collection, Class<?> targetClass) { Assert.notNull(collection, "Collection must not be null"); Assert.notNull(targetClass, "TargetClass must not be null"); List<E> matched = new ArrayList<E>(); Iterator<E> iterator = apply(collection.iterator(), targetClass); while (iterator.hasNext()) { matched.add(iterator.next()); } return Collections.unmodifiableCollection(matched); } ForClassFilter();  ForClassFilter(Class<?> genericType);  ForClassFilter(Class<?> genericType, int parameterIndex);  ForClassFilter(Deducer deducer); Collection<E> apply(Collection<E> collection, Class<?> targetClass); Map<K, V> apply(Map<K, V> map, Class<?> targetClass); Iterator<E> apply(Iterator<E> iterator, final Class<?> targetClass); boolean match(Object object, Class<?> targetClass);  }### Answer:
@Test public void shouldNeedCollection() throws Exception { this.thrown.expect(IllegalArgumentException.class); this.thrown.expectMessage("Collection must not be null"); new ForClassFilter().apply((Collection<?>) null, Dog.class); }
@Test public void shouldNeedTargetOnCollection() throws Exception { this.thrown.expect(IllegalArgumentException.class); this.thrown.expectMessage("TargetClass must not be null"); new ForClassFilter().apply(Collections.emptySet(), null); }
@Test public void shouldNeedMap() throws Exception { this.thrown.expect(IllegalArgumentException.class); this.thrown.expectMessage("Map must not be null"); new ForClassFilter().apply((Map<?, ?>) null, Dog.class); }
@Test public void shouldNeedTargetOnMap() throws Exception { this.thrown.expect(IllegalArgumentException.class); this.thrown.expectMessage("TargetClass must not be null"); new ForClassFilter().apply(Collections.emptyMap(), null); }
@Test public void shouldNeedIterator() throws Exception { this.thrown.expect(IllegalArgumentException.class); this.thrown.expectMessage("Iterator must not be null"); new ForClassFilter().apply((Iterator<?>) null, Dog.class); }
@Test public void shouldNeedTargetOnIterator() throws Exception { this.thrown.expect(IllegalArgumentException.class); this.thrown.expectMessage("TargetClass must not be null"); new ForClassFilter().apply(Collections.emptySet().iterator(), null); }