@SuppressWarnings("unchecked")
public static <E extends Resource<?>, R extends Collection<E>, I extends Collection<Resource<?>>> R filterByType(
final Class<E> type, final I list)
{
ResourceFilter filter = new ResourceFilter()
{
@Override
public boolean accept(Resource<?> resource)
{
return type.isAssignableFrom(resource.getClass());