Projects >> truth >>9289ed34ae5c0561c9e33dbb7b7b7c6750e4a410

Chunk
Conflicting content
  }

  /**
<<<<<<< HEAD
   * Attests that the subject contains one or more objects, or fails
   */
  public And isNotEmpty() {
    if (!getSubject().iterator().hasNext()) {
      fail("isEmpty");
    }
    return nextChain();
  }

  public And hasContentsInOrder(Object... expected) {
    // TODO(kevinb): prettier error message
    List target = new ArrayList();
    for (Object t : getSubject()) {
      target.add(t);
=======
   * Asserts that the items are supplied in the order given by the iterable. For
   * Collections and other things which contain items but may not have guaranteed
   * iteration order, this method should be overridden.
   */
  public And iteratesOverSequence(Object... expectedItems) {
    Iterator actualItems = getSubject().iterator();
    for (Object expected : expectedItems) {
      if (!actualItems.hasNext()) {
        fail("iterates through", Arrays.asList(expectedItems));
      } else {
        Object actual = actualItems.next();
        if (actual == expected || actual != null && actual.equals(expected)) {
          continue;
        } else {
          fail("iterates through", Arrays.asList(expectedItems));
        }
      }
>>>>>>> 2bd108d91dc1f0cdda8ef5767b0a10af40af7f57
    }
    if (actualItems.hasNext()) {
      fail("iterates through", Arrays.asList(expectedItems));
Solution content
  }

  /**
   * Attests that the subject contains one or more objects, or fails
   */
  public And isNotEmpty() {
    if (!getSubject().iterator().hasNext()) {
      fail("isEmpty");
    }
    return nextChain();
  }

  /**
   * Asserts that the items are supplied in the order given by the iterable. For
   * Collections and other things which contain items but may not have guaranteed
   * iteration order, this method should be overridden.
   */
  public And iteratesOverSequence(Object... expectedItems) {
    Iterator actualItems = getSubject().iterator();
    for (Object expected : expectedItems) {
      if (!actualItems.hasNext()) {
        fail("iterates through", Arrays.asList(expectedItems));
      } else {
        Object actual = actualItems.next();
        if (actual == expected || actual != null && actual.equals(expected)) {
          continue;
        } else {
          fail("iterates through", Arrays.asList(expectedItems));
        }
      }
    }
    if (actualItems.hasNext()) {
      fail("iterates through", Arrays.asList(expectedItems));
File
IterableSubject.java
Developer's decision
Manual
Kind of conflict
Comment
For statement
If statement
Method declaration
Method invocation
Method signature
Variable
Chunk
Conflicting content
<<<<<<< HEAD
    }
  }

  @Test public void iterablehasContentsAnyOrder() {
    ASSERT.that(iterable(1, 2, 3)).hasContentsAnyOrder(2, 3, 1);
  }

  @Test public void iterablehasContentsAnyOrder_Fail() {
    try {
      ASSERT.that(iterable(1, 2, 3)).hasContentsAnyOrder(2, 3, 4);
      fail("Should have thrown.");
    } catch (AssertionError e) {
      ASSERT.that(e.getMessage()).contains("Not true that");
    }
  }
=======
>>>>>>> 2bd108d91dc1f0cdda8ef5767b0a10af40af7f57

  @Test public void iteratesOverSequence() {
    ASSERT.that(iterable(1, 2, 3)).iteratesOverSequence(1, 2, 3);
Solution content
    }
  }

  @Test public void iteratesOverSequence() {
    ASSERT.that(iterable(1, 2, 3)).iteratesOverSequence(1, 2, 3);
File
IterableTest.java
Developer's decision
Version 2
Kind of conflict
Method declaration