Class IterableDiff


  • class IterableDiff
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      IterableDiff​(java.lang.Iterable<T> actual, java.lang.Iterable<T> expected, ComparisonStrategy comparisonStrategy)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static <T> IterableDiff diff​(java.lang.Iterable<T> actual, java.lang.Iterable<T> expected, ComparisonStrategy comparisonStrategy)  
      (package private) boolean differencesFound()  
      private boolean iterableContains​(java.lang.Iterable<?> actual, java.lang.Object value)  
      private void iterablesRemoveFirst​(java.lang.Iterable<?> actual, java.lang.Object value)  
      private <T> java.util.List<java.lang.Object> subtract​(java.lang.Iterable<T> first, java.lang.Iterable<T> second)
      Returns the list of elements in the first iterable that are not in the second, i.e.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • unexpected

        java.util.List<java.lang.Object> unexpected
      • missing

        java.util.List<java.lang.Object> missing
    • Constructor Detail

      • IterableDiff

        IterableDiff​(java.lang.Iterable<T> actual,
                     java.lang.Iterable<T> expected,
                     ComparisonStrategy comparisonStrategy)
    • Method Detail

      • differencesFound

        boolean differencesFound()
      • subtract

        private <T> java.util.List<java.lang.Object> subtract​(java.lang.Iterable<T> first,
                                                              java.lang.Iterable<T> second)
        Returns the list of elements in the first iterable that are not in the second, i.e. first - second
        Type Parameters:
        T - the element type
        Parameters:
        first - the list we want to subtract from
        second - the list to subtract
        Returns:
        the list of elements in the first iterable that are not in the second, i.e. first - second
      • iterableContains

        private boolean iterableContains​(java.lang.Iterable<?> actual,
                                         java.lang.Object value)
      • iterablesRemoveFirst

        private void iterablesRemoveFirst​(java.lang.Iterable<?> actual,
                                          java.lang.Object value)