Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for onlyElement (0.04 sec)

  1. guava-tests/test/com/google/common/collect/MoreCollectorsTest.java

        assertThrows(NoSuchElementException.class, () -> Stream.empty().collect(onlyElement()));
      }
    
      public void testOnlyElementSingleton() {
        assertThat(Stream.of(1).collect(onlyElement())).isEqualTo(1);
      }
    
      public void testOnlyElementNull() {
        assertThat(Stream.<@Nullable Object>of((Object) null).collect(onlyElement())).isNull();
      }
    
      public void testOnlyElementMultiple() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 20:24:49 UTC 2024
    - 3.2K bytes
    - Viewed (0)
  2. guava-tests/benchmark/com/google/common/collect/StreamsBenchmark.java

     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    
    package com.google.common.collect;
    
    import static com.google.common.collect.MoreCollectors.onlyElement;
    
    import com.google.caliper.BeforeExperiment;
    import com.google.caliper.Benchmark;
    import com.google.caliper.Param;
    import com.google.caliper.api.SkipThisScenarioException;
    import java.util.ArrayList;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Fri Oct 18 20:24:49 UTC 2024
    - 2.8K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/collect/MoreCollectors.java

       * more elements, and a {@code NoSuchElementException} if the stream is empty.
       */
      @SuppressWarnings("unchecked")
      public static <T extends @Nullable Object> Collector<T, ?, T> onlyElement() {
        return (Collector) ONLY_ELEMENT;
      }
    
      /**
       * This atrocity is here to let us report several of the elements in the stream if there were more
       * than one, not just two.
       */
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Wed Oct 16 21:21:17 UTC 2024
    - 5.6K bytes
    - Viewed (0)
Back to top