public static <T> List<T> toList(Iterable<? extends T> iterable) {
        List<T> list = new ArrayList<>();
        for (T item : iterable)
            list.add(item);
        return list;
    }
Checks the two iterables for equality by first converting both to a list.
clients/src/test/java/org/apache/kafka/test/TestUtils.java