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