docs: public static <T> List<T> iterableToList(Iterable<T> iterable) {
          if (iterable == null) {
              return Collections.emptyList();
          }
          if (iterable instanceof List) {
              return (List<T>) iterable;
          }
          Iterator<T> i = iterable.iterator();
          if (i.hasNext()) {
              List<T> list = new ArrayList<>();
              while (i.hasNext()) {
                  list.add(i.next());
              }
              return list;
          }
          return Collections.emptyList();
      }