Created
August 23, 2018 01:38
-
-
Save nucatus/37ea861e02a8cdd6c9048447700f177a to your computer and use it in GitHub Desktop.
Java 8 compiler failure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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