Skip to content

Instantly share code, notes, and snippets.

@nucatus
Created August 23, 2018 01:38
Show Gist options
  • Save nucatus/37ea861e02a8cdd6c9048447700f177a to your computer and use it in GitHub Desktop.
Save nucatus/37ea861e02a8cdd6c9048447700f177a to your computer and use it in GitHub Desktop.
Java 8 compiler failure
import java.util.Collection;
import java.util.stream.Collectors;
public class TestCase
{
Class clazz;
Collection<Target> targets;
public Collection<Target> getTargets()
{
Collection<Target> myTargets = targets.stream()
.filter( t -> t.isApplicable( clazz ) )
.collect( Collectors.toList());
return myTargets;
}
public interface Target
{
boolean isApplicable(Class<? extends MainType> clazz);
}
public interface MainType
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment