changeset 6419:a4c10f71e673

More renames: (*)Mapper -> (*)Function.apply (*)Factory -> (*)Supplier.get(*) Moved IntSupplier from java.util.stream.primitive to java.util.function
author mduigou
date Thu, 15 Nov 2012 22:03:04 -0800
parents c5b238ae25fe
children 68a734033306
files makefiles/Setup.gmk src/share/classes/java/lang/ThreadLocal.java src/share/classes/java/util/Comparators.java src/share/classes/java/util/Iterators.java src/share/classes/java/util/Optional.java src/share/classes/java/util/function/BiFunction.java src/share/classes/java/util/function/BiMapper.java src/share/classes/java/util/function/DoubleFunction.java src/share/classes/java/util/function/DoubleMapper.java src/share/classes/java/util/function/Factory.java src/share/classes/java/util/function/Function.java src/share/classes/java/util/function/Functions.java src/share/classes/java/util/function/IntFunction.java src/share/classes/java/util/function/IntMapper.java src/share/classes/java/util/function/IntSupplier.java src/share/classes/java/util/function/LongFunction.java src/share/classes/java/util/function/LongMapper.java src/share/classes/java/util/function/Mapper.java src/share/classes/java/util/function/Mappers.java src/share/classes/java/util/function/Predicates.java src/share/classes/java/util/function/Supplier.java src/share/classes/java/util/logging/Logger.java src/share/classes/java/util/stream/ReferencePipeline.java src/share/classes/java/util/stream/Stream.java src/share/classes/java/util/stream/Streams.java src/share/classes/java/util/stream/op/FoldOp.java src/share/classes/java/util/stream/op/GroupByOp.java src/share/classes/java/util/stream/op/MapOp.java src/share/classes/java/util/stream/op/MatchOp.java src/share/classes/java/util/stream/op/OpUtils.java src/share/classes/java/util/stream/op/ReduceByOp.java src/share/classes/java/util/stream/primitive/IntFactory.java src/share/classes/java/util/stream/primitive/Primitives.java src/share/classes/java/util/stream/primitive/RefToIntMapOp.java test-ng/tests/org/openjdk/tests/java/lang/ThreadLocalFactoryTest.java test-ng/tests/org/openjdk/tests/java/lang/ThreadLocalSupplierTest.java test-ng/tests/org/openjdk/tests/java/lang/ThreadLocalTest.java test-ng/tests/org/openjdk/tests/java/util/ComparatorsTest.java test-ng/tests/org/openjdk/tests/java/util/LambdaTestHelpers.java test-ng/tests/org/openjdk/tests/java/util/functions/FunctionsTest.java test-ng/tests/org/openjdk/tests/java/util/functions/MappersTest.java test-ng/tests/org/openjdk/tests/java/util/streams/OpTestCase.java test-ng/tests/org/openjdk/tests/java/util/streams/StreamIntermediateOpTestScenario.java test-ng/tests/org/openjdk/tests/java/util/streams/ops/FlagOpTest.java test-ng/tests/org/openjdk/tests/java/util/streams/ops/GroupByOpTest.java test-ng/tests/org/openjdk/tests/java/util/streams/ops/IntNodeTest.java test-ng/tests/org/openjdk/tests/java/util/streams/ops/NodeBuilderTest.java test-ng/tests/org/openjdk/tests/java/util/streams/ops/NodeTest.java test-ng/tests/org/openjdk/tests/java/util/streams/ops/ReduceByOpTest.java test-ng/tests/org/openjdk/tests/java/util/streams/ops/SliceOpTest.java test-ng/tests/org/openjdk/tests/java/util/streams/primitives/IntStreamIntermediateOpTestScenario.java test-ng/tests/org/openjdk/tests/javac/LambdaTranslationTest2.java test-ng/tests/org/openjdk/tests/javac/MethodReferenceTestInstanceMethod.java
diffstat 53 files changed, 1232 insertions(+), 1231 deletions(-) [+]
line wrap: on
line diff
--- a/makefiles/Setup.gmk	Thu Nov 15 19:11:58 2012 -0800
+++ b/makefiles/Setup.gmk	Thu Nov 15 22:03:04 2012 -0800
@@ -27,7 +27,7 @@
 JAVAH_JARS ?= "-Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javah.jar" -jar $(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javah.jar
 JAVADOC_JARS ?= "-Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javadoc.jar" -jar $(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javadoc.jar
 
-DISABLE_WARNINGS:=-Xlint:all,-deprecation,-unchecked,-rawtypes,-cast,-serial,-dep-ann,-static,-fallthrough,-try,-varargs,-empty,-finally
+DISABLE_WARNINGS:=-Xlint:all,-deprecation,-unchecked,-rawtypes,-cast,-serial,-dep-ann,-static,-fallthrough,-try,-varargs,-empty,-finally,-auxiliaryclass
 
 # The generate old bytecode javac setup uses the new compiler to compile for the
 # boot jdk to generate tools that need to be run with the boot jdk.
--- a/src/share/classes/java/lang/ThreadLocal.java	Thu Nov 15 19:11:58 2012 -0800
+++ b/src/share/classes/java/lang/ThreadLocal.java	Thu Nov 15 22:03:04 2012 -0800
@@ -27,7 +27,7 @@
 import java.lang.ref.*;
 import java.util.Objects;
 import java.util.concurrent.atomic.AtomicInteger;
-import java.util.function.Factory;
+import java.util.function.Supplier;
 
 /**
  * This class provides thread-local variables.  These variables differ from
@@ -69,7 +69,7 @@
  * references to these copies exist).
  *
  * The initial value of the variable is set by (1) calling the
- * {@code initialValue method}, (2) obtaining it from  a {@code Factory<T>}
+ * {@code initialValue method}, (2) obtaining it from  a {@code Supplier<T>}
  * which has been provided via the
  * constructor, or (3) by calling the {@code set} method.
  *
@@ -110,7 +110,7 @@
     /**
      * Supplied by the invoker of the constructor to set the initial value
      */
-    private final Factory<T> factory;
+    private final Supplier<T> factory;
 
     /**
      * Returns the next hash code.
@@ -121,8 +121,8 @@
 
     /**
      * Returns the current thread's "initial value" for this
-     * thread-local variable unless a @{code Factory<T}} has been passed
-     * to the constructor, in which case the Factory is consulted in
+     * thread-local variable unless a @{code Supplier<T}} has been passed
+     * to the constructor, in which case the Supplier is consulted in
      * preference to this method.  This method will be invoked the first
      * time a thread accesses the variable with the {@link #get}
      * method, unless the thread previously invoked the {@link #set}
@@ -149,11 +149,11 @@
     /**
      * Creates a thread local variable using the supplied factory. When
      * this constructor is used, the initial value is determined by
-     * invoking the @{code make} method on the factory.
+     * invoking the @{code get} method on the factory.
      *
      * @param factory the factory to be used to determine the initial value
      */
-    public ThreadLocal( Factory<T> factory ) {
+    public ThreadLocal( Supplier<T> factory ) {
         Objects.requireNonNull( factory );
         this.factory = factory;
     }
@@ -187,7 +187,7 @@
      * @return the initial value
      */
     private T setInitialValue() {
-        T value = (factory != null ? factory.make() : initialValue());
+        T value = (factory != null ? factory.get() : initialValue());
         Thread t = Thread.currentThread();
         ThreadLocalMap map = getMap(t);
         if (map != null)
@@ -255,7 +255,7 @@
     }
 
     /**
-     * Factory method to create map of inherited thread locals.
+     * Supplier method to create map of inherited thread locals.
      * Designed to be called only from Thread constructor.
      *
      * @param  parentMap the map associated with parent thread
--- a/src/share/classes/java/util/Comparators.java	Thu Nov 15 19:11:58 2012 -0800
+++ b/src/share/classes/java/util/Comparators.java	Thu Nov 15 22:03:04 2012 -0800
@@ -25,10 +25,10 @@
 package java.util;
 
 import java.io.Serializable;
-import java.util.function.DoubleMapper;
-import java.util.function.IntMapper;
-import java.util.function.LongMapper;
-import java.util.function.Mapper;
+import java.util.function.DoubleFunction;
+import java.util.function.IntFunction;
+import java.util.function.LongFunction;
+import java.util.function.Function;
 
 /**
  * This class consists of {@code static} utility methods for comparators. Mostly
@@ -171,10 +171,10 @@
      * @param <U> the Comparable type for comparison
      * @param mapper the function used to extract the Comparable sort key
      */
-    public static <T, U extends Comparable<? super U>> Comparator<T> comparing(Mapper<? extends U, ? super T> mapper) {
+    public static <T, U extends Comparable<? super U>> Comparator<T> comparing(Function<? extends U, ? super T> mapper) {
         Objects.requireNonNull(mapper);
         return (Comparator<T> & Serializable)
-            (c1, c2) -> mapper.map(c1).compareTo(mapper.map(c2));
+            (c1, c2) -> mapper.apply(c1).compareTo(mapper.apply(c2));
     }
 
     /**
@@ -188,10 +188,10 @@
      * @param <T> the original element type
      * @param mapper the function used to extract the integer value
      */
-    public static <T> Comparator<T> comparing(IntMapper<? super T> mapper) {
+    public static <T> Comparator<T> comparing(IntFunction<? super T> mapper) {
         Objects.requireNonNull(mapper);
         return (Comparator<T> & Serializable)
-            (c1, c2) -> Integer.compare(mapper.map(c1), mapper.map(c2));
+            (c1, c2) -> Integer.compare(mapper.apply(c1), mapper.apply(c2));
     }
 
     /**
@@ -205,10 +205,10 @@
      * @param <T> the original element type
      * @param mapper the function used to extract the long value
      */
-    public static <T> Comparator<T> comparing(LongMapper<? super T> mapper) {
+    public static <T> Comparator<T> comparing(LongFunction<? super T> mapper) {
         Objects.requireNonNull(mapper);
         return (Comparator<T> & Serializable)
-            (c1, c2) -> Long.compare(mapper.map(c1), mapper.map(c2));
+            (c1, c2) -> Long.compare(mapper.apply(c1), mapper.apply(c2));
     }
 
     /**
@@ -222,10 +222,10 @@
      * @param <T> the original element type
      * @param mapper the function used to extract the double value
      */
-    public static<T> Comparator<T> comparing(DoubleMapper<? super T> mapper) {
+    public static<T> Comparator<T> comparing(DoubleFunction<? super T> mapper) {
         Objects.requireNonNull(mapper);
         return (Comparator<T> & Serializable)
-            (c1, c2) -> Double.compare(mapper.map(c1), mapper.map(c2));
+            (c1, c2) -> Double.compare(mapper.apply(c1), mapper.apply(c2));
     }
 
     /**
--- a/src/share/classes/java/util/Iterators.java	Thu Nov 15 19:11:58 2012 -0800
+++ b/src/share/classes/java/util/Iterators.java	Thu Nov 15 22:03:04 2012 -0800
@@ -25,7 +25,7 @@
 package java.util;
 
 import java.util.function.Predicate;
-import java.util.function.Mapper;
+import java.util.function.Function;
 
 /**
  * Utilities for Iterators.  All of these methods consume elements from the iterators passed to them!
@@ -121,7 +121,7 @@
         };
     }
 
-    public static<T, R> Iterator<R> map(final Iterator<? extends T> source, final Mapper<? extends R, ? super T> mapper) {
+    public static<T, R> Iterator<R> map(final Iterator<? extends T> source, final Function<? extends R, ? super T> mapper) {
         Objects.requireNonNull(source);
         Objects.requireNonNull(mapper);
         return new Iterator<R>() {
@@ -132,7 +132,7 @@
 
             @Override
             public R next() {
-                return mapper.map(source.next());
+                return mapper.apply(source.next());
             }
         };
     }
--- a/src/share/classes/java/util/Optional.java	Thu Nov 15 19:11:58 2012 -0800
+++ b/src/share/classes/java/util/Optional.java	Thu Nov 15 22:03:04 2012 -0800
@@ -25,7 +25,7 @@
 package java.util;
 
 import java.util.function.Block;
-import java.util.function.Factory;
+import java.util.function.Supplier;
 
 /**
  * A return object which may or may not contain a non-null value. If a value is present
@@ -121,11 +121,11 @@
     /**
      * Return the value if present otherwise return result of {@code other}.
      *
-     * @param other Factory who's result is returned if there is no value present.
+     * @param other Supplier who's result is returned if there is no value present.
      * @return the value if present otherwise return result of {@code other}.
      */
-    public T orElse(Factory<T> other) {
-        return value != null ? value : other.make();
+    public T orElse(Supplier<T> other) {
+        return value != null ? value : other.get();
     }
 
     /**
@@ -138,11 +138,11 @@
      * @return the value.
      * @throws V if there is no value present.
      */
-    public<V extends Throwable> T orElseThrow(Factory<V> exceptionFactory) throws V {
+    public<V extends Throwable> T orElseThrow(Supplier<V> exceptionFactory) throws V {
         if (value != null) {
             return value;
         } else {
-            throw exceptionFactory.make();
+            throw exceptionFactory.get();
         }
     }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/util/function/BiFunction.java	Thu Nov 15 22:03:04 2012 -0800
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package java.util.function;
+
+/**
+ * Given input objects maps to an appropriate output object. A mapper may
+ * variously provide a mapping between types, object instances or keys and
+ * values or any other form of transformation upon the input.
+ *
+ * <p/>All mapper implementations are expected to:
+ * <ul>
+ *  <li>Provide stable results such that for any {@code t} the result of two
+ * {@code map} operations are always equivalent. ie.<pre>
+ * Foo one = mapper.map(a);
+ * Foo two = mapper.map(a);
+ *
+ * assert one.equals(two) && two.equals(one);
+ * </pre></li>
+ * <li>Equivalent input objects should map to equivalent output objects. ie.<pre>
+ * assert a.equals(b);  // a and b are equivalent
+ *
+ * Foo x = mapper.map(a);
+ * Foo y = mapper.map(b);
+ *
+ * assert x.equals(y); // their mapped results should be as equivalent.
+ * </pre></li>
+ * <li>The mapper should not modify the input object in any way that would
+ * change the mapping.</li>
+ * <li>When used for aggregate operations upon many elements mappers
+ * should not assume that the {@code map} operation will be called upon elements
+ * in any specific order.</li>
+ * </ul>
+ *
+ * @param <R> the type of output objects from {@code map} operation. May be the
+ * @param <T> the type of input objects provided to the {@code map} operation.
+ * @param <U> the type of input objects provided to the {@code map} operation.
+ * same type as either {@code <T>} or {@code <U>}.
+ */
+public interface BiFunction<R, T, U> {
+
+    /**
+     * Map the provided input objects to an appropriate output object.
+     *
+     * @param t an object to be mapped.
+     * @param u another object to be mapped.
+     * @return the mapped output object.
+     */
+    R map(T t, U u);
+
+    /**
+     * Combine with another function producing a function which preforms both
+     * operations.
+     *
+     * @param <W> Type of output objects from the combined function. May be the
+     * same type as {@code <U>}.
+     * @param after An additional function to be applied to the result of this
+     * function.
+     * @return A function which performs both the original function followed by
+     * a second function.
+     */
+    public default <W> BiFunction<W, T, U> compose(Function<? extends W, ? super R> after) {
+        throw new UnsupportedOperationException("Not yet implemented.");
+    }
+}
--- a/src/share/classes/java/util/function/BiMapper.java	Thu Nov 15 19:11:58 2012 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package java.util.function;
-
-/**
- * Given input objects maps to an appropriate output object. A mapper may
- * variously provide a mapping between types, object instances or keys and
- * values or any other form of transformation upon the input.
- *
- * <p/>All mapper implementations are expected to:
- * <ul>
- *  <li>Provide stable results such that for any {@code t} the result of two
- * {@code map} operations are always equivalent. ie.<pre>
- * Foo one = mapper.map(a);
- * Foo two = mapper.map(a);
- *
- * assert one.equals(two) && two.equals(one);
- * </pre></li>
- * <li>Equivalent input objects should map to equivalent output objects. ie.<pre>
- * assert a.equals(b);  // a and b are equivalent
- *
- * Foo x = mapper.map(a);
- * Foo y = mapper.map(b);
- *
- * assert x.equals(y); // their mapped results should be as equivalent.
- * </pre></li>
- * <li>The mapper should not modify the input object in any way that would
- * change the mapping.</li>
- * <li>When used for aggregate operations upon many elements mappers
- * should not assume that the {@code map} operation will be called upon elements
- * in any specific order.</li>
- * </ul>
- *
- * @param <R> the type of output objects from {@code map} operation. May be the
- * @param <T> the type of input objects provided to the {@code map} operation.
- * @param <U> the type of input objects provided to the {@code map} operation.
- * same type as either {@code <T>} or {@code <U>}.
- */
-public interface BiMapper<R, T, U> {
-
-    /**
-     * Map the provided input objects to an appropriate output object.
-     *
-     * @param t an object to be mapped.
-     * @param u another object to be mapped.
-     * @return the mapped output object.
-     */
-    R map(T t, U u);
-
-    /**
-     * Combine with another mapper producing a mapper which preforms both
-     * mappings.
-     *
-     * @param <W> Type of output objects from the combined mapper. May be the
-     * same type as {@code <U>}.
-     * @param after An additional mapping to be applied to the result of this
-     * mapping.
-     * @return A mapper which performs both the original mapping followed by
-     * a second mapping.
-     */
-    public default <W> BiMapper<W, T, U> compose(Mapper<? extends W, ? super R> after) {
-        throw new UnsupportedOperationException("Not yet implemented.");
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/util/function/DoubleFunction.java	Thu Nov 15 22:03:04 2012 -0800
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package java.util.function;
+
+/**
+ * Given an input object maps to an appropriate double value; this is the
+ * double-bearing specialization for {@link java.util.function.Mapper}.
+ *
+ * <p/>Like Mapper, DoubleFunction implementations are expected to:
+ * <ul>
+ *  <li>Provide stable results such that for any {@code t} the result of two
+ * {@code apply} operations are always equivalent. ie.<pre>
+ * double one = mapper.apply(a);
+ * double two = mapper.apply(a);
+ *
+ * assert one == two;
+ * </pre></li>
+ * <li>Equivalent input objects should apply to equivalent output objects. ie.<pre>
+ * assert a.equals(b);  // a and b are equivalent
+ *
+ * double x = mapper.apply(a);
+ * double y = mapper.apply(b);
+ *
+ * assert x == y;       // their mapped results should be as equivalent.
+ * </pre></li>
+ * <li>The mapper should not modify the input object in any way that would
+ * change the mapping.</li>
+ * <li>When used for aggregate operations upon many elements mappers
+ * should not assume that the {@code apply} operation will be called upon elements
+ * in any specific order.</li>
+ * </ul>
+ *
+ * @param <T> the type of input objects provided to the {@code apply} operation.
+ */
+public interface DoubleFunction<T> {
+
+    /**
+     * Map the provided input object to an appropriate output object.
+     *
+     * @param t the input object to be mapped.
+     * @return the mapped output value.
+     */
+    double apply(T t);
+}
--- a/src/share/classes/java/util/function/DoubleMapper.java	Thu Nov 15 19:11:58 2012 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package java.util.function;
-
-/**
- * Given an input object maps to an appropriate double value; this is the
- * double-bearing specialization for {@link java.util.function.Mapper}.
- *
- * <p/>Like Mapper, DoubleMapper implementations are expected to:
- * <ul>
- *  <li>Provide stable results such that for any {@code t} the result of two
- * {@code map} operations are always equivalent. ie.<pre>
- * double one = mapper.map(a);
- * double two = mapper.map(a);
- *
- * assert one == two;
- * </pre></li>
- * <li>Equivalent input objects should map to equivalent output objects. ie.<pre>
- * assert a.equals(b);  // a and b are equivalent
- *
- * double x = mapper.map(a);
- * double y = mapper.map(b);
- *
- * assert x == y;       // their mapped results should be as equivalent.
- * </pre></li>
- * <li>The mapper should not modify the input object in any way that would
- * change the mapping.</li>
- * <li>When used for aggregate operations upon many elements mappers
- * should not assume that the {@code map} operation will be called upon elements
- * in any specific order.</li>
- * </ul>
- *
- * @param <T> the type of input objects provided to the {@code map} operation.
- */
-public interface DoubleMapper<T> {
-
-    /**
-     * Map the provided input object to an appropriate output object.
-     *
-     * @param t the input object to be mapped.
-     * @return the mapped output value.
-     */
-    double map(T t);
-}
--- a/src/share/classes/java/util/function/Factory.java	Thu Nov 15 19:11:58 2012 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package java.util.function;
-
-/**
- * aka Source and Producer
- *
- * <p>All Factory implementations are expected to:
- * <ul>
- * <li></li>
- * </ul>
- *
- * @param <T> The type of objects returned by {@code create}.
- */
-public interface Factory<T> {
-
-    /**
-     * Returns an object.
-     *
-     * @return an object.
-     */
-    T make();
-
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/util/function/Function.java	Thu Nov 15 22:03:04 2012 -0800
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package java.util.function;
+
+/**
+ * Given an input object maps to an appropriate output object. A mapper may
+ * variously provide a mapping between types, object instances or keys and
+ * values or any other form of transformation upon the input.
+ *
+ * <p/>All mapper implementations are expected to:
+ * <ul>
+ *  <li>Provide stable results such that for any {@code t} the result of two
+ * {@code apply} operations are always equivalent. ie.<pre>
+ * Foo one = mapper.apply(a);
+ * Foo two = mapper.apply(a);
+ *
+ * assert one.equals(two) && two.equals(one);
+ * </pre></li>
+ * <li>Equivalent input objects should apply to equivalent output objects. ie.<pre>
+ * assert a.equals(b);  // a and b are equivalent
+ *
+ * Foo x = mapper.apply(a);
+ * Foo y = mapper.apply(b);
+ *
+ * assert x.equals(y); // their mapped results should be as equivalent.
+ * </pre></li>
+ * <li>The mapper should not modify the input object in any way that would
+ * change the mapping.</li>
+ * <li>When used for aggregate operations upon many elements mappers
+ * should not assume that the {@code apply} operation will be called upon elements
+ * in any specific order.</li>
+ * </ul>
+ *
+ * @param <R> the type of output objects from {@code apply} operation. May be the
+ * @param <T> the type of input objects provided to the {@code apply} operation.
+ * same type as {@code <T>}.
+ */
+public interface Function<R, T> {
+
+    /**
+     * Map the provided input object to an appropriate output object.
+     *
+     * @param t the input object to be mapped.
+     * @return the mapped output object.
+     */
+    R apply(T t);
+
+    /**
+     * Combine with another mapper producing a mapper which preforms both
+     * mappings.
+     *
+     * @param <V> Type of output objects from the combined mapper. May be the
+     * same type as {@code <U>}.
+     * @param after An additional mapping to be applied to the result of this
+     * mapping.
+     * @return A mapper which performs both the original mapping followed by
+     * a second mapping.
+     */
+    public default <V> Function<V, T> compose(Function<? extends V, ? super R> after) {
+        return Functions.chain(this, after);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/util/function/Functions.java	Thu Nov 15 22:03:04 2012 -0800
@@ -0,0 +1,235 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package java.util.function;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.UndeclaredThrowableException;
+import java.util.Map;
+import java.util.Objects;
+
+/**
+ * Static utility methods pertaining to {@code Mapper} instances.
+ *
+ * <p>All of the returned mappers are serializable if provided serializable
+ * parameters.
+ */
+public final class Functions {
+
+    /**
+     * A mapper which who's {@code apply} method returns the provided
+     * input.
+     */
+    private static final Function<Object, Object> IDENTITY = t -> t;
+
+    /**
+     * A mapper which performs a mapping from an object to it's
+     * string representation.
+     */
+    private static final Function<String, Object> STRING = String::valueOf;
+
+    /**
+     * singleton utils
+     */
+    private Functions() {
+        throw new AssertionError("No instances!");
+    }
+
+     /**
+     * Returns a mapper which who's {@code apply} method returns the provided
+     * input. Useful when a Mapper is required and {@code <T>} and {@code <U>}
+     * are the same type.
+     */
+    public static <T> Function<T, T> identity() {
+        return (Function<T, T>) IDENTITY;
+    }
+
+//    /**
+//     * Returns a mapper which who's {@code apply} method returns a clone of the
+//     * provided input.
+//     */
+//    public static <T> Mapper<T, T> cloneOf() {
+//        return t -> {
+//            try {
+//                return t.clone();
+//            } catch (CloneNotSupportedException ex) {
+//                throw new UndeclaredThrowableException(ex);
+//            }
+//        };
+//    }
+//
+    /**
+     * Returns a mapper which performs a mapping from {@code <T>} to it's
+     * string representation.
+     *
+     * @param <T> Type of input values
+     * @return a mapper which performs a mapping from {@code <T>} to it's
+     * string representation
+     */
+    public static <T> Function<String, T> string() {
+        return (Function<String, T>) STRING;
+    }
+
+    /**
+     * Returns a mapper which performs a mapping from {@code <T>} to {@code <U>}
+     * followed by a mapping from {@code <U>} to {@code <V>}.
+     *
+     * @param <R> Type for final mapped values. May be the same type as
+     * {@code <U>}.
+     * @param <T> Type for input values
+     * @param <U> Type for intermediate mapped values. May be the same type as
+     * {@code <T>}.
+     * @param first Initial mapping from {@code <T>} to {@code <U>}.
+     * @param second additional mapping from {@code <U>} to {@code <V>}.
+     */
+    public static <R, T, U> Function<R, T> chain(
+            Function<? extends U, ? super T> first,
+            Function<? extends R, ? super U> second) {
+        Objects.requireNonNull(first);
+        Objects.requireNonNull(second);
+
+        return t -> second.apply(first.apply(t));
+    }
+
+    /**
+     * Returns a constant output regardless of input.
+     *
+     * @param constant The value to be returned by the {@code apply} method.
+     * @return a mapper who's {@code apply} method provides a constant result.
+     */
+    public static <R, T> Function<R, T> constant(R constant) {
+        return t -> constant;
+    }
+
+    /**
+     * A mapper that substitutes a single input value with a specified
+     * replacement. Input values are compared using {@code equals()}.
+     *
+     * @param <T> The type of values.
+     * @param subOut The input value to be substituted out.
+     * @param subIn The replacement value for matching inputs.
+     * @return a mapper that substitutes a single input value with a specified
+     * replacement.
+     */
+    public static <T> Function<T, T> substitute(T subOut, T subIn) {
+        return t -> Objects.equals(subOut, t) ? subIn : t;
+    }
+
+    /**
+     * Returns a new instance of {@code <U>} constructed with provided
+     * {@code <T>}.
+     *
+     * @param <R> Type of output values from mapping
+     * @param <T> Type of input values to mapping
+     * @param clazzT The {@code Class} which defines objects of type {@code <T>}
+     * @param clazzR The {@code Class} which defines objects of type {@code <U>}
+     * @return a mapper which creates instances of {@code <R>} using {@code <T>}
+     * as the constructor parameter.
+     * @throws NoSuchMethodException when {@code <R>} has no constructor which
+     * takes a {@code <T>} as a parameter.
+     */
+    public static <R, T> Function<R, T> instantiate(Class<? extends T> clazzT, Class<? extends R> clazzR) {
+        Objects.requireNonNull(clazzT);
+        Objects.requireNonNull(clazzR);
+
+        final Constructor<? extends R> constructor;
+        try {
+            constructor = clazzR.getConstructor(clazzT);
+        } catch(NoSuchMethodException noConstructor) {
+            throw new IllegalArgumentException("no constructor for "+ clazzR.getSimpleName() + "(" + clazzT.getSimpleName() + ")", noConstructor);
+        }
+
+        return t -> {
+            try {
+                return constructor.newInstance(t);
+            } catch (ReflectiveOperationException ex) {
+                // XXX mduigou argument for exception transparency?
+                throw new UndeclaredThrowableException(ex);
+            }
+        };
+    }
+
+    /**
+     * Map according to the provided apply. Attempting to apply a value not from the
+     * given apply will cause an {@code IllegalArgumentException} to be thrown.
+     * A copy is <strong>not</strong> made of the apply. Care should be taken to
+     * avoid changes to the apply during operation may produce results which
+     * violate the {@code apply} method contract.
+     *
+     * @param <R> output type from mapping operation
+     * @param <T> input type to mapping operation
+     * @param apply provides the mappings from {@code <T>} to {@code <U>}
+     * @throws IllegalArgumentException for all values of {@code <T>} not
+     * present in the apply
+     */
+    public static <R, T> Function<R, T> forMap(Map<? super T, ? extends R> map) {
+        Objects.requireNonNull(map);
+
+        return t -> {
+            if (map.containsKey(t)) {
+                return map.get(t);
+            } else {
+                throw new IllegalArgumentException("unmappable <T> : " + t);
+            }
+        };
+    }
+
+    /**
+     * Map according to the provided mapping. The provided default value is
+     * returned for all {@code <T>} keys not found in the apply. A copy is
+     * <strong>not</strong> made of the apply and care should be taken to avoid
+     * changes to the apply during operation may produce results which violate the
+     * {@code apply} method contract.
+     *
+     * @param <R> output type from mapping
+     * @param <T> input type to apply
+     * @param apply provides the mappings from {@code <T>} to {@code <U>}
+     * @param defaultValue the value returned by {@code apply} method for
+     * {@code <T>} values not contained in the provided apply
+     */
+    public static <R, T> Function<R, T> forMap(Map<? super T, ? extends R> map, R defaultValue) {
+        Objects.requireNonNull(map);
+
+        return t -> map.containsKey(t) ? map.get(t) : defaultValue;
+    }
+
+    /**
+     * Map according to the provided predicate. Two output values are provided
+     * {@code forTrue} is returned if the predicate returns {@code true}
+     * otherwise the {@code forFalse} value is returned.
+     *
+     * @param <R> output type from mapping
+     * @param <T> input type to apply
+     * @param predicate decides which value {@code apply} method should return
+     * @param forTrue value to be returned for {@code true} predicate results
+     * @param forFalse value to be returned for {@code false} predicate results
+     * @return a Mapper who's {@code apply} method provides results according to
+     * the provided predicate.
+     */
+    public static <R, T> Function<R, T> forPredicate(Predicate<? super T> predicate, R forTrue, R forFalse) {
+        Objects.requireNonNull(predicate);
+
+        return t -> predicate.test(t) ? forTrue : forFalse;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/util/function/IntFunction.java	Thu Nov 15 22:03:04 2012 -0800
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package java.util.function;
+
+/**
+ * Given an input object maps to an appropriate integer value; this is the
+ * int-bearing specialization for {@link Mapper}.
+ *
+ * <p/>Like Mapper, IntFunction implementations are expected to:
+ * <ul>
+ *  <li>Provide stable results such that for any {@code t} the result of two
+ * {@code apply} operations are always equivalent. ie.<pre>
+ * int one = mapper.apply(a);
+ * int two = mapper.apply(a);
+ *
+ * assert one == two;
+ * </pre></li>
+ * <li>Equivalent input objects should apply to equivalent output objects. ie.<pre>
+ * assert a.equals(b);  // a and b are equivalent
+ *
+ * int x = mapper.apply(a);
+ * int y = mapper.apply(b);
+ *
+ * assert x == y;       // their mapped results should be as equivalent.
+ * </pre></li>
+ * <li>The mapper should not modify the input object in any way that would
+ * change the mapping.</li>
+ * <li>When used for aggregate operations upon many elements mappers
+ * should not assume that the {@code apply} operation will be called upon elements
+ * in any specific order.</li>
+ * </ul>
+ *
+ * @param <T> the type of input objects provided to the {@code apply} operation.
+ */
+public interface IntFunction<T> {
+
+    /**
+     * Map the provided input object to an appropriate output object.
+     *
+     * @param t the input object to be mapped.
+     * @return the mapped output value.
+     */
+    int apply(T t);
+}
--- a/src/share/classes/java/util/function/IntMapper.java	Thu Nov 15 19:11:58 2012 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package java.util.function;
-
-/**
- * Given an input object maps to an appropriate integer value; this is the
- * int-bearing specialization for {@link Mapper}.
- *
- * <p/>Like Mapper, IntMapper implementations are expected to:
- * <ul>
- *  <li>Provide stable results such that for any {@code t} the result of two
- * {@code map} operations are always equivalent. ie.<pre>
- * int one = mapper.map(a);
- * int two = mapper.map(a);
- *
- * assert one == two;
- * </pre></li>
- * <li>Equivalent input objects should map to equivalent output objects. ie.<pre>
- * assert a.equals(b);  // a and b are equivalent
- *
- * int x = mapper.map(a);
- * int y = mapper.map(b);
- *
- * assert x == y;       // their mapped results should be as equivalent.
- * </pre></li>
- * <li>The mapper should not modify the input object in any way that would
- * change the mapping.</li>
- * <li>When used for aggregate operations upon many elements mappers
- * should not assume that the {@code map} operation will be called upon elements
- * in any specific order.</li>
- * </ul>
- *
- * @param <T> the type of input objects provided to the {@code map} operation.
- */
-public interface IntMapper<T> {
-
-    /**
-     * Map the provided input object to an appropriate output object.
-     *
-     * @param t the input object to be mapped.
-     * @return the mapped output value.
-     */
-    int map(T t);
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/util/function/IntSupplier.java	Thu Nov 15 22:03:04 2012 -0800
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package java.util.function;
+
+import java.util.function.Supplier;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+public interface IntSupplier extends Supplier<Integer> {
+
+    @Override
+    default Integer get() {
+        Logger.getLogger(getClass().getName()).log(Level.WARNING, "{0} using boxed int", getClass().getName());
+        return getInt();
+    }
+
+    int getInt();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/util/function/LongFunction.java	Thu Nov 15 22:03:04 2012 -0800
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package java.util.function;
+
+/**
+ * Given an input object maps to an appropriate long value; this is the
+ * long-bearing specialization for {@link java.util.function.Mapper}.
+ *
+ * <p/>Like Mapper, LongFunction implementations are expected to:
+ * <ul>
+ *  <li>Provide stable results such that for any {@code t} the result of two
+ * {@code apply} operations are always equivalent. ie.<pre>
+ * long one = mapper.apply(a);
+ * long two = mapper.apply(a);
+ *
+ * assert one == two;
+ * </pre></li>
+ * <li>Equivalent input objects should apply to equivalent output objects. ie.<pre>
+ * assert a.equals(b);  // a and b are equivalent
+ *
+ * long x = mapper.apply(a);
+ * long y = mapper.apply(b);
+ *
+ * assert x == y;       // their mapped results should be as equivalent.
+ * </pre></li>
+ * <li>The mapper should not modify the input object in any way that would
+ * change the mapping.</li>
+ * <li>When used for aggregate operations upon many elements mappers
+ * should not assume that the {@code apply} operation will be called upon elements
+ * in any specific order.</li>
+ * </ul>
+ *
+ * @param <T> the type of input objects provided to the {@code apply} operation.
+ */
+public interface LongFunction<T> {
+
+    /**
+     * Map the provided input object to an appropriate output object.
+     *
+     * @param t the input object to be mapped.
+     * @return the mapped output value.
+     */
+    long apply(T t);
+}
--- a/src/share/classes/java/util/function/LongMapper.java	Thu Nov 15 19:11:58 2012 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package java.util.function;
-
-/**
- * Given an input object maps to an appropriate long value; this is the
- * long-bearing specialization for {@link java.util.function.Mapper}.
- *
- * <p/>Like Mapper, LongMapper implementations are expected to:
- * <ul>
- *  <li>Provide stable results such that for any {@code t} the result of two
- * {@code map} operations are always equivalent. ie.<pre>
- * long one = mapper.map(a);
- * long two = mapper.map(a);
- *
- * assert one == two;
- * </pre></li>
- * <li>Equivalent input objects should map to equivalent output objects. ie.<pre>
- * assert a.equals(b);  // a and b are equivalent
- *
- * long x = mapper.map(a);
- * long y = mapper.map(b);
- *
- * assert x == y;       // their mapped results should be as equivalent.
- * </pre></li>
- * <li>The mapper should not modify the input object in any way that would
- * change the mapping.</li>
- * <li>When used for aggregate operations upon many elements mappers
- * should not assume that the {@code map} operation will be called upon elements
- * in any specific order.</li>
- * </ul>
- *
- * @param <T> the type of input objects provided to the {@code map} operation.
- */
-public interface LongMapper<T> {
-
-    /**
-     * Map the provided input object to an appropriate output object.
-     *
-     * @param t the input object to be mapped.
-     * @return the mapped output value.
-     */
-    long map(T t);
-}
--- a/src/share/classes/java/util/function/Mapper.java	Thu Nov 15 19:11:58 2012 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package java.util.function;
-
-/**
- * Given an input object maps to an appropriate output object. A mapper may
- * variously provide a mapping between types, object instances or keys and
- * values or any other form of transformation upon the input.
- *
- * <p/>All mapper implementations are expected to:
- * <ul>
- *  <li>Provide stable results such that for any {@code t} the result of two
- * {@code map} operations are always equivalent. ie.<pre>
- * Foo one = mapper.map(a);
- * Foo two = mapper.map(a);
- *
- * assert one.equals(two) && two.equals(one);
- * </pre></li>
- * <li>Equivalent input objects should map to equivalent output objects. ie.<pre>
- * assert a.equals(b);  // a and b are equivalent
- *
- * Foo x = mapper.map(a);
- * Foo y = mapper.map(b);
- *
- * assert x.equals(y); // their mapped results should be as equivalent.
- * </pre></li>
- * <li>The mapper should not modify the input object in any way that would
- * change the mapping.</li>
- * <li>When used for aggregate operations upon many elements mappers
- * should not assume that the {@code map} operation will be called upon elements
- * in any specific order.</li>
- * </ul>
- *
- * @param <R> the type of output objects from {@code map} operation. May be the
- * @param <T> the type of input objects provided to the {@code map} operation.
- * same type as {@code <T>}.
- */
-public interface Mapper<R, T> {
-
-    /**
-     * Map the provided input object to an appropriate output object.
-     *
-     * @param t the input object to be mapped.
-     * @return the mapped output object.
-     */
-    R map(T t);
-
-    /**
-     * Combine with another mapper producing a mapper which preforms both
-     * mappings.
-     *
-     * @param <V> Type of output objects from the combined mapper. May be the
-     * same type as {@code <U>}.
-     * @param after An additional mapping to be applied to the result of this
-     * mapping.
-     * @return A mapper which performs both the original mapping followed by
-     * a second mapping.
-     */
-    public default <V> Mapper<V, T> compose(Mapper<? extends V, ? super R> after) {
-        return Mappers.chain(this, after);
-    }
-}
--- a/src/share/classes/java/util/function/Mappers.java	Thu Nov 15 19:11:58 2012 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,235 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package java.util.function;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.UndeclaredThrowableException;
-import java.util.Map;
-import java.util.Objects;
-
-/**
- * Static utility methods pertaining to {@code Mapper} instances.
- *
- * <p>All of the returned mappers are serializable if provided serializable
- * parameters.
- */
-public final class Mappers {
-
-    /**
-     * A mapper which who's {@code map} method returns the provided
-     * input.
-     */
-    private static final Mapper<Object, Object> IDENTITY = t -> t;
-
-    /**
-     * A mapper which performs a mapping from an object to it's
-     * string representation.
-     */
-    private static final Mapper<String, Object> STRING = String::valueOf;
-
-    /**
-     * singleton utils
-     */
-    private Mappers() {
-        throw new AssertionError("No instances!");
-    }
-
-     /**
-     * Returns a mapper which who's {@code map} method returns the provided
-     * input. Useful when a Mapper is required and {@code <T>} and {@code <U>}
-     * are the same type.
-     */
-    public static <T> Mapper<T, T> identity() {
-        return (Mapper<T, T>) IDENTITY;
-    }
-
-//    /**
-//     * Returns a mapper which who's {@code map} method returns a clone of the
-//     * provided input.
-//     */
-//    public static <T> Mapper<T, T> cloneOf() {
-//        return t -> {
-//            try {
-//                return t.clone();
-//            } catch (CloneNotSupportedException ex) {
-//                throw new UndeclaredThrowableException(ex);
-//            }
-//        };
-//    }
-//
-    /**
-     * Returns a mapper which performs a mapping from {@code <T>} to it's
-     * string representation.
-     *
-     * @param <T> Type of input values
-     * @return a mapper which performs a mapping from {@code <T>} to it's
-     * string representation
-     */
-    public static <T> Mapper<String, T> string() {
-        return (Mapper<String, T>) STRING;
-    }
-
-    /**
-     * Returns a mapper which performs a mapping from {@code <T>} to {@code <U>}
-     * followed by a mapping from {@code <U>} to {@code <V>}.
-     *
-     * @param <R> Type for final mapped values. May be the same type as
-     * {@code <U>}.
-     * @param <T> Type for input values
-     * @param <U> Type for intermediate mapped values. May be the same type as
-     * {@code <T>}.
-     * @param first Initial mapping from {@code <T>} to {@code <U>}.
-     * @param second additional mapping from {@code <U>} to {@code <V>}.
-     */
-    public static <R, T, U> Mapper<R, T> chain(
-            Mapper<? extends U, ? super T> first,
-            Mapper<? extends R, ? super U> second) {
-        Objects.requireNonNull(first);
-        Objects.requireNonNull(second);
-
-        return t -> second.map(first.map(t));
-    }
-
-    /**
-     * Returns a constant output regardless of input.
-     *
-     * @param constant The value to be returned by the {@code map} method.
-     * @return a mapper who's {@code map} method provides a constant result.
-     */
-    public static <R, T> Mapper<R, T> constant(R constant) {
-        return t -> constant;
-    }
-
-    /**
-     * A mapper that substitutes a single input value with a specified
-     * replacement. Input values are compared using {@code equals()}.
-     *
-     * @param <T> The type of values.
-     * @param subOut The input value to be substituted out.
-     * @param subIn The replacement value for matching inputs.
-     * @return a mapper that substitutes a single input value with a specified
-     * replacement.
-     */
-    public static <T> Mapper<T, T> substitute(T subOut, T subIn) {
-        return t -> Objects.equals(subOut, t) ? subIn : t;
-    }
-
-    /**
-     * Returns a new instance of {@code <U>} constructed with provided
-     * {@code <T>}.
-     *
-     * @param <R> Type of output values from mapping
-     * @param <T> Type of input values to mapping
-     * @param clazzT The {@code Class} which defines objects of type {@code <T>}
-     * @param clazzR The {@code Class} which defines objects of type {@code <U>}
-     * @return a mapper which creates instances of {@code <R>} using {@code <T>}
-     * as the constructor parameter.
-     * @throws NoSuchMethodException when {@code <R>} has no constructor which
-     * takes a {@code <T>} as a parameter.
-     */
-    public static <R, T> Mapper<R, T> instantiate(Class<? extends T> clazzT, Class<? extends R> clazzR) {
-        Objects.requireNonNull(clazzT);
-        Objects.requireNonNull(clazzR);
-
-        final Constructor<? extends R> constructor;
-        try {
-            constructor = clazzR.getConstructor(clazzT);
-        } catch(NoSuchMethodException noConstructor) {
-            throw new IllegalArgumentException("no constructor for "+ clazzR.getSimpleName() + "(" + clazzT.getSimpleName() + ")", noConstructor);
-        }
-
-        return t -> {
-            try {
-                return constructor.newInstance(t);
-            } catch (ReflectiveOperationException ex) {
-                // XXX mduigou argument for exception transparency?
-                throw new UndeclaredThrowableException(ex);
-            }
-        };
-    }
-
-    /**
-     * Map according to the provided map. Attempting to map a value not from the
-     * given map will cause an {@code IllegalArgumentException} to be thrown.
-     * A copy is <strong>not</strong> made of the map. Care should be taken to
-     * avoid changes to the map during operation may produce results which
-     * violate the {@code map} method contract.
-     *
-     * @param <R> output type from mapping operation
-     * @param <T> input type to mapping operation
-     * @param map provides the mappings from {@code <T>} to {@code <U>}
-     * @throws IllegalArgumentException for all values of {@code <T>} not
-     * present in the map
-     */
-    public static <R, T> Mapper<R, T> forMap(Map<? super T, ? extends R> map) {
-        Objects.requireNonNull(map);
-
-        return t -> {
-            if (map.containsKey(t)) {
-                return map.get(t);
-            } else {
-                throw new IllegalArgumentException("unmappable <T> : " + t);
-            }
-        };
-    }
-
-    /**
-     * Map according to the provided mapping. The provided default value is
-     * returned for all {@code <T>} keys not found in the map. A copy is
-     * <strong>not</strong> made of the map and care should be taken to avoid
-     * changes to the map during operation may produce results which violate the
-     * {@code map} method contract.
-     *
-     * @param <R> output type from mapping
-     * @param <T> input type to map
-     * @param map provides the mappings from {@code <T>} to {@code <U>}
-     * @param defaultValue the value returned by {@code map} method for
-     * {@code <T>} values not contained in the provided map
-     */
-    public static <R, T> Mapper<R, T> forMap(Map<? super T, ? extends R> map, R defaultValue) {
-        Objects.requireNonNull(map);
-
-        return t -> map.containsKey(t) ? map.get(t) : defaultValue;
-    }
-
-    /**
-     * Map according to the provided predicate. Two output values are provided
-     * {@code forTrue} is returned if the predicate returns {@code true}
-     * otherwise the {@code forFalse} value is returned.
-     *
-     * @param <R> output type from mapping
-     * @param <T> input type to map
-     * @param predicate decides which value {@code map} method should return
-     * @param forTrue value to be returned for {@code true} predicate results
-     * @param forFalse value to be returned for {@code false} predicate results
-     * @return a Mapper who's {@code map} method provides results according to
-     * the provided predicate.
-     */
-    public static <R, T> Mapper<R, T> forPredicate(Predicate<? super T> predicate, R forTrue, R forFalse) {
-        Objects.requireNonNull(predicate);
-
-        return t -> predicate.test(t) ? forTrue : forFalse;
-    }
-}
--- a/src/share/classes/java/util/function/Predicates.java	Thu Nov 15 19:11:58 2012 -0800
+++ b/src/share/classes/java/util/function/Predicates.java	Thu Nov 15 22:03:04 2012 -0800
@@ -169,13 +169,13 @@
 
     /**
      * Creates a predicate that is a composition of a mapper and a predicate.
-     * The returned predicate's result is {@code predicate.test(mapper.map(t))}.
+     * The returned predicate's result is {@code predicate.test(mapper.apply(t))}.
      *
      * @return the composition of the provided mapper and predicate
      */
     public static <T, V> Predicate<T> compose(
-            Predicate<? super V> predicate, Mapper<? extends V, ? super T> mapper) {
-        return t -> predicate.test(mapper.map(t));
+            Predicate<? super V> predicate, Function<? extends V, ? super T> mapper) {
+        return t -> predicate.test(mapper.apply(t));
     }
 
     /**
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/util/function/Supplier.java	Thu Nov 15 22:03:04 2012 -0800
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package java.util.function;
+
+/**
+ * aka Source and Producer
+ *
+ * <p>All Supplier implementations are expected to:
+ * <ul>
+ * <li></li>
+ * </ul>
+ *
+ * @param <T> The type of objects returned by {@code create}.
+ */
+public interface Supplier<T> {
+
+    /**
+     * Returns an object.
+     *
+     * @return an object.
+     */
+    T get();
+
+}
--- a/src/share/classes/java/util/logging/Logger.java	Thu Nov 15 19:11:58 2012 -0800
+++ b/src/share/classes/java/util/logging/Logger.java	Thu Nov 15 22:03:04 2012 -0800
@@ -30,7 +30,7 @@
 import java.util.concurrent.CopyOnWriteArrayList;
 import java.security.*;
 import java.lang.ref.WeakReference;
-import java.util.function.Factory;
+import java.util.function.Supplier;
 
 /**
  * A Logger object is used to log messages for a specific
@@ -140,7 +140,7 @@
  * </ul>
  * <p>
  * For the methods that do not take an explicit source name and
- * method name, the Logging framework will make a "best effort"
+ * method name, the Logging framework will get a "best effort"
  * to determine which class and method called into the logging method.
  * However, it is important to realize that this automatically inferred
  * information may only be approximate (or may even be quite wrong!).
@@ -579,11 +579,11 @@
      * @param   level   One of the message level identifiers, e.g., SEVERE
      * @param   msgSupplier   A function, which when called, produces the desired log message
      */
-    public void log(Level level, Factory<String> msgSupplier) {
+    public void log(Level level, Supplier<String> msgSupplier) {
         if (level.intValue() < levelValue || levelValue == offValue) {
             return;
         }
-        LogRecord lr = new LogRecord(level, msgSupplier.make());
+        LogRecord lr = new LogRecord(level, msgSupplier.get());
         doLog(lr);
     }
 
--- a/src/share/classes/java/util/stream/ReferencePipeline.java	Thu Nov 15 19:11:58 2012 -0800
+++ b/src/share/classes/java/util/stream/ReferencePipeline.java	Thu Nov 15 22:03:04 2012 -0800
@@ -24,11 +24,11 @@
  */
 package java.util.stream;
 
-import java.util.function.IntMapper;
+import java.util.function.IntFunction;
 import java.util.function.FlatMapper;
 import java.util.function.Predicate;
-import java.util.function.Factory;
-import java.util.function.Mapper;
+import java.util.function.Supplier;
+import java.util.function.Function;
 import java.util.function.Block;
 import java.util.function.BinaryOperator;
 import java.util.function.Combiner;
@@ -64,12 +64,12 @@
     }
 
     @Override
-    public <R> Stream<R> map(Mapper<? extends R, ? super U> mapper) {
+    public <R> Stream<R> map(Function<? extends R, ? super U> mapper) {
         return pipeline(new MapOp<>(mapper));
     }
 
     @Override
-    public IntStream map(IntMapper<? super U> mapper) {
+    public IntStream map(IntFunction<? super U> mapper) {
         return pipeline(new RefToIntMapOp<U>(mapper));
     }
 
@@ -130,13 +130,13 @@
     }
 
     @Override
-    public <K> Map<K,Collection<U>> groupBy(Mapper<? extends K, ? super U> classifier) {
+    public <K> Map<K,Collection<U>> groupBy(Function<? extends K, ? super U> classifier) {
         return pipeline(new GroupByOp<>(classifier));
     }
 
     @Override
-    public <K, W> Map<K, W> reduceBy(Mapper<? extends K, ? super U> classifier,
-                                     Factory<W> baseFactory,
+    public <K, W> Map<K, W> reduceBy(Function<? extends K, ? super U> classifier,
+                                     Supplier<W> baseFactory,
                                      Combiner<W, W, U> reducer,
                                      BinaryOperator<W> combiner) {
         return pipeline(new ReduceByOp<>(classifier, baseFactory, reducer, combiner));
@@ -193,7 +193,7 @@
     }
 
     @Override
-    public <V> V fold(Factory<V> baseFactory, Combiner<V, V, U> reducer, BinaryOperator<V> combiner) {
+    public <V> V fold(Supplier<V> baseFactory, Combiner<V, V, U> reducer, BinaryOperator<V> combiner) {
         return pipeline(new FoldOp<>(baseFactory, reducer, combiner));
     }
 }
--- a/src/share/classes/java/util/stream/Stream.java	Thu Nov 15 19:11:58 2012 -0800
+++ b/src/share/classes/java/util/stream/Stream.java	Thu Nov 15 22:03:04 2012 -0800
@@ -24,11 +24,11 @@
  */
 package java.util.stream;
 
-import java.util.function.IntMapper;
+import java.util.function.IntFunction;
 import java.util.function.FlatMapper;
 import java.util.function.Predicate;
-import java.util.function.Factory;
-import java.util.function.Mapper;
+import java.util.function.Supplier;
+import java.util.function.Function;
 import java.util.function.Block;
 import java.util.function.BinaryOperator;
 import java.util.function.Combiner;
@@ -49,9 +49,9 @@
 
     Stream<T> filter(Predicate<? super T> predicate);
 
-    <R> Stream<R> map(Mapper<? extends R, ? super T> mapper);
+    <R> Stream<R> map(Function<? extends R, ? super T> mapper);
 
-    IntStream map(IntMapper<? super T> mapper);
+    IntStream map(IntFunction<? super T> mapper);
 
     <R> Stream<R> flatMap(FlatMapper<? extends R, ? super T> mapper);
 
@@ -110,10 +110,10 @@
 
     Object[] toArray();
 
-    <U> Map<U, Collection<T>> groupBy(Mapper<? extends U, ? super T> classifier);
+    <U> Map<U, Collection<T>> groupBy(Function<? extends U, ? super T> classifier);
 
-    <U, W> Map<U, W> reduceBy(Mapper<? extends U, ? super T> classifier,
-                              Factory<W> baseFactory,
+    <U, W> Map<U, W> reduceBy(Function<? extends U, ? super T> classifier,
+                              Supplier<W> baseFactory,
                               Combiner<W, W, T> reducer,
                               BinaryOperator<W> combiner);
 
@@ -121,7 +121,7 @@
 
     Optional<T> reduce(BinaryOperator<T> op);
 
-    <U> U fold(Factory<U> baseFactory,
+    <U> U fold(Supplier<U> baseFactory,
                Combiner<U, U, T> reducer,
                BinaryOperator<U> combiner);
 
--- a/src/share/classes/java/util/stream/Streams.java	Thu Nov 15 19:11:58 2012 -0800
+++ b/src/share/classes/java/util/stream/Streams.java	Thu Nov 15 22:03:04 2012 -0800
@@ -26,7 +26,7 @@
 
 import java.util.*;
 import java.util.function.Block;
-import java.util.function.Factory;
+import java.util.function.Supplier;
 import java.util.function.UnaryOperator;
 
 /**
@@ -115,7 +115,7 @@
         return new ReferencePipeline<>(spliterator, flags);
     }
 
-    public static <T> Stream<T> stream(Factory<Spliterator<T>> proxy, int flags) {
+    public static <T> Stream<T> stream(Supplier<Spliterator<T>> proxy, int flags) {
         return new ReferencePipeline<>(new ProxySpliterator<>(proxy), flags);
     }
 
@@ -152,7 +152,7 @@
         return new ReferencePipeline<>(spliterator, flags | StreamOpFlags.IS_PARALLEL);
     }
 
-    public static <T> Stream<T> parallel(Factory<Spliterator<T>> proxy, int flags) {
+    public static <T> Stream<T> parallel(Supplier<Spliterator<T>> proxy, int flags) {
         return new ReferencePipeline<>(new ProxySpliterator<>(proxy), flags | StreamOpFlags.IS_PARALLEL);
     }
 
@@ -189,15 +189,15 @@
             return repeatedly(n, () -> t);
     }
 
-    public static<T> Stream<T> repeatedly(Factory<T> f) {
+    public static<T> Stream<T> repeatedly(Supplier<T> f) {
         return repeatedly(-1, f);
     }
 
-    public static<T> Stream<T> repeatedly(final int n, final Factory<T> f) {
+    public static<T> Stream<T> repeatedly(final int n, final Supplier<T> f) {
         Objects.requireNonNull(f);
 
         if (n < 0) {
-            InfiniteIterator<T> iterator = () -> f.make();
+            InfiniteIterator<T> iterator = () -> f.get();
             return stream(iterator, StreamOpFlags.IS_ORDERED);
         }
         else {
@@ -216,7 +216,7 @@
                     }
 
                     c--;
-                    return f.make();
+                    return f.get();
                 }
             };
 
@@ -380,16 +380,16 @@
     }
 
     private static class ProxySpliterator<T> implements Spliterator<T> {
-        private final Factory<Spliterator<T>> factory;
+        private final Supplier<Spliterator<T>> supplier;
         private Spliterator<T> spliterator;
 
-        private ProxySpliterator(Factory<Spliterator<T>> factory) {
-            this.factory = factory;
+        private ProxySpliterator(Supplier<Spliterator<T>> supplier) {
+            this.supplier = supplier;
         }
 
         private Spliterator<T> spliterator() {
             if (spliterator == null)
-                spliterator = factory.make();
+                spliterator = supplier.get();
             return spliterator;
         }
 
--- a/src/share/classes/java/util/stream/op/FoldOp.java	Thu Nov 15 19:11:58 2012 -0800
+++ b/src/share/classes/java/util/stream/op/FoldOp.java	Thu Nov 15 22:03:04 2012 -0800
@@ -26,7 +26,7 @@
 
 import java.util.function.BinaryOperator;
 import java.util.function.Combiner;
-import java.util.function.Factory;
+import java.util.function.Supplier;
 import java.util.stream.ParallelPipelineHelper;
 import java.util.stream.PipelineHelper;
 
@@ -36,11 +36,11 @@
  * @author Brian Goetz
  */
 public class FoldOp<T, U> implements TerminalOp<T, U> {
-    private final Factory<U> seedFactory;
+    private final Supplier<U> seedFactory;
     private final Combiner<U, U, T> reducer;
     private final BinaryOperator<U> combiner;
 
-    public FoldOp(Factory<U> factory, Combiner<U, U, T> reducer, BinaryOperator<U> combiner) {
+    public FoldOp(Supplier<U> factory, Combiner<U, U, T> reducer, BinaryOperator<U> combiner) {
         this.seedFactory = factory;
         this.reducer = reducer;
         this.combiner = combiner;
@@ -64,7 +64,7 @@
 
         @Override
         public void begin(int size) {
-            state = seedFactory.make();
+            state = seedFactory.get();
         }
 
         @Override
--- a/src/share/classes/java/util/stream/op/GroupByOp.java	Thu Nov 15 19:11:58 2012 -0800
+++ b/src/share/classes/java/util/stream/op/GroupByOp.java	Thu Nov 15 22:03:04 2012 -0800
@@ -26,8 +26,8 @@
 
 import java.util.*;
 import java.util.concurrent.ConcurrentHashMap;
-import java.util.function.Factory;
-import java.util.function.Mapper;
+import java.util.function.Supplier;
+import java.util.function.Function;
 import java.util.stream.*;
 
 /**
@@ -42,15 +42,15 @@
 //     of data when list needs to be re-sized
 public class GroupByOp<T, K> implements TerminalOp<T, Map<K, Collection<T>>> {
 
-    private final Mapper<? extends K, ? super T> mapper;
+    private final Function<? extends K, ? super T> mapper;
 
-    private final Factory<Collection<T>> valueFactory;
+    private final Supplier<Collection<T>> valueFactory;
 
-    public GroupByOp(Mapper<? extends K, ? super T> mapper) {
+    public GroupByOp(Function<? extends K, ? super T> mapper) {
         this(mapper, ArrayList::new);
     }
 
-    public GroupByOp(Mapper<? extends K, ? super T> mapper, Factory<Collection<T>> valueFactory) {
+    public GroupByOp(Function<? extends K, ? super T> mapper, Supplier<Collection<T>> valueFactory) {
         this.mapper = mapper;
         this.valueFactory = valueFactory;
     }
@@ -78,7 +78,7 @@
             Sink<S> sinkChain = helper.wrapSink(new Sink.OfValue<T>() {
                 @Override
                 public void apply(T t) {
-                    final Collection<T> sb = map.computeIfAbsent(mapper.map(t), (k) -> valueFactory.make());
+                    final Collection<T> sb = map.computeIfAbsent(mapper.apply(t), (k) -> valueFactory.get());
                     synchronized (sb) {
                         sb.add(t);
                     }
@@ -113,10 +113,10 @@
 
         @Override
         public void apply(T t) {
-            K key = Objects.requireNonNull(mapper.map(t), String.format("The element %s cannot be mapped to a null key", t));
+            K key = Objects.requireNonNull(mapper.apply(t), String.format("The element %s cannot be mapped to a null key", t));
             Collection<T> c = map.get(key);
             if (c == null) {
-                c = valueFactory.make();
+                c = valueFactory.get();
                 map.put(key, c);
             }
             c.add(t);
--- a/src/share/classes/java/util/stream/op/MapOp.java	Thu Nov 15 19:11:58 2012 -0800
+++ b/src/share/classes/java/util/stream/op/MapOp.java	Thu Nov 15 22:03:04 2012 -0800
@@ -27,7 +27,7 @@
 import java.util.Iterator;
 import java.util.Iterators;
 import java.util.Objects;
-import java.util.function.Mapper;
+import java.util.function.Function;
 import java.util.stream.Sink;
 import java.util.stream.StreamOpFlags;
 
@@ -37,9 +37,9 @@
  * @author Brian Goetz
  */
 public class MapOp<T, R> implements IntermediateOp<T, R> {
-    public final Mapper<? extends R, ? super T> mapper;
+    public final Function<? extends R, ? super T> mapper;
 
-    public MapOp(Mapper<? extends R, ? super T> mapper) {
+    public MapOp(Function<? extends R, ? super T> mapper) {
         this.mapper = Objects.requireNonNull(mapper);
     }
 
@@ -58,7 +58,7 @@
         return new Sink.ChainedValue<T>(sink) {
             @Override
             public void apply(T t) {
-                downstream.apply(mapper.map(t));
+                downstream.apply(mapper.apply(t));
             }
         };
     }
--- a/src/share/classes/java/util/stream/op/MatchOp.java	Thu Nov 15 19:11:58 2012 -0800
+++ b/src/share/classes/java/util/stream/op/MatchOp.java	Thu Nov 15 22:03:04 2012 -0800
@@ -27,7 +27,7 @@
 import java.util.Iterator;
 import java.util.concurrent.CountedCompleter;
 import java.util.concurrent.atomic.AtomicReference;
-import java.util.function.Mapper;
+import java.util.function.Function;
 import java.util.function.Predicate;
 import java.util.stream.*;
 
@@ -38,10 +38,10 @@
  */
 public class MatchOp<T> implements TerminalOp<T, Boolean> {
     private final MatchKind matchKind;
-    private final Mapper<Boolean, Iterator<? extends T>> impl;
+    private final Function<Boolean, Iterator<? extends T>> impl;
     private final StreamShape inputShape;
 
-    private MatchOp(MatchKind matchKind, Mapper<Boolean, Iterator<? extends T>> impl, StreamShape shape) {
+    private MatchOp(MatchKind matchKind, Function<Boolean, Iterator<? extends T>> impl, StreamShape shape) {
         this.matchKind = matchKind;
         this.impl = impl;
         inputShape = shape;
@@ -67,7 +67,7 @@
     }
 
     private Boolean evaluate(Iterator<T> iterator) {
-        return impl.map(iterator);
+        return impl.apply(iterator);
     }
 
     @Override
--- a/src/share/classes/java/util/stream/op/OpUtils.java	Thu Nov 15 19:11:58 2012 -0800
+++ b/src/share/classes/java/util/stream/op/OpUtils.java	Thu Nov 15 22:03:04 2012 -0800
@@ -25,7 +25,7 @@
 package java.util.stream.op;
 
 import java.util.concurrent.CountedCompleter;
-import java.util.function.Factory;
+import java.util.function.Supplier;
 import java.util.stream.*;
 
 /**
@@ -116,16 +116,16 @@
     }
 
     public static<P_IN, P_OUT, R, S extends AccumulatingSink<P_OUT, R, S>>
-    R parallelReduce(ParallelPipelineHelper<P_IN, P_OUT> helper, Factory<S> factory) {
+    R parallelReduce(ParallelPipelineHelper<P_IN, P_OUT> helper, Supplier<S> factory) {
         S sink = helper.invoke(new ReduceTask<>(helper, factory));
         return sink.getAndClearState();
     }
 
     private static class ReduceTask<P_IN, P_OUT, R, S extends AccumulatingSink<P_OUT, R, S>>
             extends AbstractTask<P_IN, P_OUT, S, ReduceTask<P_IN, P_OUT, R, S>> {
-        private final Factory<S> sinkFactory;
+        private final Supplier<S> sinkFactory;
 
-        private ReduceTask(ParallelPipelineHelper<P_IN, P_OUT> helper, Factory<S> sinkFactory) {
+        private ReduceTask(ParallelPipelineHelper<P_IN, P_OUT> helper, Supplier<S> sinkFactory) {
             super(helper);
             this.sinkFactory = sinkFactory;
         }
@@ -142,7 +142,7 @@
 
         @Override
         protected S doLeaf() {
-            return intoUnwrapped(helper, spliterator, sinkFactory.make());
+            return intoUnwrapped(helper, spliterator, sinkFactory.get());
         }
 
         @Override
--- a/src/share/classes/java/util/stream/op/ReduceByOp.java	Thu Nov 15 19:11:58 2012 -0800
+++ b/src/share/classes/java/util/stream/op/ReduceByOp.java	Thu Nov 15 22:03:04 2012 -0800
@@ -31,8 +31,8 @@
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.function.BinaryOperator;
 import java.util.function.Combiner;
-import java.util.function.Factory;
-import java.util.function.Mapper;
+import java.util.function.Supplier;
+import java.util.function.Function;
 import java.util.stream.*;
 
 /**
@@ -41,13 +41,13 @@
  * @author Brian Goetz
  */
 public class ReduceByOp<T, U, W> implements TerminalOp<T,Map<U,W>> {
-    private final Mapper<? extends U, ? super T> classifier;
-    private final Factory<W> seedFactory;
+    private final Function<? extends U, ? super T> classifier;
+    private final Supplier<W> seedFactory;
     private final Combiner<W, W, T> reducer;
     private final BinaryOperator<W> combiner;
 
-    public ReduceByOp(Mapper<? extends U, ? super T> classifier,
-                      Factory<W> seedFactory,
+    public ReduceByOp(Function<? extends U, ? super T> classifier,
+                      Supplier<W> seedFactory,
                       Combiner<W, W, T> reducer,
                       BinaryOperator<W> combiner) {
         this.classifier = classifier;
@@ -77,10 +77,10 @@
 
             @Override
             public void apply(T t) {
-                U mapped = classifier.map(t);
+                U mapped = classifier.apply(t);
                 W rVal = map.get(mapped);
                 if (rVal == null)
-                    rVal = seedFactory.make();
+                    rVal = seedFactory.get();
                 map.put(mapped, reducer.combine(rVal, t));
             }
         };
@@ -99,13 +99,13 @@
         }
         else {
             final ConcurrentHashMap<U, W> map = new ConcurrentHashMap<>();
-            final ConcurrentHashMap.Fun<? super U, ? extends W> seedFactoryAsCHMFun = (k) -> seedFactory.make();
+            final ConcurrentHashMap.Fun<? super U, ? extends W> seedFactoryAsCHMFun = (k) -> seedFactory.get();
 
             // Cache the sink chain, so it can be reused by all F/J leaf tasks
             Sink<S> sinkChain = helper.wrapSink(new Sink.OfValue<T>() {
                 @Override
                 public void apply(T t) {
-                    U key = classifier.map(t);
+                    U key = classifier.apply(t);
                     W curValue = map.computeIfAbsent(key, seedFactoryAsCHMFun);
                     while (!map.replace(key, curValue, reducer.combine(curValue, t)))
                         curValue = map.get(key);
@@ -140,10 +140,10 @@
 
         @Override
         public void apply(T t) {
-            U key = Objects.requireNonNull(classifier.map(t), String.format("The element %s cannot be mapped to a null key", t));
+            U key = Objects.requireNonNull(classifier.apply(t), String.format("The element %s cannot be mapped to a null key", t));
             W r = map.get(key);
             if (r == null)
-                r = seedFactory.make();
+                r = seedFactory.get();
             map.put(key, reducer.combine(r, t));
         }
 
--- a/src/share/classes/java/util/stream/primitive/IntFactory.java	Thu Nov 15 19:11:58 2012 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package java.util.stream.primitive;
-
-import java.util.function.Factory;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-public interface IntFactory extends Factory<Integer> {
-
-    @Override
-    default Integer make() {
-        Logger.getLogger(getClass().getName()).log(Level.WARNING, "{0} using boxed int", getClass().getName());
-        return makeInt();
-    }
-
-    int makeInt();
-}
--- a/src/share/classes/java/util/stream/primitive/Primitives.java	Thu Nov 15 19:11:58 2012 -0800
+++ b/src/share/classes/java/util/stream/primitive/Primitives.java	Thu Nov 15 22:03:04 2012 -0800
@@ -24,9 +24,10 @@
  */
 package java.util.stream.primitive;
 
+import java.util.function.IntSupplier;
 import java.util.*;
 import java.util.function.Block;
-import java.util.function.Factory;
+import java.util.function.Supplier;
 import java.util.function.UnaryOperator;
 import java.util.logging.Logger;
 import java.util.stream.*;
@@ -298,15 +299,15 @@
         return repeatedly(n, () -> t);
     }
 
-    public static IntStream repeatedly(IntFactory f) {
+    public static IntStream repeatedly(IntSupplier f) {
         return repeatedly(-1, f);
     }
 
-    public static IntStream repeatedly(final int n, final IntFactory f) {
+    public static IntStream repeatedly(final int n, final IntSupplier f) {
         Objects.requireNonNull(f);
 
         if (n < 0) {
-            IntInfiniteIterator iterator = () -> f.makeInt();
+            IntInfiniteIterator iterator = () -> f.getInt();
             return stream(iterator, StreamOpFlags.IS_ORDERED);
         }
         else {
@@ -325,7 +326,7 @@
                     }
 
                     c--;
-                    return f.makeInt();
+                    return f.getInt();
                 }
             };
 
--- a/src/share/classes/java/util/stream/primitive/RefToIntMapOp.java	Thu Nov 15 19:11:58 2012 -0800
+++ b/src/share/classes/java/util/stream/primitive/RefToIntMapOp.java	Thu Nov 15 22:03:04 2012 -0800
@@ -26,7 +26,7 @@
 
 import java.util.Iterator;
 import java.util.Objects;
-import java.util.function.IntMapper;
+import java.util.function.IntFunction;
 import java.util.stream.Sink;
 import java.util.stream.StreamOpFlags;
 import java.util.stream.StreamShape;
@@ -35,9 +35,9 @@
 
 public class RefToIntMapOp<T> implements IntermediateOp<T, Integer> {
 
-    private final IntMapper<? super T> mapper;
+    private final IntFunction<? super T> mapper;
 
-    public RefToIntMapOp(IntMapper<? super T> mapper) {
+    public RefToIntMapOp(IntFunction<? super T> mapper) {
         this.mapper = Objects.requireNonNull(mapper);
     }
 
@@ -70,7 +70,7 @@
 
             @Override
             public void apply(T t) {
-                intSink.applyInt(mapper.map(t));
+                intSink.applyInt(mapper.apply(t));
             }
 
             @Override
@@ -80,7 +80,7 @@
         };
     }
 
-    public static <T> IntIterator iterator(final Iterator<T> source, IntMapper<? super T> mapper) {
+    public static <T> IntIterator iterator(final Iterator<T> source, IntFunction<? super T> mapper) {
         Objects.requireNonNull(source);
 
         return new IntIterator() {
@@ -91,7 +91,7 @@
 
             @Override
             public int nextInt() {
-                return mapper.map(source.next());
+                return mapper.apply(source.next());
             }
         };
     }
--- a/test-ng/tests/org/openjdk/tests/java/lang/ThreadLocalFactoryTest.java	Thu Nov 15 19:11:58 2012 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,116 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- * 
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- * 
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- * 
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.tests.java.lang;
-
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.function.Factory;
-import org.testng.annotations.Test;
-import static org.testng.Assert.*;
-
-/**
- *
- * @summary tests ThreadLocal<Factory>. Adapted from java.lang.Basic functional test of ThreadLocal
- * 
- * @author Jim Gish <jim.gish@oracle.com>
- */
-@Test
-public class ThreadLocalFactoryTest {
-    static IntegerFactory theFactory = new IntegerFactory();
-    
-    static class MyThreadLocal extends ThreadLocal<Integer> {
-        public volatile boolean everCalled;
-        
-        public MyThreadLocal( Factory<Integer> f ) {
-            super(f);
-        }
-        
-        @Override
-        protected synchronized Integer initialValue() {
-            // N.B. this should never be called since we are using the factory
-            // instead
-            everCalled = true;
-            return null;
-        }
-    }
-    
-    /**
-     * Our one and only ThreadLocal from which we get thread ids using a 
-     * factory which simply increments a counter on each call of make().
-     */
-    static MyThreadLocal threadLocal = new MyThreadLocal( theFactory );
-    
-    static class IntegerFactory implements Factory<Integer> {
-        private AtomicInteger whatImake = new AtomicInteger(0);
-        
-        @Override
-        public Integer make() {
-            return whatImake.getAndIncrement();
-        }
-        
-        public int numCalls() {
-            return whatImake.intValue();
-        }
-    }
-    
-    public ThreadLocalFactoryTest() {
-    }
-
-    public void test() throws Exception {
-        int threadCount = 500;
-        Thread th[] = new Thread[threadCount];
-        final boolean visited[] = new boolean[threadCount];
-
-        // Create and start the threads
-        for (int i = 0; i < threadCount; i++) {
-            th[i] = new Thread() {
-                @Override
-                public void run() {
-                    int threadId = threadLocal.get();
-                    assertFalse(visited[threadId], "visited[" + threadId + "]=" + visited[threadId]);
-                    visited[threadId] = true;
-                    // check the get() again
-                    int secondCheckThreadId = threadLocal.get();
-                    assertEquals( secondCheckThreadId, threadId );
-                    Thread.yield();
-                }
-            };
-            th[i].start();
-        }
-
-        // Wait for the threads to finish
-        for (int i = 0; i < threadCount; i++) {
-            th[i].join();
-        }
-        
-        assertEquals(theFactory.numCalls(), threadCount );
-        // make sure the provided initialValue() has not been called
-        assertFalse(threadLocal.everCalled);
-        // Check results
-        for (int i = 0; i < threadCount; i++) {
-            assertTrue(visited[i],"visited[" + i + "]=" + visited[i]);
-        }
-    }
-}
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-ng/tests/org/openjdk/tests/java/lang/ThreadLocalSupplierTest.java	Thu Nov 15 22:03:04 2012 -0800
@@ -0,0 +1,116 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.tests.java.lang;
+
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.function.Supplier;
+import org.testng.annotations.Test;
+import static org.testng.Assert.*;
+
+/**
+ *
+ * @summary tests ThreadLocal<Supplier>. Adapted from java.lang.Basic functional test of ThreadLocal
+ *
+ * @author Jim Gish <jim.gish@oracle.com>
+ */
+@Test
+public class ThreadLocalSupplierTest {
+    static IntegerFactory theFactory = new IntegerFactory();
+
+    static class MyThreadLocal extends ThreadLocal<Integer> {
+        public volatile boolean everCalled;
+
+        public MyThreadLocal( Supplier<Integer> f ) {
+            super(f);
+        }
+
+        @Override
+        protected synchronized Integer initialValue() {
+            // N.B. this should never be called since we are using the factory
+            // instead
+            everCalled = true;
+            return null;
+        }
+    }
+
+    /**
+     * Our one and only ThreadLocal from which we get thread ids using a
+     * factory which simply increments a counter on each call of make().
+     */
+    static MyThreadLocal threadLocal = new MyThreadLocal( theFactory );
+
+    static class IntegerFactory implements Supplier<Integer> {
+        private AtomicInteger whatImake = new AtomicInteger(0);
+
+        @Override
+        public Integer get() {
+            return whatImake.getAndIncrement();
+        }
+
+        public int numCalls() {
+            return whatImake.intValue();
+        }
+    }
+
+    public ThreadLocalSupplierTest() {
+    }
+
+    public void test() throws Exception {
+        int threadCount = 500;
+        Thread th[] = new Thread[threadCount];
+        final boolean visited[] = new boolean[threadCount];
+
+        // Create and start the threads
+        for (int i = 0; i < threadCount; i++) {
+            th[i] = new Thread() {
+                @Override
+                public void run() {
+                    int threadId = threadLocal.get();
+                    assertFalse(visited[threadId], "visited[" + threadId + "]=" + visited[threadId]);
+                    visited[threadId] = true;
+                    // check the get() again
+                    int secondCheckThreadId = threadLocal.get();
+                    assertEquals( secondCheckThreadId, threadId );
+                    Thread.yield();
+                }
+            };
+            th[i].start();
+        }
+
+        // Wait for the threads to finish
+        for (int i = 0; i < threadCount; i++) {
+            th[i].join();
+        }
+
+        assertEquals(theFactory.numCalls(), threadCount );
+        // make sure the provided initialValue() has not been called
+        assertFalse(threadLocal.everCalled);
+        // Check results
+        for (int i = 0; i < threadCount; i++) {
+            assertTrue(visited[i],"visited[" + i + "]=" + visited[i]);
+        }
+    }
+}
+
--- a/test-ng/tests/org/openjdk/tests/java/lang/ThreadLocalTest.java	Thu Nov 15 19:11:58 2012 -0800
+++ b/test-ng/tests/org/openjdk/tests/java/lang/ThreadLocalTest.java	Thu Nov 15 22:03:04 2012 -0800
@@ -24,7 +24,7 @@
  */
 package org.openjdk.tests.java.lang;
 
-import java.util.function.Factory;
+import java.util.function.Supplier;
 import org.testng.annotations.Test;
 import static org.testng.Assert.*;
 
@@ -71,7 +71,7 @@
     }
 
     /**
-     * Test of creating ThreadLocal with a Factory
+     * Test of creating ThreadLocal with a Supplier
      */
     public void testInitWithFactory() {
         String whatDoYouExpect = "OneWithEverything";
@@ -79,7 +79,7 @@
         assertEquals( hotdogForTheMonk.get(), hotdogForTheMonk.get() );
     }
 
-    public class StringFactory implements Factory<String> {
+    public class StringFactory implements Supplier<String> {
         private String whatImake;
 
         public StringFactory( String oneOfThese ) {
@@ -87,7 +87,7 @@
         }
 
         @Override
-        public String make() {
+        public String get() {
             return whatImake;
         }
 
--- a/test-ng/tests/org/openjdk/tests/java/util/ComparatorsTest.java	Thu Nov 15 19:11:58 2012 -0800
+++ b/test-ng/tests/org/openjdk/tests/java/util/ComparatorsTest.java	Thu Nov 15 22:03:04 2012 -0800
@@ -30,10 +30,10 @@
 import java.util.Map;
 import org.testng.annotations.Test;
 
-import java.util.function.DoubleMapper;
-import java.util.function.IntMapper;
-import java.util.function.LongMapper;
-import java.util.function.Mapper;
+import java.util.function.DoubleFunction;
+import java.util.function.IntFunction;
+import java.util.function.LongFunction;
+import java.util.function.Function;
 
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertTrue;
@@ -91,9 +91,9 @@
         Thing[] things = new Thing[intValues.length];
         for (int i=0; i<intValues.length; i++)
             things[i] = new Thing(intValues[i], 0L, 0.0, null);
-        Comparator<Thing> comp = Comparators.comparing(new IntMapper<Thing>() {
+        Comparator<Thing> comp = Comparators.comparing(new IntFunction<Thing>() {
             @Override
-            public int map(Thing thing) {
+            public int apply(Thing thing) {
                 return thing.getIntField();
             }
         });
@@ -105,9 +105,9 @@
         Thing[] things = new Thing[longValues.length];
         for (int i=0; i<longValues.length; i++)
             things[i] = new Thing(0, longValues[i], 0.0, null);
-        Comparator<Thing> comp = Comparators.comparing(new LongMapper<Thing>() {
+        Comparator<Thing> comp = Comparators.comparing(new LongFunction<Thing>() {
             @Override
-            public long map(Thing thing) {
+            public long apply(Thing thing) {
                 return thing.getLongField();
             }
         });
@@ -119,9 +119,9 @@
         Thing[] things = new Thing[doubleValues.length];
         for (int i=0; i<doubleValues.length; i++)
             things[i] = new Thing(0, 0L, doubleValues[i], null);
-        Comparator<Thing> comp = Comparators.comparing(new DoubleMapper<Thing>() {
+        Comparator<Thing> comp = Comparators.comparing(new DoubleFunction<Thing>() {
             @Override
-            public double map(Thing thing) {
+            public double apply(Thing thing) {
                 return thing.getDoubleField();
             }
         });
@@ -133,9 +133,9 @@
         Thing[] things = new Thing[doubleValues.length];
         for (int i=0; i<doubleValues.length; i++)
             things[i] = new Thing(0, 0L, 0.0, stringValues[i]);
-        Comparator<Thing> comp = Comparators.comparing(new Mapper<String, Thing>() {
+        Comparator<Thing> comp = Comparators.comparing(new Function<String, Thing>() {
             @Override
-            public String map(Thing thing) {
+            public String apply(Thing thing) {
                 return thing.getStringField();
             }
         });
@@ -172,7 +172,7 @@
         assertTrue(cmp.compare("abcd", "def") > 0);
         assertTrue(cmpr.compare("abcd", "def") < 0);
         assertTrue(cmp.compare("abc", "defg") < 0);
-        assertTrue(cmpr.compare("abc", "defg") > 0);        
+        assertTrue(cmpr.compare("abc", "defg") > 0);
     }
 
     public void testComposeComparator() {
@@ -266,8 +266,8 @@
         // Comparator<People> cmp = Comparators.naturalOrder(); // Should fail to compiler as People is not comparable
         // We can use simple comparator, but those have been tested above.
         // Thus choose to do compose for some level of interation.
-        Comparator<People> cmp1 = Comparators.comparing((Mapper<String, People>) People::getFirstName);
-        Comparator<People> cmp2 = Comparators.comparing((Mapper<String, People>) People::getLastName);
+        Comparator<People> cmp1 = Comparators.comparing((Function<String, People>) People::getFirstName);
+        Comparator<People> cmp2 = Comparators.comparing((Function<String, People>) People::getLastName);
         Comparator<People> cmp = Comparators.compose(cmp1, cmp2);
 
         assertComparison(people[0], people[0], people[1], people[1],
--- a/test-ng/tests/org/openjdk/tests/java/util/LambdaTestHelpers.java	Thu Nov 15 19:11:58 2012 -0800
+++ b/test-ng/tests/org/openjdk/tests/java/util/LambdaTestHelpers.java	Thu Nov 15 22:03:04 2012 -0800
@@ -48,15 +48,15 @@
     public static final Block bHashCode = x -> { Objects.hashCode(x); };
     @SuppressWarnings("rawtypes")
     public static final BiBlock bBiHashCode = (x,y) -> { Objects.hash(x, y); };
-    public static final Mapper<Integer, Integer> mZero = x -> 0;
-    public static final Mapper<Integer, Integer> mId = x -> x;
-    public static final Mapper<Integer, Integer> mDoubler = x -> x * 2;
+    public static final Function<Integer, Integer> mZero = x -> 0;
+    public static final Function<Integer, Integer> mId = x -> x;
+    public static final Function<Integer, Integer> mDoubler = x -> x * 2;
     public static final FlatMapper<Integer, Integer> mfId = /*@@@ Sink::accept*/ (s,e) -> { s.apply(e); };
     public static final FlatMapper<Integer, Integer> mfNull = (s, e) -> { };
     public static final FlatMapper<Integer, Integer> mfLt = (s, e) -> { for (int i=0; i<e; i++) s.apply(i); };
-    public static final IntMapper<Integer> imDoubler = x -> x * 2;
-    public static final LongMapper<Long> lmDoubler = x -> x * 2;
-    public static final DoubleMapper<Double> dmDoubler = x -> x * 2;
+    public static final IntFunction<Integer> imDoubler = x -> x * 2;
+    public static final LongFunction<Long> lmDoubler = x -> x * 2;
+    public static final DoubleFunction<Double> dmDoubler = x -> x * 2;
     public static final Predicate<Integer> pFalse = x -> false;
     public static final Predicate<Integer> pTrue = x -> true;
     public static final Predicate<Integer> pEven = x -> 0 == x % 2;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-ng/tests/org/openjdk/tests/java/util/functions/FunctionsTest.java	Thu Nov 15 22:03:04 2012 -0800
@@ -0,0 +1,149 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package org.openjdk.tests.java.util.function;
+
+import org.testng.annotations.Test;
+
+import java.lang.reflect.UndeclaredThrowableException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.function.Function;
+import java.util.function.Functions;
+
+import static org.testng.Assert.assertNull;
+import static org.testng.Assert.fail;
+import static org.testng.AssertJUnit.assertEquals;
+
+/*
+ * Basic test for Functions functional utils
+ * @author  Mike Duigou
+ */
+public class FunctionsTest {
+
+    @Test
+    public void testIdentity() {
+        assertNull(Functions.identity().apply(null));
+        assertEquals(FunctionsTest.class, Functions.identity().apply(FunctionsTest.class));
+    }
+
+    @Test
+    public void testToString() {
+        assertEquals("null", Functions.string().apply(null));
+        assertEquals("1", Functions.string().apply(1));
+        assertEquals("surprise!", Functions.string().apply(new Object() {
+            public String toString() {return "surprise!";}
+        }));
+    }
+
+    @Test
+    public void testConstant() {
+        assertEquals(FunctionsTest.class, Functions.constant(FunctionsTest.class).apply(null));
+        assertEquals(FunctionsTest.class, Functions.constant(FunctionsTest.class).apply("1"));
+    }
+
+    public static class Goomba {
+        public final int value;
+        public Goomba(Integer x) {
+            value = x;
+        }
+    }
+
+    @Test
+    public void testInstantiate() {
+        assertEquals(1, Functions.instantiate(Integer.class, Goomba.class).apply(1).value);
+        assertEquals(2, Functions.instantiate(Integer.class, Goomba.class).apply(2).value);
+    }
+
+    @Test
+    public void testForPredicate() {
+        Function<String, Integer> mapper = Functions.<String, Integer>forPredicate(x -> x != 0, "true", "false");
+
+        assertEquals("false", mapper.apply(0));
+        assertEquals("true", mapper.apply(1));
+    }
+
+    @Test
+    public void testForMap() {
+        Map<Integer, String> truths = new HashMap<>();
+        truths.put(0, "sky");
+        truths.put(1, "ice");
+
+        Function<String, Integer> mapper = Functions.<String, Integer>forMap(truths);
+
+        assertEquals("sky", mapper.apply(0));
+        assertEquals("ice", mapper.apply(1));
+        THROWS(IllegalArgumentException.class, () -> {String result = mapper.apply(999); assert false;});
+    }
+
+    @Test
+    public void testForMapDefault() {
+        Map<Integer, String> truths = new HashMap<>();
+        truths.put(0, "sky");
+        truths.put(1, "ice");
+
+        Function<String, Integer> mapper = Functions.<String, Integer>forMap(truths, "fire");
+
+        assertEquals("sky", mapper.apply(0));
+        assertEquals("ice", mapper.apply(1));
+        assertEquals("fire", mapper.apply(999));
+        assertEquals("fire", mapper.apply(Integer.MAX_VALUE));
+    }
+
+    @Test
+    public void testChain() {
+        Function<Boolean, Integer> first = Functions.<Boolean, Integer>forPredicate(x -> x != 0, true, false);
+        Function<String, Boolean> second = Functions.<String, Boolean>forPredicate(x -> !x, "false", "true");
+        Function<String, Integer> mapper = Functions.chain(first, second);
+
+        assertEquals("false", mapper.apply(0));
+        assertEquals("true", mapper.apply(1));
+    }
+
+    @Test
+    public void testSubstitute() {
+        Function<Integer, Integer> ints = Functions.<Integer>substitute(3, 999);
+        Function<String, String> strings = Functions.<String>substitute("hello", "bonjour");
+        Function<String, String> stringNullIn = Functions.<String>substitute(null, "default");
+        Function<String, String> stringNullOut = Functions.<String>substitute("default", null);
+
+        assertEquals(1, (int) ints.apply(1));
+        assertEquals(999, (int) ints.apply(3));
+        assertEquals("gutentag", strings.apply("gutentag"));
+        assertEquals("bonjour", strings.apply("hello"));
+        assertEquals("gutentag", stringNullIn.apply("gutentag"));
+        assertEquals("default", stringNullIn.apply(null));
+        assertEquals("gutentag", stringNullOut.apply("gutentag"));
+        assertEquals(null, stringNullOut.apply("default"));
+    }
+
+    public interface Fun {void f() throws Throwable;}
+
+    void THROWS(Class<? extends Throwable> k, Fun... fs) {
+        for (Fun f : fs)
+            try { f.f(); fail("Expected " + k.getName() + " not thrown"); }
+            catch (Throwable t) {
+                if (!k.isAssignableFrom(t.getClass()))
+                    throw new UndeclaredThrowableException(t);}
+    }
+}
--- a/test-ng/tests/org/openjdk/tests/java/util/functions/MappersTest.java	Thu Nov 15 19:11:58 2012 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,149 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package org.openjdk.tests.java.util.function;
-
-import org.testng.annotations.Test;
-
-import java.lang.reflect.UndeclaredThrowableException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Mapper;
-import java.util.function.Mappers;
-
-import static org.testng.Assert.assertNull;
-import static org.testng.Assert.fail;
-import static org.testng.AssertJUnit.assertEquals;
-
-/*
- * Basic test for Mappers functional utils
- * @author  Mike Duigou
- */
-public class MappersTest {
-
-    @Test
-    public void testIdentity() {
-        assertNull(Mappers.identity().map(null));
-        assertEquals(MappersTest.class, Mappers.identity().map(MappersTest.class));
-    }
-
-    @Test
-    public void testToString() {
-        assertEquals("null", Mappers.string().map(null));
-        assertEquals("1", Mappers.string().map(1));
-        assertEquals("surprise!", Mappers.string().map(new Object() {
-            public String toString() {return "surprise!";}
-        }));
-    }
-
-    @Test
-    public void testConstant() {
-        assertEquals(MappersTest.class, Mappers.constant(MappersTest.class).map(null));
-        assertEquals(MappersTest.class, Mappers.constant(MappersTest.class).map("1"));
-    }
-
-    public static class Goomba {
-        public final int value;
-        public Goomba(Integer x) {
-            value = x;
-        }
-    }
-
-    @Test
-    public void testInstantiate() {
-        assertEquals(1, Mappers.instantiate(Integer.class, Goomba.class).map(1).value);
-        assertEquals(2, Mappers.instantiate(Integer.class, Goomba.class).map(2).value);
-    }
-
-    @Test
-    public void testForPredicate() {
-        Mapper<String, Integer> mapper = Mappers.<String, Integer>forPredicate(x -> x != 0, "true", "false");
-
-        assertEquals("false", mapper.map(0));
-        assertEquals("true", mapper.map(1));
-    }
-
-    @Test
-    public void testForMap() {
-        Map<Integer, String> truths = new HashMap<>();
-        truths.put(0, "sky");
-        truths.put(1, "ice");
-
-        Mapper<String, Integer> mapper = Mappers.<String, Integer>forMap(truths);
-
-        assertEquals("sky", mapper.map(0));
-        assertEquals("ice", mapper.map(1));
-        THROWS(IllegalArgumentException.class, () -> {String result = mapper.map(999); assert false;});
-    }
-
-    @Test
-    public void testForMapDefault() {
-        Map<Integer, String> truths = new HashMap<>();
-        truths.put(0, "sky");
-        truths.put(1, "ice");
-
-        Mapper<String, Integer> mapper = Mappers.<String, Integer>forMap(truths, "fire");
-
-        assertEquals("sky", mapper.map(0));
-        assertEquals("ice", mapper.map(1));
-        assertEquals("fire", mapper.map(999));
-        assertEquals("fire", mapper.map(Integer.MAX_VALUE));
-    }
-
-    @Test
-    public void testChain() {
-        Mapper<Boolean, Integer> first = Mappers.<Boolean, Integer>forPredicate(x -> x != 0, true, false);
-        Mapper<String, Boolean> second = Mappers.<String, Boolean>forPredicate(x -> !x, "false", "true");
-        Mapper<String, Integer> mapper = Mappers.chain(first, second);
-
-        assertEquals("false", mapper.map(0));
-        assertEquals("true", mapper.map(1));
-    }
-
-    @Test
-    public void testSubstitute() {
-        Mapper<Integer, Integer> ints = Mappers.<Integer>substitute(3, 999);
-        Mapper<String, String> strings = Mappers.<String>substitute("hello", "bonjour");
-        Mapper<String, String> stringNullIn = Mappers.<String>substitute(null, "default");
-        Mapper<String, String> stringNullOut = Mappers.<String>substitute("default", null);
-
-        assertEquals(1, (int) ints.map(1));
-        assertEquals(999, (int) ints.map(3));
-        assertEquals("gutentag", strings.map("gutentag"));
-        assertEquals("bonjour", strings.map("hello"));
-        assertEquals("gutentag", stringNullIn.map("gutentag"));
-        assertEquals("default", stringNullIn.map(null));
-        assertEquals("gutentag", stringNullOut.map("gutentag"));
-        assertEquals(null, stringNullOut.map("default"));
-    }
-    
-    public interface Fun {void f() throws Throwable;}
-
-    void THROWS(Class<? extends Throwable> k, Fun... fs) {
-        for (Fun f : fs)
-            try { f.f(); fail("Expected " + k.getName() + " not thrown"); }
-            catch (Throwable t) {
-                if (!k.isAssignableFrom(t.getClass()))
-                    throw new UndeclaredThrowableException(t);}
-    }
-}
--- a/test-ng/tests/org/openjdk/tests/java/util/streams/OpTestCase.java	Thu Nov 15 19:11:58 2012 -0800
+++ b/test-ng/tests/org/openjdk/tests/java/util/streams/OpTestCase.java	Thu Nov 15 22:03:04 2012 -0800
@@ -34,8 +34,8 @@
 import java.util.*;
 import java.util.function.BiPredicate;
 import java.util.function.Block;
-import java.util.function.Factory;
-import java.util.function.Mapper;
+import java.util.function.Supplier;
+import java.util.function.Function;
 import java.util.stream.*;
 import java.util.stream.op.*;
 import java.util.stream.primitive.IntStream;
@@ -66,7 +66,7 @@
 
         boolean isParallel();
 
-        abstract <T, U, S_IN extends BaseStream<T>, S_OUT extends BaseStream<U>> void run(TestData<T, S_IN> data, Block<U> b, Mapper<S_OUT, S_IN> m);
+        abstract <T, U, S_IN extends BaseStream<T>, S_OUT extends BaseStream<U>> void run(TestData<T, S_IN> data, Block<U> b, Function<S_OUT, S_IN> m);
     }
 
     @SuppressWarnings("unchecked")
@@ -76,19 +76,19 @@
                 exercise();
     }
 
-    public <T, U, S_IN extends BaseStream<T>, S_OUT extends BaseStream<U>> Node<U> exerciseOps(TestData<T, S_IN> data, Mapper<S_OUT, S_IN> m) {
+    public <T, U, S_IN extends BaseStream<T>, S_OUT extends BaseStream<U>> Node<U> exerciseOps(TestData<T, S_IN> data, Function<S_OUT, S_IN> m) {
         return withData(data).
                 using(m).
                 exercise();
     }
 
-    public <T, U, S_OUT extends BaseStream<U>> Node<U> exerciseOps(Collection<T> data, Mapper<S_OUT, Stream<T>> m) {
+    public <T, U, S_OUT extends BaseStream<U>> Node<U> exerciseOps(Collection<T> data, Function<S_OUT, Stream<T>> m) {
         return withData(new StreamTestData.CollectionData<>("Collection of type " + data.getClass().getName(), data)).
                 using(m).
                 exercise();
     }
 
-    public <T, U, S_OUT extends BaseStream<U>, I extends Iterable<U> & Sized> Node<U> exerciseOps(Collection<T> data, Mapper<S_OUT, Stream<T>> m, I expected) {
+    public <T, U, S_OUT extends BaseStream<U>, I extends Iterable<U> & Sized> Node<U> exerciseOps(Collection<T> data, Function<S_OUT, Stream<T>> m, I expected) {
         return withData(new StreamTestData.CollectionData<>("Collection of type " + data.getClass().getName(), data)).
                 using(m).
                 expectedResult(expected).
@@ -112,16 +112,16 @@
             return usingOpsFactory(() -> ops);
         }
 
-        public <U, S_OUT extends BaseStream<U>> IntermediateOpTestBuilder<T, U, S_IN, S_OUT> usingOpFactory(Factory<IntermediateOp> fop) {
-            return usingOpsFactory(() -> new IntermediateOp[] { fop.make() });
+        public <U, S_OUT extends BaseStream<U>> IntermediateOpTestBuilder<T, U, S_IN, S_OUT> usingOpFactory(Supplier<IntermediateOp> fop) {
+            return usingOpsFactory(() -> new IntermediateOp[] { fop.get() });
         }
 
         @SuppressWarnings("unchecked")
-        public <U, S_OUT extends BaseStream<U>> IntermediateOpTestBuilder<T, U, S_IN, S_OUT> usingOpsFactory(Factory<IntermediateOp[]> fops) {
-            return using((S_IN s) -> (S_OUT) chain((AbstractPipeline<?, T>)s, fops.make()));
+        public <U, S_OUT extends BaseStream<U>> IntermediateOpTestBuilder<T, U, S_IN, S_OUT> usingOpsFactory(Supplier<IntermediateOp[]> fops) {
+            return using((S_IN s) -> (S_OUT) chain((AbstractPipeline<?, T>)s, fops.get()));
         }
 
-        public <U, S_OUT extends BaseStream<U>> IntermediateOpTestBuilder<T, U, S_IN, S_OUT> using(Mapper<S_OUT, S_IN> m) {
+        public <U, S_OUT extends BaseStream<U>> IntermediateOpTestBuilder<T, U, S_IN, S_OUT> using(Function<S_OUT, S_IN> m) {
             return new IntermediateOpTestBuilder<>(data, m);
         }
 
@@ -131,7 +131,7 @@
     public class IntermediateOpTestBuilder<T, U, S_IN extends BaseStream<T>, S_OUT extends BaseStream<U>> {
         final TestData<T, S_IN> data;
 
-        final Mapper<S_OUT, S_IN> m;
+        final Function<S_OUT, S_IN> m;
 
         final StreamShape shape;
 
@@ -149,12 +149,12 @@
 
         BiPredicate<Iterable<U>, Iterable<U>> parallelEqualator = Objects::equals;
 
-        private IntermediateOpTestBuilder(TestData<T, S_IN> data, Mapper<S_OUT, S_IN> m) {
+        private IntermediateOpTestBuilder(TestData<T, S_IN> data, Function<S_OUT, S_IN> m) {
             this.data = data;
 
             this.m = Objects.requireNonNull(m);
 
-            this.shape = ((AbstractPipeline<?, U>) m.map(data.stream())).getOutputShape();
+            this.shape = ((AbstractPipeline<?, U>) m.apply(data.stream())).getOutputShape();
 
             // Have to initiate from the output shape of the last stream
             // This means the stream mapper is required first rather than last
@@ -252,7 +252,7 @@
         } else {
             // Induce the reference result
             b.before.apply(b.data);
-            S_OUT sOut = b.m.map(b.data.stream());
+            S_OUT sOut = b.m.apply(b.data.stream());
             refResult = ((AbstractPipeline<?, U>) sOut).collectOutput().flatten();
             b.after.apply(b.data);
         }
--- a/test-ng/tests/org/openjdk/tests/java/util/streams/StreamIntermediateOpTestScenario.java	Thu Nov 15 19:11:58 2012 -0800
+++ b/test-ng/tests/org/openjdk/tests/java/util/streams/StreamIntermediateOpTestScenario.java	Thu Nov 15 22:03:04 2012 -0800
@@ -27,7 +27,7 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.function.Block;
-import java.util.function.Mapper;
+import java.util.function.Function;
 import java.util.stream.*;
 import java.util.stream.op.FlagDeclaringOp;
 import java.util.stream.op.IntermediateOp;
@@ -36,15 +36,15 @@
 public enum StreamIntermediateOpTestScenario implements OpTestCase.IntermediateOpTestScenario {
 
     STREAM_FOR_EACH(false) {
-        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Mapper<Stream<U>, S_IN> m) {
-            m.map(data.stream()).forEach(b);
+        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Function<Stream<U>, S_IN> m) {
+            m.apply(data.stream()).forEach(b);
         }
     },
 
     // Wrap as stream and into a list
     STREAM_INTO(false) {
-        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Mapper<Stream<U>, S_IN> m) {
-            for (U t : m.map(data.stream()).into(new ArrayList<U>())) {
+        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Function<Stream<U>, S_IN> m) {
+            for (U t : m.apply(data.stream()).into(new ArrayList<U>())) {
                 b.apply(t);
             }
         }
@@ -52,8 +52,8 @@
 
     // Wrap as stream and into a list
     STREAM_TO_ARRAY(false) {
-        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Mapper<Stream<U>, S_IN> m) {
-            for (Object t : m.map(data.stream()).toArray()) {
+        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Function<Stream<U>, S_IN> m) {
+            for (Object t : m.apply(data.stream()).toArray()) {
                 b.apply((U) t);
             }
         }
@@ -61,16 +61,16 @@
 
     // Wrap as stream, and iterate in pull mode
     STREAM_ITERATOR(false) {
-        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Mapper<Stream<U>, S_IN> m) {
-            for (Iterator<U> seqIter = m.map(data.stream()).iterator(); seqIter.hasNext(); )
+        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Function<Stream<U>, S_IN> m) {
+            for (Iterator<U> seqIter = m.apply(data.stream()).iterator(); seqIter.hasNext(); )
                 b.apply(seqIter.next());
         }
     },
 
     // Wrap as stream, and iterate in mixed mode
     STREAM_MIXED(false) {
-        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Mapper<Stream<U>, S_IN> m) {
-            Stream<U> stream = m.map(data.stream());
+        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Function<Stream<U>, S_IN> m) {
+            Stream<U> stream = m.apply(data.stream());
             Iterator<U> iter = stream.iterator();
             if (iter.hasNext())
                 b.apply(iter.next());
@@ -80,9 +80,9 @@
 
     // Wrap as two connected streams, request iterator for the upstream, and do forEach on the downstream
     STREAM_MIXED_ITERATOR_FOR_EACH(false) {
-        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Mapper<Stream<U>, S_IN> m) {
+        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Function<Stream<U>, S_IN> m) {
             AbstractPipeline<T, T> pipe1 = data.seq(new NoOp(data.getShape()));
-            Stream<U> pipe2 = m.map((S_IN) pipe1);
+            Stream<U> pipe2 = m.apply((S_IN) pipe1);
 
             pipe1.iterator();
             pipe2.forEach(b);
@@ -91,22 +91,22 @@
 
     // Wrap as parallel stream + sequential
     PAR_STREAM_SEQUENTIAL_FOR_EACH(true) {
-        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Mapper<Stream<U>, S_IN> m) {
-            m.map(data.parallel()).sequential().forEach(b);
+        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Function<Stream<U>, S_IN> m) {
+            m.apply(data.parallel()).sequential().forEach(b);
         }
     },
 
     // Wrap as parallel stream + toArray
     PAR_STREAM_TO_ARRAY(true) {
-        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Mapper<Stream<U>, S_IN> m) {
-            for (Object t : m.map(data.parallel()).toArray())
+        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Function<Stream<U>, S_IN> m) {
+            for (Object t : m.apply(data.parallel()).toArray())
                 b.apply((U) t);
         }
     },
 
     // Wrap as parallel stream + toArray and clear SIZED flag
     PAR_STREAM_TO_ARRAY_CLEAR_SIZED(true) {
-        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Mapper<Stream<U>, S_IN> m) {
+        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Function<Stream<U>, S_IN> m) {
             AbstractPipeline<?, ?> pipe1 = data.par(new FlagDeclaringOp(StreamOpFlags.NOT_SIZED) {
                 @Override
                 public StreamShape outputShape() {
@@ -118,7 +118,7 @@
                     return data.getShape();
                 }
             });
-            Stream<U> pipe2 = m.map((S_IN) pipe1);
+            Stream<U> pipe2 = m.apply((S_IN) pipe1);
 
             for (Object t : pipe2.toArray())
                 b.apply((U) t);
@@ -127,8 +127,8 @@
 
     // Wrap as parallel stream + into
     PAR_STREAM_SEQUENTIAL_INTO(true) {
-        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Mapper<Stream<U>, S_IN> m) {
-            ArrayList<U> list = m.map(data.parallel()).sequential().into(new ArrayList<U>());
+        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Function<Stream<U>, S_IN> m) {
+            ArrayList<U> list = m.apply(data.parallel()).sequential().into(new ArrayList<U>());
             for (U u : list)
                 b.apply(u);
         }
@@ -136,8 +136,8 @@
 
     // Wrap as parallel stream, and iterate in mixed mode
     PAR_STREAM_ITERATOR_TO_ARRAY_MIXED(true) {
-        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Mapper<Stream<U>, S_IN> m) {
-            Stream<U> stream = m.map(data.parallel());
+        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Function<Stream<U>, S_IN> m) {
+            Stream<U> stream = m.apply(data.parallel());
             Iterator<U> iter = stream.iterator();
             if (iter.hasNext())
                 b.apply(iter.next());
@@ -148,9 +148,9 @@
 
     // Wrap as two connected streams, request iterator for the upstream, and do forEach on the downstream
     PAR_STREAM_MIXED_ITERATOR_TO_ARRAY(true) {
-        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Mapper<Stream<U>, S_IN> m) {
+        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Function<Stream<U>, S_IN> m) {
             AbstractPipeline<T, T> pipe1 = data.seq(new NoOp(data.getShape()));
-            Stream<U> pipe2 = m.map((S_IN) pipe1);
+            Stream<U> pipe2 = m.apply((S_IN) pipe1);
 
             pipe1.iterator();
             for (Object t : pipe2.toArray())
@@ -160,8 +160,8 @@
 
     // Wrap as parallel stream, and iterate in mixed mode
     PAR_STREAM_SEQUENTIAL_MIXED(true) {
-        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Mapper<Stream<U>, S_IN> m) {
-            Stream<U> stream = m.map(data.parallel());
+        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Function<Stream<U>, S_IN> m) {
+            Stream<U> stream = m.apply(data.parallel());
             Iterator<U> iter = stream.iterator();
             if (iter.hasNext())
                 b.apply(iter.next());
@@ -216,9 +216,9 @@
         return isParallel;
     }
 
-    public <T, U, S_IN extends BaseStream<T>, S_OUT extends BaseStream<U>> void run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Mapper<S_OUT, S_IN> m) {
-        _run(data, b, (Mapper<Stream<U>, S_IN>) m);
+    public <T, U, S_IN extends BaseStream<T>, S_OUT extends BaseStream<U>> void run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Function<S_OUT, S_IN> m) {
+        _run(data, b, (Function<Stream<U>, S_IN>) m);
     }
 
-    abstract <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Mapper<Stream<U>, S_IN> m);
+    abstract <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Function<Stream<U>, S_IN> m);
 }
--- a/test-ng/tests/org/openjdk/tests/java/util/streams/ops/FlagOpTest.java	Thu Nov 15 19:11:58 2012 -0800
+++ b/test-ng/tests/org/openjdk/tests/java/util/streams/ops/FlagOpTest.java	Thu Nov 15 22:03:04 2012 -0800
@@ -32,7 +32,7 @@
 import org.testng.annotations.Test;
 
 import java.util.*;
-import java.util.function.Factory;
+import java.util.function.Supplier;
 import java.util.stream.Sink;
 import java.util.stream.StreamOpFlags;
 import java.util.stream.op.*;
@@ -178,13 +178,13 @@
         testFlagsSetSequence(CollectorOps::sequentialCollector);
     }
 
-    private void testFlagsSetSequence(Factory<StatefulOp<Integer, Integer>> cf) {
+    private void testFlagsSetSequence(Supplier<StatefulOp<Integer, Integer>> cf) {
         EnumSet<StreamOpFlags> known = EnumSet.of(StreamOpFlags.ORDERED, StreamOpFlags.SIZED);
         EnumSet<StreamOpFlags> preserve = EnumSet.of(StreamOpFlags.DISTINCT, StreamOpFlags.SORTED);
 
         List<IntermediateOp<Integer, Integer>> ops = new ArrayList<>();
         for (StreamOpFlags f : EnumSet.of(StreamOpFlags.DISTINCT, StreamOpFlags.SORTED)) {
-            ops.add(cf.make());
+            ops.add(cf.get());
             ops.add(new TestFlagExpectedOp<>(f.set(),
                                              known.clone(),
                                              preserve.clone(),
@@ -192,7 +192,7 @@
             known.add(f);
             preserve.remove(f);
         }
-        ops.add(cf.make());
+        ops.add(cf.get());
         ops.add(new TestFlagExpectedOp<>(0,
                                          known.clone(),
                                          preserve.clone(),
@@ -217,13 +217,13 @@
         testFlagsClearSequence(CollectorOps::sequentialCollector);
     }
 
-    protected void testFlagsClearSequence(Factory<StatefulOp<Integer, Integer>> cf) {
+    protected void testFlagsClearSequence(Supplier<StatefulOp<Integer, Integer>> cf) {
         EnumSet<StreamOpFlags> preserve = EnumSet.of(StreamOpFlags.DISTINCT, StreamOpFlags.SORTED);
         EnumSet<StreamOpFlags> notKnown = EnumSet.noneOf(StreamOpFlags.class);
 
         List<IntermediateOp<Integer, Integer>> ops = new ArrayList<>();
         for (StreamOpFlags f : EnumSet.of(StreamOpFlags.DISTINCT, StreamOpFlags.SORTED)) {
-            ops.add(cf.make());
+            ops.add(cf.get());
             ops.add(new TestFlagExpectedOp<>(f.clear(),
                                              EnumSet.of(StreamOpFlags.ORDERED, StreamOpFlags.SIZED),
                                              preserve.clone(),
@@ -231,7 +231,7 @@
             notKnown.add(f);
             preserve.remove(f);
         }
-        ops.add(cf.make());
+        ops.add(cf.get());
         ops.add(new TestFlagExpectedOp<>(0,
                                          EnumSet.of(StreamOpFlags.ORDERED, StreamOpFlags.SIZED),
                                          preserve.clone(),
@@ -308,4 +308,4 @@
             }
         }
     }
-}
\ No newline at end of file
+}
--- a/test-ng/tests/org/openjdk/tests/java/util/streams/ops/GroupByOpTest.java	Thu Nov 15 19:11:58 2012 -0800
+++ b/test-ng/tests/org/openjdk/tests/java/util/streams/ops/GroupByOpTest.java	Thu Nov 15 22:03:04 2012 -0800
@@ -46,7 +46,7 @@
 public class GroupByOpTest extends OpTestCase {
 
     public void testRawIterator() {
-        GroupByOp<Integer, Boolean> grouping = new GroupByOp<>(Mappers.forPredicate(pEven, true, false));
+        GroupByOp<Integer, Boolean> grouping = new GroupByOp<>(Functions.forPredicate(pEven, true, false));
 
         Map<Boolean,Collection<Integer>> result = iteratorToStatefulSink(countTo(10).iterator(), grouping.sink());
 
@@ -64,7 +64,7 @@
     }
 
     public void testGroupBy() {
-        Map<Boolean,Collection<Integer>> result = countTo(10).stream().groupBy(Mappers.forPredicate(pEven, true, false));
+        Map<Boolean,Collection<Integer>> result = countTo(10).stream().groupBy(Functions.forPredicate(pEven, true, false));
 
         assertEquals(2, result.keySet().size());
         for(Collection<Integer> group : result.values()) {
@@ -80,10 +80,10 @@
     }
 
     static class MapperData<T, K> {
-        Mapper<K, T> m;
+        Function<K, T> m;
         int expectedSize;
 
-        MapperData(Mapper<K, T> m, int expectedSize) {
+        MapperData(Function<K, T> m, int expectedSize) {
             this.m = m;
             this.expectedSize = expectedSize;
         }
@@ -99,10 +99,10 @@
             new MapperData<>(mId.compose(mDoubler), uniqueSize),
             new MapperData<>(mDoubler.compose(mDoubler), uniqueSize),
 
-            new MapperData<>(Mappers.forPredicate(pFalse, true, false), Math.min(1, uniqueSize)),
-            new MapperData<>(Mappers.forPredicate(pTrue, true, false), Math.min(1, uniqueSize)),
-            new MapperData<>(Mappers.forPredicate(pEven, true, false), Math.min(2, uniqueSize)),
-            new MapperData<>(Mappers.forPredicate(pOdd, true, false), Math.min(2, uniqueSize))
+            new MapperData<>(Functions.forPredicate(pFalse, true, false), Math.min(1, uniqueSize)),
+            new MapperData<>(Functions.forPredicate(pTrue, true, false), Math.min(1, uniqueSize)),
+            new MapperData<>(Functions.forPredicate(pEven, true, false), Math.min(2, uniqueSize)),
+            new MapperData<>(Functions.forPredicate(pOdd, true, false), Math.min(2, uniqueSize))
         );
     }
 
--- a/test-ng/tests/org/openjdk/tests/java/util/streams/ops/IntNodeTest.java	Thu Nov 15 19:11:58 2012 -0800
+++ b/test-ng/tests/org/openjdk/tests/java/util/streams/ops/IntNodeTest.java	Thu Nov 15 22:03:04 2012 -0800
@@ -30,7 +30,7 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
-import java.util.function.Mapper;
+import java.util.function.Function;
 import java.util.stream.op.Node;
 import java.util.stream.primitive.*;
 
@@ -112,9 +112,9 @@
         }
     }
 
-    IntNode tree(List<Integer> l, Mapper<IntNode, List<Integer>> m) {
+    IntNode tree(List<Integer> l, Function<IntNode, List<Integer>> m) {
         if (l.size() < 3) {
-            return m.map(l);
+            return m.apply(l);
         }
         else {
             return IntNodes.node(tree(l.subList(0, l.size() / 2), m), tree(l.subList(l.size() / 2, l.size()), m));
--- a/test-ng/tests/org/openjdk/tests/java/util/streams/ops/NodeBuilderTest.java	Thu Nov 15 19:11:58 2012 -0800
+++ b/test-ng/tests/org/openjdk/tests/java/util/streams/ops/NodeBuilderTest.java	Thu Nov 15 22:03:04 2012 -0800
@@ -31,7 +31,7 @@
 import java.util.Arrays;
 import java.util.Iterator;
 import java.util.List;
-import java.util.function.Mapper;
+import java.util.function.Function;
 import java.util.stream.op.NodeBuilder;
 import java.util.stream.op.Nodes;
 
@@ -54,7 +54,7 @@
             ls.add(countTo(size));
         }
 
-        List<Mapper<NodeBuilder<Integer>, Integer>> ms = Arrays.<Mapper<NodeBuilder<Integer>, Integer>>asList(
+        List<Function<NodeBuilder<Integer>, Integer>> ms = Arrays.<Function<NodeBuilder<Integer>, Integer>>asList(
                 s -> Nodes.makeVariableSizeBuilder(),
                 s -> Nodes.makeBuilder(s)
         );
@@ -62,7 +62,7 @@
         Object[][] params = new Object[ls.size() * ms.size()][];
         int i = 0;
         for (List<Integer> l : ls) {
-            for (Mapper<NodeBuilder<Integer>, Integer> m : ms) {
+            for (Function<NodeBuilder<Integer>, Integer> m : ms) {
                 params[i++] = new Object[]{l, m};
             }
         }
@@ -71,8 +71,8 @@
     }
 
     @Test(dataProvider = "sizes")
-    public void testIteration(List<Integer> l, Mapper<NodeBuilder<Integer>, Integer> m) {
-        NodeBuilder<Integer> nb = m.map(l.size());
+    public void testIteration(List<Integer> l, Function<NodeBuilder<Integer>, Integer> m) {
+        NodeBuilder<Integer> nb = m.apply(l.size());
         nb.begin(l.size());
         for (int i : l) {
             nb.apply(i);
@@ -101,8 +101,8 @@
     }
 
     @Test(dataProvider = "sizes")
-    public void testUpdate(List<Integer> l, Mapper<NodeBuilder<Integer>, Integer> m) {
-        NodeBuilder<Integer> nb = m.map(l.size());
+    public void testUpdate(List<Integer> l, Function<NodeBuilder<Integer>, Integer> m) {
+        NodeBuilder<Integer> nb = m.apply(l.size());
         nb.begin(l.size());
         for (int i : l) {
             nb.apply(i);
--- a/test-ng/tests/org/openjdk/tests/java/util/streams/ops/NodeTest.java	Thu Nov 15 19:11:58 2012 -0800
+++ b/test-ng/tests/org/openjdk/tests/java/util/streams/ops/NodeTest.java	Thu Nov 15 22:03:04 2012 -0800
@@ -28,7 +28,7 @@
 import org.testng.annotations.Test;
 
 import java.util.*;
-import java.util.function.Mapper;
+import java.util.function.Function;
 import java.util.stream.Spliterator;
 import java.util.stream.Stream;
 import java.util.stream.Streamable;
@@ -97,9 +97,9 @@
         }
     }
 
-    Node<Integer> tree(List<Integer> l, Mapper<Node<Integer>, List<Integer>> m) {
+    Node<Integer> tree(List<Integer> l, Function<Node<Integer>, List<Integer>> m) {
         if (l.size() < 3) {
-            return m.map(l);
+            return m.apply(l);
         }
         else {
             return Nodes.node(tree(l.subList(0, l.size() / 2), m), tree(l.subList(l.size() / 2, l.size()), m));
--- a/test-ng/tests/org/openjdk/tests/java/util/streams/ops/ReduceByOpTest.java	Thu Nov 15 19:11:58 2012 -0800
+++ b/test-ng/tests/org/openjdk/tests/java/util/streams/ops/ReduceByOpTest.java	Thu Nov 15 22:03:04 2012 -0800
@@ -32,7 +32,7 @@
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.Map;
-import java.util.function.Mappers;
+import java.util.function.Functions;
 import java.util.stream.op.GroupByOp;
 import java.util.stream.op.ReduceByOp;
 
@@ -48,8 +48,8 @@
 
     @Test(dataProvider = "opArrays", dataProviderClass = StreamTestDataProvider.class)
     public void testOps(String name, StreamTestData<Integer> data) {
-        Map<Boolean,Collection<Integer>> gbResult = data.stream().groupBy(Mappers.forPredicate(pEven, true, false));
-        Map<Boolean,Integer> result = data.stream().reduceBy(Mappers.forPredicate(pEven, true, false),
+        Map<Boolean,Collection<Integer>> gbResult = data.stream().groupBy(Functions.forPredicate(pEven, true, false));
+        Map<Boolean,Integer> result = data.stream().reduceBy(Functions.forPredicate(pEven, true, false),
                                                                 () -> 0, rPlus, rPlus);
         assertEquals(result.size(), gbResult.size());
         for (Map.Entry<Boolean, Integer> entry : result.entrySet())
--- a/test-ng/tests/org/openjdk/tests/java/util/streams/ops/SliceOpTest.java	Thu Nov 15 19:11:58 2012 -0800
+++ b/test-ng/tests/org/openjdk/tests/java/util/streams/ops/SliceOpTest.java	Thu Nov 15 22:03:04 2012 -0800
@@ -35,7 +35,7 @@
 import java.util.Collections;
 import java.util.List;
 import java.util.concurrent.atomic.AtomicInteger;
-import java.util.function.Mapper;
+import java.util.function.Function;
 import java.util.function.UnaryOperator;
 import java.util.stream.AbstractPipeline;
 import java.util.stream.Stream;
--- a/test-ng/tests/org/openjdk/tests/java/util/streams/primitives/IntStreamIntermediateOpTestScenario.java	Thu Nov 15 19:11:58 2012 -0800
+++ b/test-ng/tests/org/openjdk/tests/java/util/streams/primitives/IntStreamIntermediateOpTestScenario.java	Thu Nov 15 22:03:04 2012 -0800
@@ -28,7 +28,7 @@
 
 import java.util.Iterator;
 import java.util.function.Block;
-import java.util.function.Mapper;
+import java.util.function.Function;
 import java.util.stream.*;
 import java.util.stream.op.FlagDeclaringOp;
 import java.util.stream.op.IntermediateOp;
@@ -41,29 +41,29 @@
 public enum IntStreamIntermediateOpTestScenario implements OpTestCase.IntermediateOpTestScenario {
 
     STREAM_FOR_EACH(false) {
-        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Mapper<IntStream, S_IN> m) {
-            m.map(data.stream()).forEach(b);
+        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Function<IntStream, S_IN> m) {
+            m.apply(data.stream()).forEach(b);
         }
     },
 
     STREAM_TO_ARRAY(false) {
-        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Mapper<IntStream, S_IN> m) {
-            for (int t : m.map(data.stream()).toArray()) {
+        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Function<IntStream, S_IN> m) {
+            for (int t : m.apply(data.stream()).toArray()) {
                 b.applyInt(t);
             }
         }
     },
 
     STREAM_ITERATOR(false) {
-        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Mapper<IntStream, S_IN> m) {
-            for (IntIterator seqIter = m.map(data.stream()).iterator(); seqIter.hasNext(); )
+        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Function<IntStream, S_IN> m) {
+            for (IntIterator seqIter = m.apply(data.stream()).iterator(); seqIter.hasNext(); )
                 b.applyInt(seqIter.nextInt());
         }
     },
 
     STREAM_MIXED(false) {
-        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Mapper<IntStream, S_IN> m) {
-            IntStream stream = m.map(data.stream());
+        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Function<IntStream, S_IN> m) {
+            IntStream stream = m.apply(data.stream());
             IntIterator iter = stream.iterator();
             if (iter.hasNext())
                 b.applyInt(iter.nextInt());
@@ -72,9 +72,9 @@
     },
 
     STREAM_MIXED_ITERATOR_FOR_EACH(false) {
-        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Mapper<IntStream, S_IN> m) {
+        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Function<IntStream, S_IN> m) {
             AbstractPipeline<?, ?> pipe1 = data.seq(new NoOp(data.getShape()));
-            IntStream pipe2 = m.map((S_IN) pipe1);
+            IntStream pipe2 = m.apply((S_IN) pipe1);
 
             pipe1.iterator();
             pipe2.forEach(b);
@@ -82,20 +82,20 @@
     },
 
     PAR_STREAM_SEQUENTIAL_FOR_EACH(true) {
-        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Mapper<IntStream, S_IN> m) {
-            m.map(data.parallel()).sequential().forEach(b);
+        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Function<IntStream, S_IN> m) {
+            m.apply(data.parallel()).sequential().forEach(b);
         }
     },
 
     PAR_STREAM_TO_ARRAY(true) {
-        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Mapper<IntStream, S_IN> m) {
-            for (int t : m.map(data.parallel()).toArray())
+        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Function<IntStream, S_IN> m) {
+            for (int t : m.apply(data.parallel()).toArray())
                 b.applyInt(t);
         }
     },
 
     PAR_STREAM_TO_ARRAY_CLEAR_SIZED(true) {
-        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Mapper<IntStream, S_IN> m) {
+        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Function<IntStream, S_IN> m) {
             AbstractPipeline<?, ?> pipe1 = data.par(new FlagDeclaringOp(StreamOpFlags.NOT_SIZED) {
                 @Override
                 public StreamShape outputShape() {
@@ -107,7 +107,7 @@
                     return data.getShape();
                 }
             });
-            IntStream pipe2 = m.map((S_IN) pipe1);
+            IntStream pipe2 = m.apply((S_IN) pipe1);
 
             for (int t : pipe2.toArray())
                 b.applyInt(t);
@@ -115,8 +115,8 @@
     },
 
     PAR_STREAM_ITERATOR_TO_ARRAY_MIXED(true) {
-        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Mapper<IntStream, S_IN> m) {
-            IntStream stream = m.map(data.parallel());
+        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Function<IntStream, S_IN> m) {
+            IntStream stream = m.apply(data.parallel());
             IntIterator iter = stream.iterator();
             if (iter.hasNext())
                 b.applyInt(iter.nextInt());
@@ -126,9 +126,9 @@
     },
 
     PAR_STREAM_MIXED_ITERATOR_TO_ARRAY(true) {
-        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Mapper<IntStream, S_IN> m) {
+        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Function<IntStream, S_IN> m) {
             AbstractPipeline<?, ?> pipe1 = data.par(new NoOp(data.getShape()));
-            IntStream pipe2 = m.map((S_IN) pipe1);
+            IntStream pipe2 = m.apply((S_IN) pipe1);
 
             pipe1.iterator();
             for (int t : pipe2.toArray())
@@ -138,8 +138,8 @@
 
     // Wrap as parallel stream, and iterate in mixed mode
     PAR_STREAM_SEQUENTIAL_MIXED(true) {
-        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Mapper<IntStream, S_IN> m) {
-            IntStream stream = m.map(data.parallel());
+        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Function<IntStream, S_IN> m) {
+            IntStream stream = m.apply(data.parallel());
             IntIterator iter = stream.iterator();
             if (iter.hasNext())
                 b.applyInt(iter.nextInt());
@@ -192,10 +192,10 @@
         return isParallel;
     }
 
-    public <T, U, S_IN extends BaseStream<T>, S_OUT extends BaseStream<U>> void run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Mapper<S_OUT, S_IN> m) {
-        _run(data, (IntBlock) b, (Mapper<IntStream, S_IN>) m);
+    public <T, U, S_IN extends BaseStream<T>, S_OUT extends BaseStream<U>> void run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Function<S_OUT, S_IN> m) {
+        _run(data, (IntBlock) b, (Function<IntStream, S_IN>) m);
     }
 
-    abstract <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Mapper<IntStream, S_IN> m);
+    abstract <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Function<IntStream, S_IN> m);
 
 }
--- a/test-ng/tests/org/openjdk/tests/javac/LambdaTranslationTest2.java	Thu Nov 15 19:11:58 2012 -0800
+++ b/test-ng/tests/org/openjdk/tests/javac/LambdaTranslationTest2.java	Thu Nov 15 22:03:04 2012 -0800
@@ -28,7 +28,7 @@
 
 import java.util.ArrayList;
 import java.util.List;
-import java.util.function.Mapper;
+import java.util.function.Function;
 import java.util.function.Predicate;
 
 import static org.testng.Assert.assertEquals;
@@ -70,61 +70,61 @@
         assertTrue(!equalsDummy.test(""));
         assertTrue(equalsDummy.test("dummy"));
 
-        Mapper<Object, Object> ident = s -> s;
+        Function<Object, Object> ident = s -> s;
 
-        assertEquals("blarf", ident.map("blarf"));
-        assertEquals("wooga", ident.map("wooga"));
-        assertTrue("wooga" == ident.map("wooga"));
+        assertEquals("blarf", ident.apply("blarf"));
+        assertEquals("wooga", ident.apply("wooga"));
+        assertTrue("wooga" == ident.apply("wooga"));
 
         // constant capture
-        Mapper<Object, Object> prefixer = s -> "p" + s;
-        assertEquals("pblarf", prefixer.map("blarf"));
-        assertEquals("pwooga", prefixer.map("wooga"));
+        Function<Object, Object> prefixer = s -> "p" + s;
+        assertEquals("pblarf", prefixer.apply("blarf"));
+        assertEquals("pwooga", prefixer.apply("wooga"));
 
         // instance capture
-        Mapper<Object, Object> prefixer2 = s -> dummy + s;
-        assertEquals("dummyblarf", prefixer2.map("blarf"));
-        assertEquals("dummywooga", prefixer2.map("wooga"));
+        Function<Object, Object> prefixer2 = s -> dummy + s;
+        assertEquals("dummyblarf", prefixer2.apply("blarf"));
+        assertEquals("dummywooga", prefixer2.apply("wooga"));
     }
 
-    interface Factory<T> {
+    interface Supplier<T> {
         T make();
     }
 
-    interface StringFactory extends Factory<String> { }
+    interface StringFactory extends Supplier<String> { }
 
-    interface StringFactory2 extends Factory<String> {
+    interface StringFactory2 extends Supplier<String> {
         String make();
     }
 
     public void testBridges() {
-        Factory<String> of = () -> "y";
-        Factory<?> ef = () -> "z";
+        Supplier<String> of = () -> "y";
+        Supplier<?> ef = () -> "z";
 
         assertEquals("y", of.make());
-        assertEquals("y", ((Factory<?>) of).make());
-        assertEquals("y", ((Factory) of).make());
+        assertEquals("y", ((Supplier<?>) of).make());
+        assertEquals("y", ((Supplier) of).make());
 
         assertEquals("z", ef.make());
-        assertEquals("z", ((Factory) ef).make());
+        assertEquals("z", ((Supplier) ef).make());
     }
 
     public void testBridgesImplicitSpecialization() {
         StringFactory sf = () -> "x";
 
         assertEquals("x", sf.make());
-        assertEquals("x", ((Factory<String>) sf).make());
-        assertEquals("x", ((Factory<?>) sf).make());
-        assertEquals("x", ((Factory) sf).make());
+        assertEquals("x", ((Supplier<String>) sf).make());
+        assertEquals("x", ((Supplier<?>) sf).make());
+        assertEquals("x", ((Supplier) sf).make());
     }
 
     public void testBridgesExplicitSpecialization() {
         StringFactory2 sf = () -> "x";
 
         assertEquals("x", sf.make());
-        assertEquals("x", ((Factory<String>) sf).make());
-        assertEquals("x", ((Factory<?>) sf).make());
-        assertEquals("x", ((Factory) sf).make());
+        assertEquals("x", ((Supplier<String>) sf).make());
+        assertEquals("x", ((Supplier<?>) sf).make());
+        assertEquals("x", ((Supplier) sf).make());
     }
 
     public void testSuperCapture() {
@@ -251,7 +251,7 @@
     }
 
     public void testConstructorRef() {
-        Factory<List<String>> lf = ArrayList<String>::new;
+        Supplier<List<String>> lf = ArrayList<String>::new;
         List<String> list = lf.make();
         assertTrue(list instanceof ArrayList);
         assertTrue(list != lf.make());
@@ -264,7 +264,7 @@
     }
 
     public void testPrivateMethodRef() {
-        Factory<String> sf = LambdaTranslationTest2::privateMethod;
+        Supplier<String> sf = LambdaTranslationTest2::privateMethod;
         assertEquals("private", sf.make());
     }
 
@@ -294,7 +294,7 @@
     }
 
     public void testProtectedMethodRef() {
-        Factory<String> sf = LambdaTranslationTest2::protectedMethod;
+        Supplier<String> sf = LambdaTranslationTest2::protectedMethod;
         assertEquals("protected", sf.make());
     }
 
@@ -329,7 +329,7 @@
     }
 
     public void testInnerClassMethodRef() {
-        Factory<String> fs = new Inner1()::m1;
+        Supplier<String> fs = new Inner1()::m1;
         assertEquals("Inner1.m1()", fs.make());
 
         fs = new Inner1().new Inner2()::m1;
@@ -344,7 +344,7 @@
         fs = new Inner1().new Inner2().new Inner3<String>("Inner1.Inner2.Inner3")::m1;
         assertEquals("Inner1.Inner2.Inner3", fs.make());
 
-        Factory<Integer> fsi = new Inner1().new Inner2().new Inner3<Integer>(100)::m1;
+        Supplier<Integer> fsi = new Inner1().new Inner2().new Inner3<Integer>(100)::m1;
         assertEquals(100, (int)fsi.make());
     }
 }
--- a/test-ng/tests/org/openjdk/tests/javac/MethodReferenceTestInstanceMethod.java	Thu Nov 15 19:11:58 2012 -0800
+++ b/test-ng/tests/org/openjdk/tests/javac/MethodReferenceTestInstanceMethod.java	Thu Nov 15 22:03:04 2012 -0800
@@ -43,8 +43,8 @@
     }
 
     class Thingy<T,U> {
-        U blah(Mapper<U, T> m, T val) {
-	    return m.map(val);
+        U blah(Function<U, T> m, T val) {
+	    return m.apply(val);
         }
     }