- Sort Score
- Num 10 results
- Language All
Results 1 - 2 of 2 for SingletonImmutableSet (0.1 seconds)
-
android/guava-tests/test/com/google/common/collect/ImmutableSetTest.java
return ImmutableSet.copyOf(elements); } public void testCreation_allDuplicates() { ImmutableSet<String> set = ImmutableSet.copyOf(Lists.newArrayList("a", "a")); assertTrue(set instanceof SingletonImmutableSet); assertEquals(Lists.newArrayList("a"), new ArrayList<>(set)); } public void testCreation_oneDuplicate() { // now we'll get the varargs overload
Created: Fri Dec 26 12:43:10 GMT 2025 - Last Modified: Thu Aug 07 16:05:33 GMT 2025 - 14.1K bytes - Click Count (0) -
guava/src/com/google/common/collect/ImmutableSet.java
* Collections#singleton} for code consistency, {@code null} rejection, and because the return * type conveys the immutability guarantee. */ public static <E> ImmutableSet<E> of(E e1) { return new SingletonImmutableSet<>(e1); } /* * TODO: b/315526394 - Skip the Builder entirely for the of(...) methods, since we don't need to * worry that we might trigger the fallback to the JDK-backed implementation? (The varargs oneCreated: Fri Dec 26 12:43:10 GMT 2025 - Last Modified: Fri Nov 07 16:09:47 GMT 2025 - 35.3K bytes - Click Count (0)