private static <T> List<T> createSafeList(Iterable<T> iterable) {
    List<T> list = StreamSupport.stream(iterable.spliterator(), false)
        .map(element -> Objects.requireNonNull(element, "element"))
        .collect(Collectors.toList());

    return Collections.unmodifiableList(list);
  }
private static <T> List<T> createSafeList(Iterable<T> iterable) {
    List<T> list = StreamSupport.stream(iterable.spliterator(), false)
        .map(element -> Objects.requireNonNull(element, "element"))
        .collect(Collectors.toList());

    return Collections.unmodifiableList(list);
  }
private static < T > List < T > createSafeList ( Iterable < T > iterable ) { List < T > list = StreamSupport . stream ( iterable . spliterator ( ) , false ) . map ( element -> Objects . requireNonNull ( element , "element" ) ) . collect ( Collectors . toList ( ) ) ; return Collections . unmodifiableList ( list ) ; }
}
}