@Override public LongStream asLongStream() { return LongStream.of(element); }
public final long usrTime() { return LongStream.of(usrTimes).sum(); }
private LongStream toStream() { return LongStream.of(element); }
public final long sysTime() { return LongStream.of(sysTimes).sum(); }
/** * If a value is present in {@code optional}, returns a stream containing only that element, * otherwise returns an empty stream. * * <p><b>Java 9 users:</b> use {@code optional.stream()} instead. */ public static LongStream stream(OptionalLong optional) { return optional.isPresent() ? LongStream.of(optional.getAsLong()) : LongStream.empty(); }
public static PrimitiveRelationshipStream of( long[] array ) { return new PrimitiveRelationshipStream( LongStream.of( array ) ); }
public static PrimitiveNodeStream of( long[] array ) { return new PrimitiveNodeStream( LongStream.of( array ) ); }
/** * If a value is present in {@code optional}, returns a stream containing only that element, * otherwise returns an empty stream. * * <p><b>Java 9 users:</b> use {@code optional.stream()} instead. */ public static LongStream stream(OptionalLong optional) { return optional.isPresent() ? LongStream.of(optional.getAsLong()) : LongStream.empty(); }
private static Object[] box(long[] rest) { return LongStream.of(rest).boxed().toArray(Long[]::new); }
/** * If a value is present in {@code optional}, returns a stream containing only that element, * otherwise returns an empty stream. * * <p><b>Java 9 users:</b> use {@code optional.stream()} instead. */ public static LongStream stream(OptionalLong optional) { return optional.isPresent() ? LongStream.of(optional.getAsLong()) : LongStream.empty(); }
public void testMapWithIndex_longStream_closeIsPropagated_sized() { testMapWithIndex_longStream_closeIsPropagated(LongStream.of(1, 2, 3)); }
/** * If a value is present in {@code optional}, returns a stream containing only that element, * otherwise returns an empty stream. * * <p><b>Java 9 users:</b> use {@code optional.stream()} instead. */ public static LongStream stream(OptionalLong optional) { return optional.isPresent() ? LongStream.of(optional.getAsLong()) : LongStream.empty(); }
/** * Verifies that {@link LongPredicate} evaluates all the given values to {@code false}. * <p> * Example : * <pre><code class='java'> LongPredicate evenNumber = n -> n % 2 == 0; * * // assertion succeeds: * assertThat(evenNumber).rejects(1, 3, 5); * * // assertion fails because of 2: * assertThat(evenNumber).rejects(1, 2, 3);</code></pre> * * @param values values that the actual {@code Predicate} should reject. * @return this assertion object. * @throws AssertionError if the actual {@code Predicate} accepts one of the given values. */ public LongPredicateAssert rejects(long... values) { if (values.length == 1) return rejectsInternal(values[0]); return rejectsAllInternal(LongStream.of(values).boxed().collect(Collectors.toList())); } }
private Read txState( long... ids ) { return txState( LongStream.of( ids ).mapToObj( id -> rel( id, node, node, type ) ).toArray( Rel[]::new ) ); }
private StorageRelationshipTraversalCursor storeCursor( long... ids ) { return storeCursor( LongStream.of( ids ).mapToObj( id -> rel( id, -1L, -1L, -1 ) ).toArray( Rel[]::new ) ); }
public void testMapWithIndex_longStream() { SpliteratorTester.of( () -> Streams.mapWithIndex(LongStream.of(0, 1, 2), (x, i) -> x + ":" + i).spliterator()) .expect("0:0", "1:1", "2:2"); }
@Test public void constructor_throws_IAE_if_timestamp_is_less_than_0() { LongStream.of(0, 1 + new Random().nextInt(12)) .forEach(timestamp -> assertThat(new Message("foo", timestamp).getTimestamp()).isEqualTo(timestamp)); long lessThanZero = -1 - new Random().nextInt(33); expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("Text can't be less than 0"); new Message("bar", lessThanZero); }
public void testCopyOf_stream() { assertThat(ImmutableLongArray.copyOf(LongStream.empty())).isSameAs(ImmutableLongArray.of()); assertThat(ImmutableLongArray.copyOf(LongStream.of(0, 1, 3)).asList()) .containsExactly(0L, 1L, 3L) .inOrder(); }