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