use of cyclops.companion.Streamable in project cyclops by aol.
the class BatchingRSTest method onePer.
@Test
public void onePer() {
SimpleTimer timer = new SimpleTimer();
System.out.println(of(1, 2, 3, 4, 5, 6).onePer(1000, TimeUnit.NANOSECONDS).to(Streamable::fromStream).collect(Collectors.toList()));
assertThat(of(1, 2, 3, 4, 5, 6).onePer(1000, TimeUnit.NANOSECONDS).to(Streamable::fromStream).collect(Collectors.toList()).size(), is(6));
assertThat(timer.getElapsedNanoseconds(), greaterThan(600l));
}
use of cyclops.companion.Streamable in project cyclops by aol.
the class ZippingTest method testUnzip3.
@Test
public void testUnzip3() {
Supplier<Streamable<Tuple3<Integer, String, Long>>> s = () -> of(new Tuple3(1, "a", 2l), new Tuple3(2, "b", 3l), new Tuple3(3, "c", 4l));
Tuple3<Streamable<Integer>, Streamable<String>, Streamable<Long>> u1 = Streamable.unzip3(s.get());
assertTrue(u1._1().toList().containsAll(Arrays.asList(1, 2, 3)));
assertTrue(u1._2().toList().containsAll(asList("a", "b", "c")));
assertTrue(u1._3().toList().containsAll(asList(2l, 3l, 4l)));
}
use of cyclops.companion.Streamable in project cyclops by aol.
the class ZippingTest method testUnzip4.
@Test
public void testUnzip4() {
Supplier<Streamable<Tuple4<Integer, String, Long, Character>>> s = () -> of(new Tuple4(1, "a", 2l, 'z'), new Tuple4(2, "b", 3l, 'y'), new Tuple4(3, "c", 4l, 'x'));
Tuple4<Streamable<Integer>, Streamable<String>, Streamable<Long>, Streamable<Character>> u1 = Streamable.unzip4(s.get());
assertTrue(u1._1().toList().containsAll(Arrays.asList(1, 2, 3)));
assertTrue(u1._2().toList().containsAll(asList("a", "b", "c")));
assertTrue(u1._3().toList().containsAll(asList(2l, 3l, 4l)));
assertTrue(u1._4().toList().containsAll(asList('z', 'y', 'x')));
}
use of cyclops.companion.Streamable in project cyclops by aol.
the class BatchingRSTest method onePer.
@Test
public void onePer() {
SimpleTimer timer = new SimpleTimer();
System.out.println(of(1, 2, 3, 4, 5, 6).onePer(1000, TimeUnit.NANOSECONDS).to(Streamable::fromStream).collect(Collectors.toList()));
assertThat(of(1, 2, 3, 4, 5, 6).onePer(1000, TimeUnit.NANOSECONDS).to(Streamable::fromStream).collect(Collectors.toList()).size(), is(6));
assertThat(timer.getElapsedNanoseconds(), greaterThan(600l));
}
use of cyclops.companion.Streamable in project cyclops by aol.
the class BatchingRSTest method onePer.
@Test
public void onePer() {
SimpleTimer timer = new SimpleTimer();
System.out.println(of(1, 2, 3, 4, 5, 6).onePer(1000, TimeUnit.NANOSECONDS).to(Streamable::fromStream).collect(Collectors.toList()));
assertThat(of(1, 2, 3, 4, 5, 6).onePer(1000, TimeUnit.NANOSECONDS).to(Streamable::fromStream).collect(Collectors.toList()).size(), is(6));
assertThat(timer.getElapsedNanoseconds(), greaterThan(600l));
}
Aggregations