Emulation of java.util.function
Change-Id: I8f2cfde31da7ca2fd6dfa1807b2024b53934210f
diff --git a/user/super/com/google/gwt/emul/java/util/function/BiConsumer.java b/user/super/com/google/gwt/emul/java/util/function/BiConsumer.java
new file mode 100644
index 0000000..90b0cc7
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/BiConsumer.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+import static javaemul.internal.InternalPreconditions.checkCriticalNotNull;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/BiConsumer.html">
+ * the official Java API doc</a> for details.
+ *
+ * @param <T> type of the first argument
+ * @param <U> type of the second argument
+ */
+@FunctionalInterface
+public interface BiConsumer<T, U> {
+
+ void accept(T t, U u);
+
+ default BiConsumer<T, U> andThen(BiConsumer<? super T, ? super U> after) {
+ checkCriticalNotNull(after);
+ return (t, u) -> {
+ accept(t, u);
+ after.accept(t, u);
+ };
+ }
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/BiFunction.java b/user/super/com/google/gwt/emul/java/util/function/BiFunction.java
new file mode 100644
index 0000000..7c317a9
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/BiFunction.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+import static javaemul.internal.InternalPreconditions.checkCriticalNotNull;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/BiFunction.html">
+ * the official Java API doc</a> for details.
+ *
+ * @param <T> type of the first argument
+ * @param <U> type of the second argument
+ * @param <R> type of the return value
+ */
+@FunctionalInterface
+public interface BiFunction<T, U, R> {
+
+ R apply(T t, U u);
+
+ default <V> BiFunction<T, U, V> andThen(Function<? super R, ? extends V> after) {
+ checkCriticalNotNull(after);
+ return (t, u) -> after.apply(apply(t, u));
+ }
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/BiPredicate.java b/user/super/com/google/gwt/emul/java/util/function/BiPredicate.java
new file mode 100644
index 0000000..17267ee
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/BiPredicate.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+import static javaemul.internal.InternalPreconditions.checkCriticalNotNull;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/BiPredicate.html">
+ * the official Java API doc</a> for details.
+ *
+ * @param <T> type of the first argument
+ * @param <U> type of the second argument
+ */
+@FunctionalInterface
+public interface BiPredicate<T, U> {
+
+ boolean test(T t, U u);
+
+ default BiPredicate<T, U> negate() {
+ return (t, u) -> !test(t, u);
+ }
+
+ default BiPredicate<T, U> and(BiPredicate<? super T, ? super U> other) {
+ checkCriticalNotNull(other);
+ return (t, u) -> test(t, u) && other.test(t, u);
+ }
+
+ default BiPredicate<T, U> or(BiPredicate<? super T, ? super U> other) {
+ checkCriticalNotNull(other);
+ return (t, u) -> test(t, u) || other.test(t, u);
+ }
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/BinaryOperator.java b/user/super/com/google/gwt/emul/java/util/function/BinaryOperator.java
new file mode 100644
index 0000000..caf01d2
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/BinaryOperator.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+import java.util.Comparator;
+
+import static javaemul.internal.InternalPreconditions.checkCriticalNotNull;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/BinaryOperator.html">
+ * the official Java API doc</a> for details.
+ *
+ * @param <T> type of both operands and the result
+ */
+@FunctionalInterface
+public interface BinaryOperator<T> extends BiFunction<T, T, T> {
+
+ static <T> BinaryOperator<T> maxBy(Comparator<? super T> comparator) {
+ checkCriticalNotNull(comparator);
+ return (t, u) -> comparator.compare(t, u) <= 0 ? u : t;
+ }
+
+ static <T> BinaryOperator<T> minBy(Comparator<? super T> comparator) {
+ checkCriticalNotNull(comparator);
+ return (t, u) -> comparator.compare(t, u) <= 0 ? t : u;
+ }
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/BooleanSupplier.java b/user/super/com/google/gwt/emul/java/util/function/BooleanSupplier.java
new file mode 100644
index 0000000..f350046
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/BooleanSupplier.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/BooleanSupplier.html">
+ * the official Java API doc</a> for details.
+ */
+@FunctionalInterface
+public interface BooleanSupplier {
+
+ boolean getAsBoolean();
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/Consumer.java b/user/super/com/google/gwt/emul/java/util/function/Consumer.java
new file mode 100644
index 0000000..5d78fec
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/Consumer.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+import static javaemul.internal.InternalPreconditions.checkCriticalNotNull;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/Consumer.html">
+ * the official Java API doc</a> for details.
+ *
+ * @param <T> type of the argument
+ */
+@FunctionalInterface
+public interface Consumer<T> {
+
+ void accept(T t);
+
+ default Consumer<T> andThen(Consumer<? super T> after) {
+ checkCriticalNotNull(after);
+ return t -> {
+ accept(t);
+ after.accept(t);
+ };
+ }
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/DoubleBinaryOperator.java b/user/super/com/google/gwt/emul/java/util/function/DoubleBinaryOperator.java
new file mode 100644
index 0000000..99bf566
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/DoubleBinaryOperator.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/DoubleBinaryOperator.html">
+ * the official Java API doc</a> for details.
+ */
+@FunctionalInterface
+public interface DoubleBinaryOperator {
+
+ double applyAsDouble(double left, double right);
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/DoubleConsumer.java b/user/super/com/google/gwt/emul/java/util/function/DoubleConsumer.java
new file mode 100644
index 0000000..677f21e
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/DoubleConsumer.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+import static javaemul.internal.InternalPreconditions.checkCriticalNotNull;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/DoubleConsumer.html">
+ * the official Java API doc</a> for details.
+ */
+@FunctionalInterface
+public interface DoubleConsumer {
+
+ void accept(double value);
+
+ default DoubleConsumer andThen(DoubleConsumer after) {
+ checkCriticalNotNull(after);
+ return value -> {
+ accept(value);
+ after.accept(value);
+ };
+ }
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/DoubleFunction.java b/user/super/com/google/gwt/emul/java/util/function/DoubleFunction.java
new file mode 100644
index 0000000..0edff06
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/DoubleFunction.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/DoubleFunction.html">
+ * the official Java API doc</a> for details.
+ *
+ * @param <R> type of the return value
+ */
+@FunctionalInterface
+public interface DoubleFunction<R> {
+
+ R apply(double value);
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/DoublePredicate.java b/user/super/com/google/gwt/emul/java/util/function/DoublePredicate.java
new file mode 100644
index 0000000..d0c46f4
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/DoublePredicate.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+import static javaemul.internal.InternalPreconditions.checkCriticalNotNull;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/DoublePredicate.html">
+ * the official Java API doc</a> for details.
+ */
+@FunctionalInterface
+public interface DoublePredicate {
+
+ boolean test(double value);
+
+ default DoublePredicate negate() {
+ return value -> !test(value);
+ }
+
+ default DoublePredicate and(DoublePredicate other) {
+ checkCriticalNotNull(other);
+ return value -> test(value) && other.test(value);
+ }
+
+ default DoublePredicate or(DoublePredicate other) {
+ checkCriticalNotNull(other);
+ return value -> test(value) || other.test(value);
+ }
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/DoubleSupplier.java b/user/super/com/google/gwt/emul/java/util/function/DoubleSupplier.java
new file mode 100644
index 0000000..37b1a44
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/DoubleSupplier.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/DoubleSupplier.html">
+ * the official Java API doc</a> for details.
+ */
+@FunctionalInterface
+public interface DoubleSupplier {
+
+ double getAsDouble();
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/DoubleToIntFunction.java b/user/super/com/google/gwt/emul/java/util/function/DoubleToIntFunction.java
new file mode 100644
index 0000000..ef565d9
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/DoubleToIntFunction.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/DoubleToIntFunction.html">
+ * the official Java API doc</a> for details.
+ */
+@FunctionalInterface
+public interface DoubleToIntFunction {
+
+ int applyAsInt(double value);
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/DoubleToLongFunction.java b/user/super/com/google/gwt/emul/java/util/function/DoubleToLongFunction.java
new file mode 100644
index 0000000..f1b1e83
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/DoubleToLongFunction.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/DoubleToLongFunction.html">
+ * the official Java API doc</a> for details.
+ */
+@FunctionalInterface
+public interface DoubleToLongFunction {
+
+ long applyAsLong(double value);
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/DoubleUnaryOperator.java b/user/super/com/google/gwt/emul/java/util/function/DoubleUnaryOperator.java
new file mode 100644
index 0000000..471f8b9
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/DoubleUnaryOperator.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+import static javaemul.internal.InternalPreconditions.checkCriticalNotNull;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/DoubleUnaryOperator.html">
+ * the official Java API doc</a> for details.
+ */
+@FunctionalInterface
+public interface DoubleUnaryOperator {
+
+ static DoubleUnaryOperator identity() {
+ return operand -> operand;
+ }
+
+ double applyAsDouble(double operand);
+
+ default DoubleUnaryOperator andThen(DoubleUnaryOperator after) {
+ checkCriticalNotNull(after);
+ return operand -> after.applyAsDouble(applyAsDouble(operand));
+ }
+
+ default DoubleUnaryOperator compose(DoubleUnaryOperator before) {
+ checkCriticalNotNull(before);
+ return operand -> applyAsDouble(before.applyAsDouble(operand));
+ }
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/Function.java b/user/super/com/google/gwt/emul/java/util/function/Function.java
new file mode 100644
index 0000000..e425c34
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/Function.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+import static javaemul.internal.InternalPreconditions.checkCriticalNotNull;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/Function.html">
+ * the official Java API doc</a> for details.
+ *
+ * @param <T> type of the argument
+ * @param <R> type of the return value
+ */
+@FunctionalInterface
+public interface Function<T, R> {
+
+ static <T> Function<T, T> identity() {
+ return t -> t;
+ }
+
+ R apply(T t);
+
+ default <V> Function<T, V> andThen(Function<? super R, ? extends V> after) {
+ checkCriticalNotNull(after);
+ return t -> after.apply(apply(t));
+ }
+
+ default <V> Function<V, R> compose(Function<? super V, ? extends T> before) {
+ checkCriticalNotNull(before);
+ return t -> apply(before.apply(t));
+ }
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/IntBinaryOperator.java b/user/super/com/google/gwt/emul/java/util/function/IntBinaryOperator.java
new file mode 100644
index 0000000..d5b53e2
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/IntBinaryOperator.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/IntBinaryOperator.html">
+ * the official Java API doc</a> for details.
+ */
+@FunctionalInterface
+public interface IntBinaryOperator {
+
+ int applyAsInt(int left, int right);
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/IntConsumer.java b/user/super/com/google/gwt/emul/java/util/function/IntConsumer.java
new file mode 100644
index 0000000..bd3a0d0
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/IntConsumer.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+import static javaemul.internal.InternalPreconditions.checkCriticalNotNull;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/IntConsumer.html">
+ * the official Java API doc</a> for details.
+ */
+@FunctionalInterface
+public interface IntConsumer {
+
+ void accept(int value);
+
+ default IntConsumer andThen(IntConsumer after) {
+ checkCriticalNotNull(after);
+ return value -> {
+ accept(value);
+ after.accept(value);
+ };
+ }
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/IntFunction.java b/user/super/com/google/gwt/emul/java/util/function/IntFunction.java
new file mode 100644
index 0000000..56691cb
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/IntFunction.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/IntFunction.html">
+ * the official Java API doc</a> for details.
+ *
+ * @param <R> type of the return value
+ */
+@FunctionalInterface
+public interface IntFunction<R> {
+
+ R apply(int value);
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/IntPredicate.java b/user/super/com/google/gwt/emul/java/util/function/IntPredicate.java
new file mode 100644
index 0000000..59b81b7
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/IntPredicate.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+import static javaemul.internal.InternalPreconditions.checkCriticalNotNull;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/IntPredicate.html">
+ * the official Java API doc</a> for details.
+ */
+@FunctionalInterface
+public interface IntPredicate {
+
+ boolean test(int value);
+
+ default IntPredicate negate() {
+ return value -> !test(value);
+ }
+
+ default IntPredicate and(IntPredicate other) {
+ checkCriticalNotNull(other);
+ return value -> test(value) && other.test(value);
+ }
+
+ default IntPredicate or(IntPredicate other) {
+ checkCriticalNotNull(other);
+ return value -> test(value) || other.test(value);
+ }
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/IntSupplier.java b/user/super/com/google/gwt/emul/java/util/function/IntSupplier.java
new file mode 100644
index 0000000..f35af48
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/IntSupplier.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/IntSupplier.html">
+ * the official Java API doc</a> for details.
+ */
+@FunctionalInterface
+public interface IntSupplier {
+
+ int getAsInt();
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/IntToDoubleFunction.java b/user/super/com/google/gwt/emul/java/util/function/IntToDoubleFunction.java
new file mode 100644
index 0000000..6b86f33
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/IntToDoubleFunction.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/IntToDoubleFunction.html">
+ * the official Java API doc</a> for details.
+ */
+@FunctionalInterface
+public interface IntToDoubleFunction {
+
+ double applyAsDouble(int value);
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/IntToLongFunction.java b/user/super/com/google/gwt/emul/java/util/function/IntToLongFunction.java
new file mode 100644
index 0000000..83e751c
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/IntToLongFunction.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/IntToLongFunction.html">
+ * the official Java API doc</a> for details.
+ */
+@FunctionalInterface
+public interface IntToLongFunction {
+
+ long applyAsLong(int value);
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/IntUnaryOperator.java b/user/super/com/google/gwt/emul/java/util/function/IntUnaryOperator.java
new file mode 100644
index 0000000..df9318b
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/IntUnaryOperator.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+import static javaemul.internal.InternalPreconditions.checkCriticalNotNull;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/IntUnaryOperator.html">
+ * the official Java API doc</a> for details.
+ */
+@FunctionalInterface
+public interface IntUnaryOperator {
+
+ static IntUnaryOperator identity() {
+ return operand -> operand;
+ }
+
+ int applyAsInt(int operand);
+
+ default IntUnaryOperator andThen(IntUnaryOperator after) {
+ checkCriticalNotNull(after);
+ return operand -> after.applyAsInt(applyAsInt(operand));
+ }
+
+ default IntUnaryOperator compose(IntUnaryOperator before) {
+ checkCriticalNotNull(before);
+ return operand -> applyAsInt(before.applyAsInt(operand));
+ }
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/LongBinaryOperator.java b/user/super/com/google/gwt/emul/java/util/function/LongBinaryOperator.java
new file mode 100644
index 0000000..c03760f
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/LongBinaryOperator.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/LongBinaryOperator.html">
+ * the official Java API doc</a> for details.
+ */
+@FunctionalInterface
+public interface LongBinaryOperator {
+
+ long applyAsLong(long left, long right);
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/LongConsumer.java b/user/super/com/google/gwt/emul/java/util/function/LongConsumer.java
new file mode 100644
index 0000000..f314a42
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/LongConsumer.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+import static javaemul.internal.InternalPreconditions.checkCriticalNotNull;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/LongConsumer.html">
+ * the official Java API doc</a> for details.
+ */
+@FunctionalInterface
+public interface LongConsumer {
+
+ void accept(long value);
+
+ default LongConsumer andThen(LongConsumer after) {
+ checkCriticalNotNull(after);
+ return value -> {
+ accept(value);
+ after.accept(value);
+ };
+ }
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/LongFunction.java b/user/super/com/google/gwt/emul/java/util/function/LongFunction.java
new file mode 100644
index 0000000..d400c21
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/LongFunction.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/LongFunction.html">
+ * the official Java API doc</a> for details.
+ *
+ * @param <R> type of the return value
+ */
+@FunctionalInterface
+public interface LongFunction<R> {
+
+ R apply(long value);
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/LongPredicate.java b/user/super/com/google/gwt/emul/java/util/function/LongPredicate.java
new file mode 100644
index 0000000..293ea45
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/LongPredicate.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+import static javaemul.internal.InternalPreconditions.checkCriticalNotNull;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/LongPredicate.html">
+ * the official Java API doc</a> for details.
+ */
+@FunctionalInterface
+public interface LongPredicate {
+
+ boolean test(long value);
+
+ default LongPredicate negate() {
+ return value -> !test(value);
+ }
+
+ default LongPredicate and(LongPredicate other) {
+ checkCriticalNotNull(other);
+ return value -> test(value) && other.test(value);
+ }
+
+ default LongPredicate or(LongPredicate other) {
+ checkCriticalNotNull(other);
+ return value -> test(value) || other.test(value);
+ }
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/LongSupplier.java b/user/super/com/google/gwt/emul/java/util/function/LongSupplier.java
new file mode 100644
index 0000000..c02f73a
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/LongSupplier.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/LongSupplier.html">
+ * the official Java API doc</a> for details.
+ */
+@FunctionalInterface
+public interface LongSupplier {
+
+ long getAsLong();
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/LongToDoubleFunction.java b/user/super/com/google/gwt/emul/java/util/function/LongToDoubleFunction.java
new file mode 100644
index 0000000..1184760
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/LongToDoubleFunction.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/LongToDoubleFunction.html">
+ * the official Java API doc</a> for details.
+ */
+@FunctionalInterface
+public interface LongToDoubleFunction {
+
+ double applyAsDouble(long value);
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/LongToIntFunction.java b/user/super/com/google/gwt/emul/java/util/function/LongToIntFunction.java
new file mode 100644
index 0000000..8c43f1d
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/LongToIntFunction.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/LongToIntFunction.html">
+ * the official Java API doc</a> for details.
+ */
+@FunctionalInterface
+public interface LongToIntFunction {
+
+ int applyAsInt(long value);
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/LongUnaryOperator.java b/user/super/com/google/gwt/emul/java/util/function/LongUnaryOperator.java
new file mode 100644
index 0000000..2c0b9c9
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/LongUnaryOperator.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+import static javaemul.internal.InternalPreconditions.checkCriticalNotNull;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/LongUnaryOperator.html">
+ * the official Java API doc</a> for details.
+ */
+@FunctionalInterface
+public interface LongUnaryOperator {
+
+ static LongUnaryOperator identity() {
+ return operand -> operand;
+ }
+
+ long applyAsLong(long operand);
+
+ default LongUnaryOperator andThen(LongUnaryOperator after) {
+ checkCriticalNotNull(after);
+ return operand -> after.applyAsLong(applyAsLong(operand));
+ }
+
+ default LongUnaryOperator compose(LongUnaryOperator before) {
+ checkCriticalNotNull(before);
+ return operand -> applyAsLong(before.applyAsLong(operand));
+ }
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/ObjDoubleConsumer.java b/user/super/com/google/gwt/emul/java/util/function/ObjDoubleConsumer.java
new file mode 100644
index 0000000..a01b482
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/ObjDoubleConsumer.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/ObjDoubleConsumer.html">
+ * the official Java API doc</a> for details.
+ *
+ * @param <T> type of the object argument
+ */
+@FunctionalInterface
+public interface ObjDoubleConsumer<T> {
+
+ void accept(T t, double value);
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/ObjIntConsumer.java b/user/super/com/google/gwt/emul/java/util/function/ObjIntConsumer.java
new file mode 100644
index 0000000..cc0756b
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/ObjIntConsumer.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/ObjIntConsumer.html">
+ * the official Java API doc</a> for details.
+ *
+ * @param <T> type of the object argument
+ */
+@FunctionalInterface
+public interface ObjIntConsumer<T> {
+
+ void accept(T t, int value);
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/ObjLongConsumer.java b/user/super/com/google/gwt/emul/java/util/function/ObjLongConsumer.java
new file mode 100644
index 0000000..d5ef3bb
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/ObjLongConsumer.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/ObjLongConsumer.html">
+ * the official Java API doc</a> for details.
+ *
+ * @param <T> type of the object argument
+ */
+@FunctionalInterface
+public interface ObjLongConsumer<T> {
+
+ void accept(T t, long value);
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/Predicate.java b/user/super/com/google/gwt/emul/java/util/function/Predicate.java
new file mode 100644
index 0000000..6babe4f
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/Predicate.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+import java.util.Objects;
+
+import static javaemul.internal.InternalPreconditions.checkCriticalNotNull;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/Predicate.html">
+ * the official Java API doc</a> for details.
+ *
+ * @param <T> type of the argument
+ */
+@FunctionalInterface
+public interface Predicate<T> {
+
+ static <T> Predicate<T> isEqual(Object targetRef) {
+ return targetRef == null ? Objects::isNull : targetRef::equals;
+ }
+
+ boolean test(T t);
+
+ default Predicate<T> negate() {
+ return t -> !test(t);
+ }
+
+ default Predicate<T> and(Predicate<? super T> other) {
+ checkCriticalNotNull(other);
+ return t -> test(t) && other.test(t);
+ }
+
+ default Predicate<T> or(Predicate<? super T> other) {
+ checkCriticalNotNull(other);
+ return t -> test(t) || other.test(t);
+ }
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/Supplier.java b/user/super/com/google/gwt/emul/java/util/function/Supplier.java
new file mode 100644
index 0000000..57b3ca1
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/Supplier.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/Supplier.html">
+ * the official Java API doc</a> for details.
+ *
+ * @param <T> type of the supplied value
+ */
+@FunctionalInterface
+public interface Supplier<T> {
+
+ T get();
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/ToDoubleBiFunction.java b/user/super/com/google/gwt/emul/java/util/function/ToDoubleBiFunction.java
new file mode 100644
index 0000000..1105b92
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/ToDoubleBiFunction.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/ToDoubleBiFunction.html">
+ * the official Java API doc</a> for details.
+ *
+ * @param <T> type of the first argument
+ * @param <U> type of the second argument
+ */
+@FunctionalInterface
+public interface ToDoubleBiFunction<T, U> {
+
+ double applyAsDouble(T t, U u);
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/ToDoubleFunction.java b/user/super/com/google/gwt/emul/java/util/function/ToDoubleFunction.java
new file mode 100644
index 0000000..617d36f
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/ToDoubleFunction.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/ToDoubleFunction.html">
+ * the official Java API doc</a> for details.
+ *
+ * @param <T> type of the argument
+ */
+@FunctionalInterface
+public interface ToDoubleFunction<T> {
+
+ double applyAsDouble(T value);
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/ToIntBiFunction.java b/user/super/com/google/gwt/emul/java/util/function/ToIntBiFunction.java
new file mode 100644
index 0000000..dfeff27
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/ToIntBiFunction.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/ToIntBiFunction.html">
+ * the official Java API doc</a> for details.
+ *
+ * @param <T> type of the first argument
+ * @param <U> type of the second argument
+ */
+@FunctionalInterface
+public interface ToIntBiFunction<T, U> {
+
+ int applyAsInt(T t, U u);
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/ToIntFunction.java b/user/super/com/google/gwt/emul/java/util/function/ToIntFunction.java
new file mode 100644
index 0000000..23100cf
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/ToIntFunction.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/ToIntFunction.html">
+ * the official Java API doc</a> for details.
+ *
+ * @param <T> type of the argument
+ */
+@FunctionalInterface
+public interface ToIntFunction<T> {
+
+ int applyAsInt(T value);
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/ToLongBiFunction.java b/user/super/com/google/gwt/emul/java/util/function/ToLongBiFunction.java
new file mode 100644
index 0000000..bfe3051
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/ToLongBiFunction.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/ToLongBiFunction.html">
+ * the official Java API doc</a> for details.
+ *
+ * @param <T> type of the first argument
+ * @param <U> type of the second argument
+ */
+@FunctionalInterface
+public interface ToLongBiFunction<T, U> {
+
+ long applyAsLong(T t, U u);
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/ToLongFunction.java b/user/super/com/google/gwt/emul/java/util/function/ToLongFunction.java
new file mode 100644
index 0000000..b1909c6
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/ToLongFunction.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/ToLongFunction.html">
+ * the official Java API doc</a> for details.
+ *
+ * @param <T> type of the argument
+ */
+@FunctionalInterface
+public interface ToLongFunction<T> {
+
+ long applyAsLong(T value);
+}
diff --git a/user/super/com/google/gwt/emul/java/util/function/UnaryOperator.java b/user/super/com/google/gwt/emul/java/util/function/UnaryOperator.java
new file mode 100644
index 0000000..799723f
--- /dev/null
+++ b/user/super/com/google/gwt/emul/java/util/function/UnaryOperator.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package java.util.function;
+
+/**
+ * See <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/UnaryOperator.html">
+ * the official Java API doc</a> for details.
+ *
+ * @param <T> type of both argument and return value
+ */
+@FunctionalInterface
+public interface UnaryOperator<T> extends Function<T, T> {
+
+ static <T> UnaryOperator<T> identity() {
+ return t -> t;
+ }
+}