Example #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());
  }
Example #2
0
 @Test
 public void noneReturnsFalseIfPredicateMatchesAny() {
   assertFalse($(integerInput).none(integerGreaterThan1));
 }
Example #3
0
 @Test
 public void anyReturnsFalseIfEmptyCollection() {
   assertFalse($(emptyIntegerInput).any(integerGreaterThan1));
 }
Example #4
0
 @Test
 public void allReturnsFalseIfAnyDoNotMatch() {
   assertFalse($(integerInput).all(integerGreaterThan1));
 }
Example #5
0
 @Test
 public void anyReturnsFalseIfPredicateDoesNotMatch() {
   assertFalse($(integerInput).any(integerGreaterThan100));
 }