// Path: src/main/java/com/pugnascotia/reactdemo/utils/Streams.java
// public static <T> Stream<T> asStream(Iterable<T> iterable) {
// 	return asStream(iterable, false);
// }


import java.util.List;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static com.pugnascotia.reactdemo.utils.Streams.asStream;
package com.pugnascotia.reactdemo.utils;



/**
 * Utility methods for making it easier to map over a Java list.
 */
public final class Functions {

	public static <T,V> List<V> map(final List<T> in, final Function<T, V> function) {
		return in == null ? null : map(in.stream(), function);
	}

	public static <T,V> List<V> map(final Stream<T> in, final Function<T, V> function) {
		return in == null ? null : in
			.map(function)
			.collect(Collectors.toList());
	}

	public static <T,V> List<V> map(final Iterable<T> in, final Function<T, V> function) {
// Path: src/main/java/com/pugnascotia/reactdemo/utils/Streams.java
// public static <T> Stream<T> asStream(Iterable<T> iterable) {
// 	return asStream(iterable, false);
// }


// Path: src/main/java/com/pugnascotia/reactdemo/utils/Functions.java
import java.util.List;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static com.pugnascotia.reactdemo.utils.Streams.asStream;

package com.pugnascotia.reactdemo.utils;



/**
 * Utility methods for making it easier to map over a Java list.
 */
public final class Functions {

	public static <T,V> List<V> map(final List<T> in, final Function<T, V> function) {
		return in == null ? null : map(in.stream(), function);
	}

	public static <T,V> List<V> map(final Stream<T> in, final Function<T, V> function) {
		return in == null ? null : in
			.map(function)
			.collect(Collectors.toList());
	}

	public static <T,V> List<V> map(final Iterable<T> in, final Function<T, V> function) {
		return map(asStream(in), function);