@SuppressWarnings("unchecked")
    public static <E> ArrayList<E> newArrayList(final Iterable<? extends E> elements) {
        Requires.requireNonNull(elements, "elements");
        return elements instanceof Collection ? new ArrayList((Collection<E>) elements) : newArrayList(elements
            .iterator());
    }
Creates a mutable {@code ArrayList} instance containing the given elements.
jraft-rheakv/rheakv-core/src/main/java/com/alipay/sofa/jraft/rhea/util/Lists.java