Пример #1
0
  @Test
  public void readingAsIteratorHasNextThenNextSequenceWorks() {
    Iterator<Integer> iterator = $(integerInput).asIterator();

    assertTrue(iterator.hasNext());
    assertEquals(new Integer(1), iterator.next());

    assertTrue(iterator.hasNext());
    assertEquals(new Integer(2), iterator.next());

    assertTrue(iterator.hasNext());
    assertEquals(new Integer(3), iterator.next());

    assertFalse(iterator.hasNext());
  }
Пример #2
0
 @Test
 public void noneReturnsFalseIfPredicateMatchesAny() {
   assertFalse($(integerInput).none(integerGreaterThan1));
 }
Пример #3
0
 @Test
 public void anyReturnsFalseIfEmptyCollection() {
   assertFalse($(emptyIntegerInput).any(integerGreaterThan1));
 }
Пример #4
0
 @Test
 public void allReturnsFalseIfAnyDoNotMatch() {
   assertFalse($(integerInput).all(integerGreaterThan1));
 }
Пример #5
0
 @Test
 public void anyReturnsFalseIfPredicateDoesNotMatch() {
   assertFalse($(integerInput).any(integerGreaterThan100));
 }