mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-02 19:28:23 +07:00
1. Fixed modifiers for interfaces
2. Replacement wrapped with Collections.unmodifiableSet
3. Supported Java 1.4 and lower
4. Supported Guava ImmutableSet
5. Supported comparisons like s.equals("xyz"), Objects.equals(s, "xyz")
22 lines
439 B
Java
22 lines
439 B
Java
// "Extract Set from comparison chain" "true"
|
|
|
|
package com.google.common.collect;
|
|
|
|
import java.util.Set;
|
|
|
|
class ImmutableSet<T> {
|
|
public static <T> ImmutableSet<T> of(T... elements) {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public class Test {
|
|
private static final Set<String> S = com.google.common.collect.ImmutableSet.of("foo", "bar", "baz");
|
|
|
|
void testOr(String s) {
|
|
if(S.contains(s)) {
|
|
System.out.println("foobarbaz");
|
|
}
|
|
}
|
|
}
|