Created
February 1, 2017 08:44
-
-
Save isopov/97639773b202663ad65075ae988e1f4d to your computer and use it in GitHub Desktop.
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.ArrayList; | |
import java.util.HashSet; | |
import java.util.List; | |
import java.util.Set; | |
import java.util.concurrent.Callable; | |
import static java.util.Arrays.asList; | |
/** | |
* @author isopov | |
*/ | |
public final class CollectInspectionTest { | |
private void foobar() { | |
final List<Callable<Boolean>> callables = new ArrayList<>(); | |
final Set<String> ab = new HashSet<>(asList("a", "b")); | |
final List<String> list = asList("a", "b", "c"); | |
for (String f : list) { | |
if (!ab.contains(f)) { | |
continue; | |
} | |
callables.add(() -> { | |
System.out.println(f); | |
return false; | |
}); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment