mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-17 07:20:53 +07:00
20 lines
406 B
Java
20 lines
406 B
Java
// "Call 'toArray(new String[0])'" "true-preview"
|
|
import java.util.List;
|
|
import java.util.Objects;
|
|
|
|
class Test {
|
|
static <T> boolean contains(T needle, T... haystack) {
|
|
for (final T t : haystack) {
|
|
if (Objects.equals(t, needle)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
void use(List<String> list, String s) {
|
|
if (contains(s, list.toArray(new String[0]))) {
|
|
|
|
}
|
|
}
|
|
} |