@@ -0,0 +1,2283 @@
+/*%0A * Copyright (C) 2014  Ohm Data%0A *%0A *  This program is free software: you can redistribute it and/or modify%0A *  it under the terms of the GNU Affero General Public License as%0A *  published by the Free Software Foundation, either version 3 of the%0A *  License, or (at your option) any later version.%0A *%0A *  This program is distributed in the hope that it will be useful,%0A *  but WITHOUT ANY WARRANTY; without even the implied warranty of%0A *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A *  GNU Affero General Public License for more details.%0A *%0A *  You should have received a copy of the GNU Affero General Public License%0A *  along with this program.  If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A */%0A%0Apackage c5db.interfaces.log;%0A%0Aimport org.hamcrest.Description;%0Aimport org.hamcrest.TypeSafeMatcher;%0A%0Aimport java.util.List;%0A%0Aimport static c5db.interfaces.log.SequentialEntryIterable.SequentialEntryIterator;%0A%0Apublic class SequentialEntryIterableMatchers %7B%0A  public static %3CE extends SequentialEntry%3E TypeSafeMatcher%3CSequentialEntryIterator%3CE%3E%3E%0A  isIteratorContainingInOrder(List%3CE%3E entries) %7B%0A%0A    return new TypeSafeMatcher%3CSequentialEntryIterator%3CE%3E%3E() %7B%0A      private Exception exception;%0A%0A      @Override%0A      protected boolean matchesSafely(SequentialEntryIterator%3CE%3E iterator) %7B%0A        int listIndex = 0;%0A%0A        try %7B%0A          while (iterator.hasNext()) %7B%0A            E next = iterator.next();%0A            if (listIndex %3E= entries.size()%0A                %7C%7C !next.equals(entries.get(listIndex))) %7B%0A              return false;%0A            %7D%0A%0A            listIndex++;%0A          %7D%0A        %7D catch (Exception e) %7B%0A          exception = e;%0A          return false;%0A        %7D%0A%0A        return listIndex == entries.size();%0A      %7D%0A%0A      @Override%0A      public void describeTo(Description description) %7B%0A        description.appendText(%22 a SequentialEntryIterator containing, in order, %22)%0A            .appendValue(entries);%0A      %7D%0A%0A      @Override%0A      protected void describeMismatchSafely(SequentialEntryIterator%3CE%3E item, Description mismatchDescription) %7B%0A        if (exception != null) %7B%0A          mismatchDescription.appendValue(exception);%0A        %7D else %7B%0A          super.describeMismatchSafely(item, mismatchDescription);%0A        %7D%0A      %7D%0A    %7D;%0A  %7D%0A%7D%0A

Add a matcher class for SequentialEntryIterable and its iterator