mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-18 17:20:54 +07:00
16 lines
433 B
Java
16 lines
433 B
Java
import java.util.Arrays;
|
|
import java.util.Collections;
|
|
import java.util.HashSet;
|
|
import java.util.Set;
|
|
|
|
// "Extract Set from comparison chain" "true-preview"
|
|
public class Test {
|
|
private static final Set<String> NAMES = Collections.unmodifiableSet(new HashSet<>(Arrays.asList("foo", "bar", "baz")));
|
|
|
|
void testOr(String name) {
|
|
if(name == null || NAMES.contains(name)) {
|
|
System.out.println("foobarbaz");
|
|
}
|
|
}
|
|
}
|