Returns the empty immutable set. Preferred over {@link Collections#emptySet} for code consistency, and because the return type conveys the immutability guarantee. <p><b>Performance note:</b> the instance returned is a singleton.
()
| 80 | * <p><b>Performance note:</b> the instance returned is a singleton. |
| 81 | */ |
| 82 | @SuppressWarnings({"unchecked"}) // fully variant implementation (never actually produces any Es) |
| 83 | public static <E> ImmutableSet<E> of() { |
| 84 | return (ImmutableSet<E>) RegularImmutableSet.EMPTY; |
| 85 | } |
| 86 | |
| 87 | /** |
| 88 | * Returns an immutable set containing the given element. Preferred over {@link |
no test coverage detected