I have a method for a filter by type, it gets as input `Collection<?> collection` and `Class<T> tClass`. I want to replace `FluentIterable` by the `Stream`.

```
public static <T> List<T> filterByType(final Collection<?> filerCollection, final Class<T> classType) 
{
    return FluentIterable.from(filerCollection).filter(classType).toList();
}

```

I tried with this solution:

```
public static <T> List<T> typeFilter(final Collection<?> filter, final Class<T> classType) {
    return (List<T>) filter.stream()
            .filter(Objects::nonNull)
            .map(Object.class::cast)
            .collect(Collectors.toList());
}

```

how to do that without casting the return `Stream`?