Determines whether two iterables contain equal elements in the same order. More specifically, this method returns true if iterable1 and iterable2 contain the same number of elements and every element of iterable1 is equal to the corresponding element of {@code iterabl
(Iterable<?> iterable1, Iterable<?> iterable2)
| 274 | |
| 275 | |
| 276 | public static boolean elementsEqual(Iterable<?> iterable1, Iterable<?> iterable2) { |
| 277 | if (iterable1 instanceof Collection && iterable2 instanceof Collection) { |
| 278 | Collection<?> collection1 = (Collection<?>) iterable1; |
| 279 | Collection<?> collection2 = (Collection<?>) iterable2; |
| 280 | if (collection1.size() != collection2.size()) { |
| 281 | return false; |
| 282 | } |
| 283 | } |
| 284 | return Iterators.elementsEqual(iterable1.iterator(), iterable2.iterator()); |
| 285 | } |
| 286 | |
| 287 | /** |
| 288 | * Returns a string representation of {@code iterable}, with the format {@code |
nothing calls this directly
no test coverage detected