changeset 6432:112b2a64495a

More renames: Block.apply -> Block.accept; revert type parameter order change for Function,BiFunction,Combiner
author briangoetz
date Sat, 17 Nov 2012 12:16:22 -0500
parents 9b67467f86bf
children 7c6e15368d4d
files src/share/classes/java/lang/CharSequence.java src/share/classes/java/lang/Iterable.java src/share/classes/java/util/Arrays.java src/share/classes/java/util/Comparators.java src/share/classes/java/util/Iterator.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/BinaryOperator.java src/share/classes/java/util/function/Block.java src/share/classes/java/util/function/Combiner.java src/share/classes/java/util/function/DoubleBlock.java src/share/classes/java/util/function/DoubleFunction.java src/share/classes/java/util/function/FlatMapper.java src/share/classes/java/util/function/Function.java src/share/classes/java/util/function/Functions.java src/share/classes/java/util/function/IntBlock.java src/share/classes/java/util/function/IntFunction.java src/share/classes/java/util/function/LongBlock.java src/share/classes/java/util/function/LongFunction.java src/share/classes/java/util/function/Predicates.java src/share/classes/java/util/function/UnaryOperator.java src/share/classes/java/util/stream/ReferencePipeline.java src/share/classes/java/util/stream/Spliterator.java src/share/classes/java/util/stream/Stream.java src/share/classes/java/util/stream/op/ConcatOp.java src/share/classes/java/util/stream/op/CumulateOp.java src/share/classes/java/util/stream/op/FilterOp.java src/share/classes/java/util/stream/op/FlatMapOp.java src/share/classes/java/util/stream/op/FoldOp.java src/share/classes/java/util/stream/op/ForEachOp.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/Nodes.java src/share/classes/java/util/stream/op/ReduceByOp.java src/share/classes/java/util/stream/op/SeedlessFoldOp.java src/share/classes/java/util/stream/op/SliceOp.java src/share/classes/java/util/stream/op/SortedOp.java src/share/classes/java/util/stream/op/TeeOp.java src/share/classes/java/util/stream/op/UniqOp.java src/share/classes/java/util/stream/primitive/IntBlock.java src/share/classes/java/util/stream/primitive/IntIterable.java src/share/classes/java/util/stream/primitive/IntIterator.java src/share/classes/java/util/stream/primitive/IntNodes.java src/share/classes/java/util/stream/primitive/IntSpliterator.java src/share/classes/java/util/stream/primitive/IntToIntegerOp.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/util/ComparatorsTest.java test-ng/tests/org/openjdk/tests/java/util/LambdaTestHelpers.java test-ng/tests/org/openjdk/tests/java/util/NullArgsTestCase.java test-ng/tests/org/openjdk/tests/java/util/function/FunctionsTest.java test-ng/tests/org/openjdk/tests/java/util/stream/OpTestCase.java test-ng/tests/org/openjdk/tests/java/util/stream/StreamTestDataProvider.java test-ng/tests/org/openjdk/tests/java/util/stream/StreamTestScenario.java test-ng/tests/org/openjdk/tests/java/util/stream/op/FlatMapOpTest.java test-ng/tests/org/openjdk/tests/java/util/stream/op/GroupByOpTest.java test-ng/tests/org/openjdk/tests/java/util/stream/op/IntNodeTest.java test-ng/tests/org/openjdk/tests/java/util/stream/op/MatchOpTest.java test-ng/tests/org/openjdk/tests/java/util/stream/op/NodeBuilderTest.java test-ng/tests/org/openjdk/tests/java/util/stream/op/NodeTest.java test-ng/tests/org/openjdk/tests/java/util/stream/op/TeeOpTest.java test-ng/tests/org/openjdk/tests/java/util/stream/op/ToArrayOpTest.java test-ng/tests/org/openjdk/tests/java/util/stream/primitive/IntStreamTestDataProvider.java test-ng/tests/org/openjdk/tests/java/util/stream/primitive/IntStreamTestScenario.java test-ng/tests/org/openjdk/tests/javac/LambdaTranslationTest1.java test-ng/tests/org/openjdk/tests/javac/MethodReferenceTestInstanceMethod.java
diffstat 68 files changed, 234 insertions(+), 260 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/lang/CharSequence.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/lang/CharSequence.java	Sat Nov 17 12:16:22 2012 -0500
@@ -162,7 +162,7 @@
     @Override
     public void forEach(Block<? super Character> block) {
         for (int i = 0; i < cs.length(); i++)
-            block.apply(cs.charAt(i));
+            block.accept(cs.charAt(i));
     }
 
     public Iterator<Character> iterator() {
@@ -195,7 +195,7 @@
         for (int i = 0; i < cs.length(); ) {
             int cp = Character.codePointAt(cs, i);
             i += Character.charCount(cp);
-            block.apply(cp);
+            block.accept(cp);
         }
     }
 
--- a/src/share/classes/java/lang/Iterable.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/lang/Iterable.java	Sat Nov 17 12:16:22 2012 -0500
@@ -53,7 +53,7 @@
      */
     default void forEach(Block<? super T> block) {
         for (T t : this) {
-            block.apply(t);
+            block.accept(t);
         }
     }
 }
--- a/src/share/classes/java/util/Arrays.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/Arrays.java	Sat Nov 17 12:16:22 2012 -0500
@@ -27,7 +27,6 @@
 
 import java.lang.reflect.*;
 import java.util.function.Block;
-import java.util.logging.Logger;
 import java.util.stream.*;
 
 /**
@@ -3771,7 +3770,7 @@
         public void forEach(Block<? super T> block) {
             traversing = true;
             for (int i= curOffset; i<endOffset; i++) {
-                block.apply(elements[i]);
+                block.accept(elements[i]);
             }
             // update only once; reduce heap write traffic
             curOffset = endOffset;
@@ -3825,7 +3824,7 @@
         }
 
         @Override
-        public void apply(T t) {
+        public void accept(T t) {
             if (index >= length) {
                 throw new IndexOutOfBoundsException(Integer.toString(index));
             }
--- a/src/share/classes/java/util/Comparators.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/Comparators.java	Sat Nov 17 12:16:22 2012 -0500
@@ -171,7 +171,7 @@
      * @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(Function<? extends U, ? super T> mapper) {
+    public static <T, U extends Comparable<? super U>> Comparator<T> comparing(Function<? super T, ? extends U> mapper) {
         Objects.requireNonNull(mapper);
         return (Comparator<T> & Serializable)
             (c1, c2) -> mapper.apply(c1).compareTo(mapper.apply(c2));
--- a/src/share/classes/java/util/Iterator.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/Iterator.java	Sat Nov 17 12:16:22 2012 -0500
@@ -97,6 +97,6 @@
      */
     default void forEach(Block<? super E> block) {
         while (hasNext())
-            block.apply(next());
+            block.accept(next());
     }
 }
--- a/src/share/classes/java/util/Iterators.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/Iterators.java	Sat Nov 17 12:16:22 2012 -0500
@@ -121,7 +121,7 @@
         };
     }
 
-    public static<T, R> Iterator<R> map(final Iterator<? extends T> source, final Function<? extends R, ? super T> mapper) {
+    public static<T, R> Iterator<R> map(final Iterator<? extends T> source, final Function<? super T, ? extends R> mapper) {
         Objects.requireNonNull(source);
         Objects.requireNonNull(mapper);
         return new Iterator<R>() {
--- a/src/share/classes/java/util/Optional.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/Optional.java	Sat Nov 17 12:16:22 2012 -0500
@@ -105,7 +105,7 @@
      */
     public void ifPresent(Block<? super T> block) {
         if (value != null)
-            block.apply(value);
+            block.accept(value);
     }
 
     /**
--- a/src/share/classes/java/util/function/BiFunction.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/function/BiFunction.java	Sat Nov 17 12:16:22 2012 -0500
@@ -58,7 +58,7 @@
  * @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> {
+public interface BiFunction<T, U, R> {
 
     /**
      * Map the provided input objects to an appropriate output object.
--- a/src/share/classes/java/util/function/BinaryOperator.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/function/BinaryOperator.java	Sat Nov 17 12:16:22 2012 -0500
@@ -31,7 +31,7 @@
  *
  * @since 1.8
  */
-public interface BinaryOperator<T> extends Combiner<T,T,T> {
+public interface BinaryOperator<T> extends Combiner<T, T, T> {
 
     @Override
     public default T combine(T t1, T t2) {
--- a/src/share/classes/java/util/function/Block.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/function/Block.java	Sat Nov 17 12:16:22 2012 -0500
@@ -40,7 +40,7 @@
      *
      * @param t the input object
      */
-    public void apply(T t);
+    public void accept(T t);
 
     /**
      * Returns a Block which performs in sequence the {@code apply} methods of
@@ -52,6 +52,6 @@
      * this Block and the {@code apply} method of the specified Block operation
      */
     public default Block<T> chain(Block<? super T> other) {
-        return (T t) -> { apply(t); other.apply(t); };
+        return (T t) -> { accept(t); other.accept(t); };
     }
 }
--- a/src/share/classes/java/util/function/Combiner.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/function/Combiner.java	Sat Nov 17 12:16:22 2012 -0500
@@ -31,6 +31,6 @@
  * @param <U> Type of second operand
  * @param <R> Type of result.
  */
-public interface Combiner<R, T, U> {
+public interface Combiner<T, U, R> {
     R combine(T t, U u);
 }
--- a/src/share/classes/java/util/function/DoubleBlock.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/function/DoubleBlock.java	Sat Nov 17 12:16:22 2012 -0500
@@ -41,7 +41,7 @@
      * @param t the input
      */
     @Override
-    public default void apply(Double t) { apply((double) t); }
+    public default void accept(Double t) { apply((double) t); }
 
     /**
      * Performs operations upon the provided object which may modify that object
--- a/src/share/classes/java/util/function/DoubleFunction.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/function/DoubleFunction.java	Sat Nov 17 12:16:22 2012 -0500
@@ -33,7 +33,7 @@
  *
  * @since 1.8
  */
-public interface DoubleFunction<T> extends Function<Double,T> {
+public interface DoubleFunction<T> extends Function<T, Double> {
 
     /**
      * Apply a function to the input object yielding an appropriate
--- a/src/share/classes/java/util/function/FlatMapper.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/function/FlatMapper.java	Sat Nov 17 12:16:22 2012 -0500
@@ -28,7 +28,7 @@
  * Map an element to zero or more results and add all results to a sink.
  *
  */
-public interface FlatMapper<R, T> {
+public interface FlatMapper<T, R> {
     /**
      * Map {@code element} and add all of the results to {@code sink}.
      *
--- a/src/share/classes/java/util/function/Function.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/function/Function.java	Sat Nov 17 12:16:22 2012 -0500
@@ -35,7 +35,7 @@
  *
  * @since 1.8
  */
-public interface Function<R, T> {
+public interface Function<T, R> {
 
     /**
      * Yield an appropriate output object for the provided input object.
@@ -56,7 +56,7 @@
      * @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) {
+    public default <V> Function<T, V> compose(Function<? super R, ? extends V> after) {
         return Functions.chain(this, after);
     }
 }
--- a/src/share/classes/java/util/function/Functions.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/function/Functions.java	Sat Nov 17 12:16:22 2012 -0500
@@ -47,7 +47,7 @@
      * A mapper which performs a mapping from an object to it's
      * string representation.
      */
-    private static final Function<String, Object> STRING = String::valueOf;
+    private static final Function<Object, String> STRING = String::valueOf;
 
     /**
      * singleton utils
@@ -87,8 +87,8 @@
      * @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;
+    public static <T> Function<T, String> string() {
+        return (Function<T, String>) STRING;
     }
 
     /**
@@ -103,9 +103,9 @@
      * @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) {
+    public static <R, T, U> Function<T, R> chain(
+            Function<? super T, ? extends U> first,
+            Function<? super U, ? extends R> second) {
         Objects.requireNonNull(first);
         Objects.requireNonNull(second);
 
@@ -118,7 +118,7 @@
      * @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) {
+    public static <R, T> Function<T, R> constant(R constant) {
         return t -> constant;
     }
 
@@ -149,7 +149,7 @@
      * @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) {
+    public static <R, T> Function<T, R> instantiate(Class<? extends T> clazzT, Class<? extends R> clazzR) {
         Objects.requireNonNull(clazzT);
         Objects.requireNonNull(clazzR);
 
@@ -183,7 +183,7 @@
      * @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) {
+    public static <R, T> Function<T, R> forMap(Map<? super T, ? extends R> map) {
         Objects.requireNonNull(map);
 
         return t -> {
@@ -208,7 +208,7 @@
      * @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) {
+    public static <R, T> Function<T, R> forMap(Map<? super T, ? extends R> map, R defaultValue) {
         Objects.requireNonNull(map);
 
         return t -> map.containsKey(t) ? map.get(t) : defaultValue;
@@ -227,7 +227,7 @@
      * @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) {
+    public static <R, T> Function<T, R> 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/IntBlock.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/function/IntBlock.java	Sat Nov 17 12:16:22 2012 -0500
@@ -41,7 +41,7 @@
      * @param t the input
      */
     @Override
-    public default void apply(Integer t) { apply((int) t); }
+    public default void accept(Integer t) { apply((int) t); }
 
     /**
      * Performs operations upon the provided object which may modify that object
--- a/src/share/classes/java/util/function/IntFunction.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/function/IntFunction.java	Sat Nov 17 12:16:22 2012 -0500
@@ -32,7 +32,7 @@
  *
  * @since 1.8
  */
-public interface IntFunction<T> extends Function<Integer,T> {
+public interface IntFunction<T> extends Function<T, Integer> {
 
     /**
      * Apply a function to the input object yielding an appropriate
--- a/src/share/classes/java/util/function/LongBlock.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/function/LongBlock.java	Sat Nov 17 12:16:22 2012 -0500
@@ -41,7 +41,7 @@
      * @param t the input
      */
     @Override
-    public default void apply(Long t) { apply((long) t); }
+    public default void accept(Long t) { apply((long) t); }
 
     /**
      * Performs operations upon the provided object which may modify that object
--- a/src/share/classes/java/util/function/LongFunction.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/function/LongFunction.java	Sat Nov 17 12:16:22 2012 -0500
@@ -32,7 +32,7 @@
  *
  * @since 1.8
  */
-public interface LongFunction<T> extends Function<Long,T> {
+public interface LongFunction<T> extends Function<T, Long> {
 
     /**
      * Apply a function to the input object yielding an appropriate
--- a/src/share/classes/java/util/function/Predicates.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/function/Predicates.java	Sat Nov 17 12:16:22 2012 -0500
@@ -174,7 +174,7 @@
      * @return the composition of the provided mapper and predicate
      */
     public static <T, V> Predicate<T> compose(
-            Predicate<? super V> predicate, Function<? extends V, ? super T> mapper) {
+            Predicate<? super V> predicate, Function<? super T, ? extends V> mapper) {
         return t -> predicate.test(mapper.apply(t));
     }
 
--- a/src/share/classes/java/util/function/UnaryOperator.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/function/UnaryOperator.java	Sat Nov 17 12:16:22 2012 -0500
@@ -31,7 +31,7 @@
  *
  * @since 1.8
  */
-public interface UnaryOperator<T> extends Function<T,T> {
+public interface UnaryOperator<T> extends Function<T, T> {
     @Override
     public default T apply(T operand) { return operate(operand); }
 
--- a/src/share/classes/java/util/stream/ReferencePipeline.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/stream/ReferencePipeline.java	Sat Nov 17 12:16:22 2012 -0500
@@ -64,7 +64,7 @@
     }
 
     @Override
-    public <R> Stream<R> map(Function<? extends R, ? super U> mapper) {
+    public <R> Stream<R> map(Function<? super U, ? extends R> mapper) {
         return pipeline(new MapOp<>(mapper));
     }
 
@@ -74,7 +74,7 @@
     }
 
     @Override
-    public <R> Stream<R> flatMap(FlatMapper<? extends R, ? super U> mapper) {
+    public <R> Stream<R> flatMap(FlatMapper<? super U, ? extends R> mapper) {
         return pipeline(new FlatMapOp<>(mapper));
     }
 
@@ -130,14 +130,14 @@
     }
 
     @Override
-    public <K> Map<K,Collection<U>> groupBy(Function<? extends K, ? super U> classifier) {
+    public <K> Map<K,Collection<U>> groupBy(Function<? super U, ? extends K> classifier) {
         return pipeline(new GroupByOp<>(classifier));
     }
 
     @Override
-    public <K, W> Map<K, W> reduceBy(Function<? extends K, ? super U> classifier,
+    public <K, W> Map<K, W> reduceBy(Function<? super U, ? extends K> classifier,
                                      Supplier<W> baseFactory,
-                                     Combiner<W, W, U> reducer,
+                                     Combiner<W, U, W> reducer,
                                      BinaryOperator<W> combiner) {
         return pipeline(new ReduceByOp<>(classifier, baseFactory, reducer, combiner));
     }
@@ -193,7 +193,7 @@
     }
 
     @Override
-    public <V> V fold(Supplier<V> baseFactory, Combiner<V, V, U> reducer, BinaryOperator<V> combiner) {
+    public <V> V fold(Supplier<V> baseFactory, Combiner<V, U, V> reducer, BinaryOperator<V> combiner) {
         return pipeline(new FoldOp<>(baseFactory, reducer, combiner));
     }
 }
--- a/src/share/classes/java/util/stream/Spliterator.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/stream/Spliterator.java	Sat Nov 17 12:16:22 2012 -0500
@@ -90,7 +90,7 @@
     default void forEach(Block<? super T> block) {
         Iterator<T> remaining = iterator();
         while (remaining.hasNext()) {
-            block.apply(remaining.next());
+            block.accept(remaining.next());
         }
     }
 
--- a/src/share/classes/java/util/stream/Stream.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/stream/Stream.java	Sat Nov 17 12:16:22 2012 -0500
@@ -49,11 +49,11 @@
 
     Stream<T> filter(Predicate<? super T> predicate);
 
-    <R> Stream<R> map(Function<? extends R, ? super T> mapper);
+    <R> Stream<R> map(Function<? super T, ? extends R> mapper);
 
     IntStream map(IntFunction<? super T> mapper);
 
-    <R> Stream<R> flatMap(FlatMapper<? extends R, ? super T> mapper);
+    <R> Stream<R> flatMap(FlatMapper<? super T, ? extends R> mapper);
 
     // @@@ flatMapToInt
 
@@ -110,11 +110,11 @@
 
     Object[] toArray();
 
-    <U> Map<U, Collection<T>> groupBy(Function<? extends U, ? super T> classifier);
+    <U> Map<U, Collection<T>> groupBy(Function<? super T, ? extends U> classifier);
 
-    <U, W> Map<U, W> reduceBy(Function<? extends U, ? super T> classifier,
+    <U, W> Map<U, W> reduceBy(Function<? super T, ? extends U> classifier,
                               Supplier<W> baseFactory,
-                              Combiner<W, W, T> reducer,
+                              Combiner<W, T, W> reducer,
                               BinaryOperator<W> combiner);
 
     T reduce(T base, BinaryOperator<T> op);
@@ -122,7 +122,7 @@
     Optional<T> reduce(BinaryOperator<T> op);
 
     <U> U fold(Supplier<U> baseFactory,
-               Combiner<U, U, T> reducer,
+               Combiner<U, T, U> reducer,
                BinaryOperator<U> combiner);
 
     boolean anyMatch(Predicate<? super T> predicate);
--- a/src/share/classes/java/util/stream/op/ConcatOp.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/stream/op/ConcatOp.java	Sat Nov 17 12:16:22 2012 -0500
@@ -61,8 +61,8 @@
 
         return new Sink.ChainedValue<T>(sink) {
             @Override
-            public void apply(T t) {
-                downstream.apply(t);
+            public void accept(T t) {
+                downstream.accept(t);
             }
 
             @Override
@@ -73,7 +73,7 @@
                 // result in buffering of the stream contents
                 Iterator<? extends T> i = stream.iterator();
                 while (i.hasNext()) {
-                    downstream.apply(i.next());
+                    downstream.accept(i.next());
                 }
                 downstream.end();
             }
--- a/src/share/classes/java/util/stream/op/CumulateOp.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/stream/op/CumulateOp.java	Sat Nov 17 12:16:22 2012 -0500
@@ -62,7 +62,7 @@
             }
 
             @Override
-            public void apply(T t) {
+            public void accept(T t) {
                 if (first) {
                     first = false;
                     state = t;
@@ -70,7 +70,7 @@
                 else {
                     state = op.operate(state, t);
                 }
-                sink.apply(state);
+                sink.accept(state);
             }
 
             @Override
--- a/src/share/classes/java/util/stream/op/FilterOp.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/stream/op/FilterOp.java	Sat Nov 17 12:16:22 2012 -0500
@@ -58,9 +58,9 @@
         Objects.requireNonNull(sink);
         return new Sink.ChainedValue<T>(sink) {
             @Override
-            public void apply(T t) {
+            public void accept(T t) {
                 if (predicate.test(t))
-                    downstream.apply(t);
+                    downstream.accept(t);
             }
         };
     }
--- a/src/share/classes/java/util/stream/op/FlatMapOp.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/stream/op/FlatMapOp.java	Sat Nov 17 12:16:22 2012 -0500
@@ -39,9 +39,9 @@
  * @author Brian Goetz
  */
 public class FlatMapOp<T,R> implements IntermediateOp<T, R> {
-    public final FlatMapper<? extends R, ? super T> mapper;
+    public final FlatMapper<? super T, ? extends R> mapper;
 
-    public FlatMapOp(FlatMapper<? extends R, ? super T> mapper) {
+    public FlatMapOp(FlatMapper<? super T, ? extends R> mapper) {
         Objects.requireNonNull(mapper);
         this.mapper = mapper;
     }
@@ -61,13 +61,13 @@
     public Sink<T> wrapSink(int flags, final Sink sink) {
         Objects.requireNonNull(sink);
         return new Sink.ChainedValue<T>(sink) {
-            public void apply(T t) {
+            public void accept(T t) {
                 mapper.flatMapInto(downstream, t);
             }
         };
     }
 
-    public static<T, R> Iterator<R> iterator(final Iterator<T> iterator, final FlatMapper<? extends R, ? super T> mapper) {
+    public static<T, R> Iterator<R> iterator(final Iterator<T> iterator, final FlatMapper<? super T, ? extends R> mapper) {
         return new Iterator<R>() {
             final Iterator<? extends T> source = iterator;
             // @@@ Replace with spined list implementation
--- a/src/share/classes/java/util/stream/op/FoldOp.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/stream/op/FoldOp.java	Sat Nov 17 12:16:22 2012 -0500
@@ -37,16 +37,16 @@
  */
 public class FoldOp<T, U> implements TerminalOp<T, U> {
     private final Supplier<U> seedFactory;
-    private final Combiner<U, U, T> reducer;
+    private final Combiner<U, T, U> reducer;
     private final BinaryOperator<U> combiner;
 
-    public FoldOp(Supplier<U> factory, Combiner<U, U, T> reducer, BinaryOperator<U> combiner) {
+    public FoldOp(Supplier<U> factory, Combiner<U, T, U> reducer, BinaryOperator<U> combiner) {
         this.seedFactory = factory;
         this.reducer = reducer;
         this.combiner = combiner;
     }
 
-    public FoldOp(U seed, Combiner<U, U, T> reducer, BinaryOperator<U> combiner) {
+    public FoldOp(U seed, Combiner<U, T, U> reducer, BinaryOperator<U> combiner) {
         this(()->seed, reducer, combiner);
     }
 
@@ -83,7 +83,7 @@
         }
 
         @Override
-        public void apply(T t) {
+        public void accept(T t) {
             state = reducer.combine(state, t);
         }
 
--- a/src/share/classes/java/util/stream/op/ForEachOp.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/stream/op/ForEachOp.java	Sat Nov 17 12:16:22 2012 -0500
@@ -49,7 +49,7 @@
         return new ForEachOp<>(new TerminalSink<T, Void>() {
          @Override
             public void apply(T t) {
-                block.apply(t);
+                block.accept(t);
             }
 
             @Override
--- a/src/share/classes/java/util/stream/op/GroupByOp.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/stream/op/GroupByOp.java	Sat Nov 17 12:16:22 2012 -0500
@@ -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 Function<? extends K, ? super T> mapper;
+    private final Function<? super T, ? extends K> mapper;
 
     private final Supplier<Collection<T>> valueFactory;
 
-    public GroupByOp(Function<? extends K, ? super T> mapper) {
+    public GroupByOp(Function<? super T, ? extends K> mapper) {
         this(mapper, ArrayList::new);
     }
 
-    public GroupByOp(Function<? extends K, ? super T> mapper, Supplier<Collection<T>> valueFactory) {
+    public GroupByOp(Function<? super T, ? extends K> mapper, Supplier<Collection<T>> valueFactory) {
         this.mapper = mapper;
         this.valueFactory = valueFactory;
     }
@@ -77,7 +77,7 @@
             // 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) {
+                public void accept(T t) {
                     final Collection<T> sb = map.computeIfAbsent(mapper.apply(t), (k) -> valueFactory.get());
                     synchronized (sb) {
                         sb.add(t);
@@ -112,7 +112,7 @@
         }
 
         @Override
-        public void apply(T t) {
+        public void accept(T 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) {
--- a/src/share/classes/java/util/stream/op/MapOp.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/stream/op/MapOp.java	Sat Nov 17 12:16:22 2012 -0500
@@ -37,9 +37,9 @@
  * @author Brian Goetz
  */
 public class MapOp<T, R> implements IntermediateOp<T, R> {
-    public final Function<? extends R, ? super T> mapper;
+    public final Function<? super T, ? extends R> mapper;
 
-    public MapOp(Function<? extends R, ? super T> mapper) {
+    public MapOp(Function<? super T, ? extends R> mapper) {
         this.mapper = Objects.requireNonNull(mapper);
     }
 
@@ -57,8 +57,8 @@
     public Sink<T> wrapSink(int flags, Sink sink) {
         return new Sink.ChainedValue<T>(sink) {
             @Override
-            public void apply(T t) {
-                downstream.apply(mapper.apply(t));
+            public void accept(T t) {
+                downstream.accept(mapper.apply(t));
             }
         };
     }
--- a/src/share/classes/java/util/stream/op/MatchOp.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/stream/op/MatchOp.java	Sat Nov 17 12:16:22 2012 -0500
@@ -25,8 +25,6 @@
 package java.util.stream.op;
 
 import java.util.Iterator;
-import java.util.concurrent.CountedCompleter;
-import java.util.concurrent.atomic.AtomicReference;
 import java.util.function.Function;
 import java.util.function.Predicate;
 import java.util.stream.*;
@@ -38,10 +36,10 @@
  */
 public class MatchOp<T> implements TerminalOp<T, Boolean> {
     private final MatchKind matchKind;
-    private final Function<Boolean, Iterator<? extends T>> impl;
+    private final Function<Iterator<? extends T>, Boolean> impl;
     private final StreamShape inputShape;
 
-    private MatchOp(MatchKind matchKind, Function<Boolean, Iterator<? extends T>> impl, StreamShape shape) {
+    private MatchOp(MatchKind matchKind, Function<Iterator<? extends T>, Boolean> impl, StreamShape shape) {
         this.matchKind = matchKind;
         this.impl = impl;
         inputShape = shape;
--- a/src/share/classes/java/util/stream/op/Nodes.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/stream/op/Nodes.java	Sat Nov 17 12:16:22 2012 -0500
@@ -122,7 +122,7 @@
         @Override
         public void forEach(Block<? super T> block) {
             for (int i = 0; i < curSize; i++) {
-                block.apply(array[i]);
+                block.accept(array[i]);
             }
         }
 
@@ -259,7 +259,7 @@
             nb.begin(-1);
             Iterator<? extends T> i = stream.iterator();
             while (i.hasNext())
-                nb.apply(i.next());
+                nb.accept(i.next());
             nb.end();
 
             return nb.build();
@@ -438,7 +438,7 @@
                 }
                 else {
                     while (iterator.hasNext())
-                        block.apply(iterator.next());
+                        block.accept(iterator.next());
                 }
             }
 
@@ -528,7 +528,7 @@
         }
 
         @Override
-        public void apply(T t) {
+        public void accept(T t) {
             if (curSize < array.length) {
                 array[curSize++] = t;
             } else {
@@ -819,7 +819,7 @@
                     iterator().forEach(block);
                 } else {
                     for (int i = offset; i < endOffset; i++) {
-                        block.apply(elements[i]);
+                        block.accept(elements[i]);
                     }
                     // update only once; reduce heap write traffic
                     offset = endOffset;
@@ -922,13 +922,13 @@
             // completed chunks
             for (int eachChunk = 0; eachChunk < spineIndex; eachChunk++) {
                 for (T t : spine[eachChunk]) {
-                    block.apply(t);
+                    block.accept(t);
                 }
             }
 
             // current chunk
             for (int index = 0; index < chunkIndex; index++) {
-                block.apply(chunk[index]);
+                block.accept(chunk[index]);
             }
         }
 
@@ -953,7 +953,7 @@
         }
 
         @Override
-        public void apply(T t) {
+        public void accept(T t) {
             assert building : "not building";
             add(t);
         }
--- a/src/share/classes/java/util/stream/op/ReduceByOp.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/stream/op/ReduceByOp.java	Sat Nov 17 12:16:22 2012 -0500
@@ -24,7 +24,6 @@
  */
 package java.util.stream.op;
 
-import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Objects;
@@ -41,14 +40,14 @@
  * @author Brian Goetz
  */
 public class ReduceByOp<T, U, W> implements TerminalOp<T,Map<U,W>> {
-    private final Function<? extends U, ? super T> classifier;
+    private final Function<? super T, ? extends U> classifier;
     private final Supplier<W> seedFactory;
-    private final Combiner<W, W, T> reducer;
+    private final Combiner<W, T, W> reducer;
     private final BinaryOperator<W> combiner;
 
-    public ReduceByOp(Function<? extends U, ? super T> classifier,
+    public ReduceByOp(Function<? super T, ? extends U> classifier,
                       Supplier<W> seedFactory,
-                      Combiner<W, W, T> reducer,
+                      Combiner<W, T, W> reducer,
                       BinaryOperator<W> combiner) {
         this.classifier = classifier;
         this.seedFactory = seedFactory;
@@ -76,7 +75,7 @@
             }
 
             @Override
-            public void apply(T t) {
+            public void accept(T t) {
                 U mapped = classifier.apply(t);
                 W rVal = map.get(mapped);
                 if (rVal == null)
@@ -104,7 +103,7 @@
             // 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) {
+                public void accept(T t) {
                     U key = classifier.apply(t);
                     W curValue = map.computeIfAbsent(key, seedFactoryAsCHMFun);
                     while (!map.replace(key, curValue, reducer.combine(curValue, t)))
@@ -139,7 +138,7 @@
         }
 
         @Override
-        public void apply(T t) {
+        public void accept(T 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)
--- a/src/share/classes/java/util/stream/op/SeedlessFoldOp.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/stream/op/SeedlessFoldOp.java	Sat Nov 17 12:16:22 2012 -0500
@@ -77,7 +77,7 @@
         }
 
         @Override
-        public void apply(T t) {
+        public void accept(T t) {
             if (empty) {
                 empty = false;
                 state = t;
@@ -89,7 +89,7 @@
         @Override
         public void combine(FoldingSink other) {
             if (!other.empty)
-                apply(other.state);
+                accept(other.state);
         }
     }
 }
--- a/src/share/classes/java/util/stream/op/SliceOp.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/stream/op/SliceOp.java	Sat Nov 17 12:16:22 2012 -0500
@@ -80,9 +80,9 @@
                 int n = skip;
 
                 @Override
-                public void apply(T t) {
+                public void accept(T t) {
                     if (n == 0) {
-                        downstream.apply(t);
+                        downstream.accept(t);
                     }
                     else {
                         n--;
@@ -262,7 +262,7 @@
             for (int i = 0; iterator.hasNext() && i < skip; i++)
                 iterator.next();
             for (int i = 0; iterator.hasNext() && ((targetSize == -1) || (i < targetSize)); i++)
-                nodeBuilder.apply(iterator.next());
+                nodeBuilder.accept(iterator.next());
             nodeBuilder.end();
             return nodeBuilder.build();
         }
--- a/src/share/classes/java/util/stream/op/SortedOp.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/stream/op/SortedOp.java	Sat Nov 17 12:16:22 2012 -0500
@@ -26,8 +26,6 @@
 
 import java.util.*;
 import java.util.concurrent.ForkJoinUtils;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 import java.util.stream.ParallelPipelineHelper;
 import java.util.stream.Sink;
 import java.util.stream.StreamOpFlags;
@@ -92,13 +90,13 @@
                     Arrays.sort(array, comparator);
                     downstream.begin(array.length);
                     for (T t : array)
-                        downstream.apply(t);
+                        downstream.accept(t);
                     downstream.end();
                     array = null;
                 }
 
                 @Override
-                public void apply(T t) {
+                public void accept(T t) {
                     array[offset++] = t;
                 }
             };
@@ -116,13 +114,13 @@
                 public void end() {
                     list.sort(comparator);
                     downstream.begin(list.size());
-                    list.forEach(e -> downstream.apply(e));
+                    list.forEach(e -> downstream.accept(e));
                     downstream.end();
                     list = null;
                 }
 
                 @Override
-                public void apply(T t) {
+                public void accept(T t) {
                     list.add(t);
                 }
             };
--- a/src/share/classes/java/util/stream/op/TeeOp.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/stream/op/TeeOp.java	Sat Nov 17 12:16:22 2012 -0500
@@ -48,9 +48,9 @@
     public Sink<T> wrapSink(int flags, Sink sink) {
         return new Sink.ChainedValue<T>(sink) {
             @Override
-            public void apply(T t) {
-                tee.apply(t);
-                downstream.apply(t);
+            public void accept(T t) {
+                tee.accept(t);
+                downstream.accept(t);
             }
         };
     }
@@ -67,7 +67,7 @@
             @Override
             public T next() {
                 T next = source.next();
-                tee.apply(next);
+                tee.accept(next);
                 return next;
             }
         };
--- a/src/share/classes/java/util/stream/op/UniqOp.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/stream/op/UniqOp.java	Sat Nov 17 12:16:22 2012 -0500
@@ -26,8 +26,6 @@
 
 import java.util.*;
 import java.util.concurrent.ConcurrentHashMap;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 import java.util.stream.ParallelPipelineHelper;
 import java.util.stream.Sink;
 import java.util.stream.StreamOpFlags;
@@ -79,9 +77,9 @@
                 }
 
                 @Override
-                public void apply(T t) {
+                public void accept(T t) {
                     if (lastSeen == null || !t.equals(lastSeen)) {
-                        downstream.apply(lastSeen = t);
+                        downstream.accept(lastSeen = t);
                     }
                 }
             };
@@ -103,9 +101,9 @@
                 }
 
                 @Override
-                public void apply(T t) {
+                public void accept(T t) {
                     if (seen.add(t)) {
-                        downstream.apply(t);
+                        downstream.accept(t);
                     }
                 }
             };
@@ -207,7 +205,7 @@
                 // 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) {
+                    public void accept(T t) {
                         map.putIfAbsent(t, Boolean.TRUE);
                     }
                 });
@@ -241,7 +239,7 @@
         }
 
         @Override
-        public void apply(T t) {
+        public void accept(T t) {
             set.add(t);
         }
 
@@ -278,9 +276,9 @@
         }
 
         @Override
-        public void apply(T t) {
+        public void accept(T t) {
             if (lastSeen == null || !t.equals(lastSeen)) {
-                super.apply(lastSeen = t);
+                super.accept(lastSeen = t);
             }
         }
     }
--- a/src/share/classes/java/util/stream/primitive/IntBlock.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/stream/primitive/IntBlock.java	Sat Nov 17 12:16:22 2012 -0500
@@ -31,7 +31,7 @@
 public interface IntBlock extends Block<Integer> {
 
     @Override
-    default void apply(Integer i) {
+    default void accept(Integer i) {
         Logger.getLogger(getClass().getName()).log(Level.WARNING, "{0} using boxed int", getClass().getName());
         applyInt(i.intValue());
     }
--- a/src/share/classes/java/util/stream/primitive/IntIterable.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/stream/primitive/IntIterable.java	Sat Nov 17 12:16:22 2012 -0500
@@ -24,7 +24,6 @@
  */
 package java.util.stream.primitive;
 
-import java.util.Iterator;
 import java.util.function.Block;
 
 public interface IntIterable extends Iterable<Integer> {
@@ -37,7 +36,7 @@
         else {
             IntIterator remaining = iterator();
             while (remaining.hasNext()) {
-                sink.apply(remaining.nextInt());
+                sink.accept(remaining.nextInt());
             }
         }
     }
--- a/src/share/classes/java/util/stream/primitive/IntIterator.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/stream/primitive/IntIterator.java	Sat Nov 17 12:16:22 2012 -0500
@@ -47,7 +47,7 @@
         }
         else {
             while (hasNext()) {
-                sink.apply(nextInt());
+                sink.accept(nextInt());
             }
         }
     }
--- a/src/share/classes/java/util/stream/primitive/IntNodes.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/stream/primitive/IntNodes.java	Sat Nov 17 12:16:22 2012 -0500
@@ -26,12 +26,7 @@
 
 import java.util.*;
 import java.util.function.Block;
-import java.util.function.UnaryOperator;
 import java.util.stream.*;
-import java.util.stream.op.CollectorOps;
-import java.util.stream.op.Node;
-import java.util.stream.op.NodeBuilder;
-import java.util.stream.op.TreeUtils;
 
 public class IntNodes {
     public static IntNode node(final int[] array) {
@@ -320,7 +315,7 @@
                 }
                 else {
                     while (iterator.hasNext())
-                        block.apply(iterator.nextInt());
+                        block.accept(iterator.nextInt());
                 }
             }
 
--- a/src/share/classes/java/util/stream/primitive/IntSpliterator.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/stream/primitive/IntSpliterator.java	Sat Nov 17 12:16:22 2012 -0500
@@ -24,10 +24,8 @@
  */
 package java.util.stream.primitive;
 
-import java.util.Iterator;
 import java.util.function.Block;
 import java.util.stream.Spliterator;
-import java.util.stream.Streams;
 
 public interface IntSpliterator extends Spliterator<Integer> {
 
@@ -47,7 +45,7 @@
         else {
             IntIterator remaining = iterator();
             while (remaining.hasNext()) {
-                sink.apply(remaining.nextInt());
+                sink.accept(remaining.nextInt());
             }
         }
     }
--- a/src/share/classes/java/util/stream/primitive/IntToIntegerOp.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/stream/primitive/IntToIntegerOp.java	Sat Nov 17 12:16:22 2012 -0500
@@ -55,7 +55,7 @@
 
             @Override
             public void applyInt(int t) {
-                sink.apply(t);
+                sink.accept(t);
             }
 
             @Override
--- a/src/share/classes/java/util/stream/primitive/Primitives.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/stream/primitive/Primitives.java	Sat Nov 17 12:16:22 2012 -0500
@@ -27,8 +27,6 @@
 import java.util.function.IntSupplier;
 import java.util.*;
 import java.util.function.Block;
-import java.util.function.Supplier;
-import java.util.function.UnaryOperator;
 import java.util.logging.Logger;
 import java.util.stream.*;
 
@@ -79,7 +77,7 @@
 
                 @Override
                 public void applyInt(int i) {
-                    s.apply(i);
+                    s.accept(i);
                 }
 
                 @Override
@@ -101,7 +99,7 @@
             return new IntBlock() {
                 @Override
                 public void applyInt(int i) {
-                    b.apply(i);
+                    b.accept(i);
                 }
             };
         }
--- a/src/share/classes/java/util/stream/primitive/RefToIntMapOp.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/src/share/classes/java/util/stream/primitive/RefToIntMapOp.java	Sat Nov 17 12:16:22 2012 -0500
@@ -69,7 +69,7 @@
             }
 
             @Override
-            public void apply(T t) {
+            public void accept(T t) {
                 intSink.applyInt(mapper.apply(t));
             }
 
--- a/test-ng/tests/org/openjdk/tests/java/util/ComparatorsTest.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/test-ng/tests/org/openjdk/tests/java/util/ComparatorsTest.java	Sat Nov 17 12:16:22 2012 -0500
@@ -133,7 +133,7 @@
         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 Function<String, Thing>() {
+        Comparator<Thing> comp = Comparators.comparing(new Function<Thing, String>() {
             @Override
             public String apply(Thing thing) {
                 return thing.getStringField();
@@ -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((Function<String, People>) People::getFirstName);
-        Comparator<People> cmp2 = Comparators.comparing((Function<String, People>) People::getLastName);
+        Comparator<People> cmp1 = Comparators.comparing((Function<People, String>) People::getFirstName);
+        Comparator<People> cmp2 = Comparators.comparing((Function<People, String>) 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	Sat Nov 17 10:13:03 2012 -0500
+++ b/test-ng/tests/org/openjdk/tests/java/util/LambdaTestHelpers.java	Sat Nov 17 12:16:22 2012 -0500
@@ -26,7 +26,6 @@
 
 import java.util.*;
 import java.util.function.*;
-import java.util.stream.Streamable;
 import java.util.stream.TerminalSink;
 import java.util.stream.Stream;
 
@@ -51,9 +50,9 @@
     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> mfId = /*@@@ Sink::accept*/ (s,e) -> { s.accept(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 FlatMapper<Integer, Integer> mfLt = (s, e) -> { for (int i=0; i<e; i++) s.accept(i); };
     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;
@@ -74,11 +73,11 @@
     public static final BiPredicate<Integer, Integer> bipBothOdd = (x, y) -> 2 == (x % 2 + y % 2);
     public static final BiPredicate<?, ?> bipSameString = (x, y) -> String.valueOf(x).equals(String.valueOf(y));
 
-    public static final FlatMapper<Character, String> flattenChars = new FlatMapper<Character, String>() {
+    public static final FlatMapper<String, Character> flattenChars = new FlatMapper<String, Character>() {
         @Override
         public void flatMapInto(Block<? super Character> sink, String element) {
             for (int i=0; i<element.length(); i++) {
-                sink.apply(element.charAt(i));
+                sink.accept(element.charAt(i));
             }
         }
     };
@@ -300,7 +299,7 @@
     public static <T,V> V iteratorToStatefulSink(Iterator<? extends T> iterator, TerminalSink<? super T, ? extends V> sink) {
         sink.begin(-1);
         while(iterator.hasNext()) {
-            sink.apply(iterator.next());
+            sink.accept(iterator.next());
         }
         sink.end();
         return sink.getAndClearState();
--- a/test-ng/tests/org/openjdk/tests/java/util/NullArgsTestCase.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/test-ng/tests/org/openjdk/tests/java/util/NullArgsTestCase.java	Sat Nov 17 12:16:22 2012 -0500
@@ -52,7 +52,7 @@
 
     @Test
     public void goodNonNull() {
-        sink.apply(args);
+        sink.accept(args);
     }
 
     @Test
@@ -61,7 +61,7 @@
             Object[] temp = Arrays.copyOf(args, args.length);
             temp[i] = null;
             try {
-                sink.apply(temp);
+                sink.accept(temp);
                 fail(String.format("Expected NullPointerException for argument %d of test case %s", i, name));
             }
             catch (NullPointerException e) {
--- a/test-ng/tests/org/openjdk/tests/java/util/function/FunctionsTest.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/test-ng/tests/org/openjdk/tests/java/util/function/FunctionsTest.java	Sat Nov 17 12:16:22 2012 -0500
@@ -77,7 +77,7 @@
 
     @Test
     public void testForPredicate() {
-        Function<String, Integer> mapper = Functions.<String, Integer>forPredicate(x -> x != 0, "true", "false");
+        Function<Integer, String> mapper = Functions.<String, Integer>forPredicate(x -> x != 0, "true", "false");
 
         assertEquals("false", mapper.apply(0));
         assertEquals("true", mapper.apply(1));
@@ -89,7 +89,7 @@
         truths.put(0, "sky");
         truths.put(1, "ice");
 
-        Function<String, Integer> mapper = Functions.<String, Integer>forMap(truths);
+        Function<Integer, String> mapper = Functions.<String, Integer>forMap(truths);
 
         assertEquals("sky", mapper.apply(0));
         assertEquals("ice", mapper.apply(1));
@@ -102,7 +102,7 @@
         truths.put(0, "sky");
         truths.put(1, "ice");
 
-        Function<String, Integer> mapper = Functions.<String, Integer>forMap(truths, "fire");
+        Function<Integer, String> mapper = Functions.<String, Integer>forMap(truths, "fire");
 
         assertEquals("sky", mapper.apply(0));
         assertEquals("ice", mapper.apply(1));
@@ -112,9 +112,9 @@
 
     @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);
+        Function<Integer, Boolean> first = Functions.<Boolean, Integer>forPredicate(x -> x != 0, true, false);
+        Function<Boolean, String> second = Functions.<String, Boolean>forPredicate(x -> !x, "false", "true");
+        Function<Integer, String> mapper = Functions.chain(first, second);
 
         assertEquals("false", mapper.apply(0));
         assertEquals("true", mapper.apply(1));
--- a/test-ng/tests/org/openjdk/tests/java/util/stream/OpTestCase.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/test-ng/tests/org/openjdk/tests/java/util/stream/OpTestCase.java	Sat Nov 17 12:16:22 2012 -0500
@@ -67,22 +67,22 @@
 
         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, Function<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_IN, S_OUT> 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) {
+    public <T, U, S_IN extends BaseStream<T>, S_OUT extends BaseStream<U>> Node<U> exerciseOps(TestData<T, S_IN> data, Function<S_IN, S_OUT> m) {
         return withData(data).
                 using(m).
                 exercise();
     }
 
-    public <T, U, S_OUT extends BaseStream<U>> Node<U> exerciseOps(Collection<T> data, Function<S_OUT, Stream<T>> m) {
+    public <T, U, S_OUT extends BaseStream<U>> Node<U> exerciseOps(Collection<T> data, Function<Stream<T>, S_OUT> 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, Function<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<Stream<T>, S_OUT> m, I expected) {
         return withData(new StreamTestData.CollectionData<>("Collection of type " + data.getClass().getName(), data)).
                 using(m).
                 expectedResult(expected).
@@ -106,7 +106,7 @@
             return new DataIntemediateOpBuilder<>(data);
         }
 
-        public <U, S_OUT extends BaseStream<U>> ExcerciseDataStreamBuilder<T, U, S_IN, S_OUT> using(Function<S_OUT, S_IN> m) {
+        public <U, S_OUT extends BaseStream<U>> ExcerciseDataStreamBuilder<T, U, S_IN, S_OUT> using(Function<S_IN, S_OUT> m) {
             return new ExcerciseDataStreamBuilder<>(data, m);
         }
     }
@@ -137,7 +137,7 @@
     public class ExcerciseDataStreamBuilder<T, U, S_IN extends BaseStream<T>, S_OUT extends BaseStream<U>> {
         final TestData<T, S_IN> data;
 
-        final Function<S_OUT, S_IN> m;
+        final Function<S_IN, S_OUT> m;
 
         final StreamShape shape;
 
@@ -155,7 +155,7 @@
 
         BiPredicate<Iterable<U>, Iterable<U>> parallelEqualator = Objects::equals;
 
-        private ExcerciseDataStreamBuilder(TestData<T, S_IN> data, Function<S_OUT, S_IN> m) {
+        private ExcerciseDataStreamBuilder(TestData<T, S_IN> data, Function<S_IN, S_OUT> m) {
             this.data = data;
 
             this.m = Objects.requireNonNull(m);
@@ -258,14 +258,14 @@
         }
         else {
             // Induce the reference result
-            b.before.apply(b.data);
+            b.before.accept(b.data);
             S_OUT sOut = b.m.apply(b.data.stream());
             refResult = ((AbstractPipeline<?, U>) sOut).collectOutput().flatten();
-            b.after.apply(b.data);
+            b.after.accept(b.data);
         }
 
         for (BaseStreamTestScenario test : b.testSet) {
-            b.before.apply(b.data);
+            b.before.accept(b.data);
 
             NodeBuilder<U> resultBuilder = b.shape.makeNodeBuilder(-1);
             resultBuilder.begin(-1);
@@ -276,7 +276,7 @@
             assertTrue(b.getEqualator(test).test(result, refResult),
                        String.format("%s %s: %s != %s", b.data.toString(), test, refResult, result));
 
-            b.after.apply(b.data);
+            b.after.accept(b.data);
         }
 
         return refResult;
@@ -286,7 +286,7 @@
 
     public <T, U, R, S_IN extends BaseStream<T>> R
     exerciseTerminalOps(TestData<T, S_IN> data,
-                        Function<R, S_IN> terminalF) {
+                        Function<S_IN, R> terminalF) {
         return exerciseTerminalOps(data,
                                    s -> s,
                                    terminalF);
@@ -295,8 +295,8 @@
     @SuppressWarnings({"rawtypes", "unchecked"})
     public <T, U, R, S_IN extends BaseStream<T>, S_OUT extends BaseStream<U>> R
     exerciseTerminalOps(TestData<T, S_IN> data,
-                        Function<S_OUT, S_IN> m,
-                        Function<R, S_OUT> terminalF) {
+                        Function<S_IN, S_OUT> m,
+                        Function<S_OUT, R> terminalF) {
         return exerciseTerminalOps(data,
                                    (u, v) -> Objects.equals(u, v),
                                    m,
@@ -307,8 +307,8 @@
     public <T, U, R, S_IN extends BaseStream<T>, S_OUT extends BaseStream<U>> R
     exerciseTerminalOps(TestData<T, S_IN> data,
                         BiPredicate<R, R> equalator,
-                        Function<S_OUT, S_IN> streamF,
-                        Function<R, S_OUT> terminalF) {
+                        Function<S_IN, S_OUT> streamF,
+                        Function<S_OUT, R> terminalF) {
 
         AbstractPipeline<?, U> ap = (AbstractPipeline<?, U>) streamF.apply(data.stream());
         StreamShape shape = ap.getOutputShape();
--- a/test-ng/tests/org/openjdk/tests/java/util/stream/StreamTestDataProvider.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/test-ng/tests/org/openjdk/tests/java/util/stream/StreamTestDataProvider.java	Sat Nov 17 12:16:22 2012 -0500
@@ -96,11 +96,11 @@
         testData = list.toArray(new Object[0][]);
     }
 
-    static <T> Object[] e(String description, T[] data, Combiner<StreamTestData<T>, String, T[]> m) {
+    static <T> Object[] e(String description, T[] data, Combiner<String, T[], StreamTestData<T>> m) {
         return new Object[] { description, m.combine(description, data) };
     }
 
-    static <T> Object[] e(String description, Collection<T> data, Combiner<StreamTestData<T>, String, Collection<T>> m) {
+    static <T> Object[] e(String description, Collection<T> data, Combiner<String, Collection<T>, StreamTestData<T>> m) {
         return new Object[] { description, m.combine(description, data) };
     }
 
--- a/test-ng/tests/org/openjdk/tests/java/util/stream/StreamTestScenario.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/test-ng/tests/org/openjdk/tests/java/util/stream/StreamTestScenario.java	Sat Nov 17 12:16:22 2012 -0500
@@ -36,51 +36,51 @@
 public enum StreamTestScenario implements OpTestCase.BaseStreamTestScenario {
 
     STREAM_FOR_EACH(false) {
-        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Function<Stream<U>, S_IN> m) {
+        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Function<S_IN, Stream<U>> 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, Function<Stream<U>, S_IN> m) {
+        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Function<S_IN, Stream<U>> m) {
             for (U t : m.apply(data.stream()).into(new ArrayList<U>())) {
-                b.apply(t);
+                b.accept(t);
             }
         }
     },
 
     // 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, Function<Stream<U>, S_IN> m) {
+        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Function<S_IN, Stream<U>> m) {
             for (Object t : m.apply(data.stream()).toArray()) {
-                b.apply((U) t);
+                b.accept((U) t);
             }
         }
     },
 
     // 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, Function<Stream<U>, S_IN> m) {
+        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Function<S_IN, Stream<U>> m) {
             for (Iterator<U> seqIter = m.apply(data.stream()).iterator(); seqIter.hasNext(); )
-                b.apply(seqIter.next());
+                b.accept(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, Function<Stream<U>, S_IN> m) {
+        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Function<S_IN, Stream<U>> m) {
             Stream<U> stream = m.apply(data.stream());
             Iterator<U> iter = stream.iterator();
             if (iter.hasNext())
-                b.apply(iter.next());
+                b.accept(iter.next());
             stream.forEach(b);
         }
     },
 
     // 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, Function<Stream<U>, S_IN> m) {
+        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Function<S_IN, Stream<U>> m) {
             AbstractPipeline<T, T> pipe1 = data.seq(new NoOp(data.getShape()));
             Stream<U> pipe2 = m.apply((S_IN) pipe1);
 
@@ -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, Function<Stream<U>, S_IN> m) {
+        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Function<S_IN, Stream<U>> 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, Function<Stream<U>, S_IN> m) {
+        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Function<S_IN, Stream<U>> m) {
             for (Object t : m.apply(data.parallel()).toArray())
-                b.apply((U) t);
+                b.accept((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, Function<Stream<U>, S_IN> m) {
+        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Function<S_IN, Stream<U>> m) {
             AbstractPipeline<?, ?> pipe1 = data.par(new FlagDeclaringOp(StreamOpFlags.NOT_SIZED) {
                 @Override
                 public StreamShape outputShape() {
@@ -121,50 +121,50 @@
             Stream<U> pipe2 = m.apply((S_IN) pipe1);
 
             for (Object t : pipe2.toArray())
-                b.apply((U) t);
+                b.accept((U) t);
         }
     },
 
     // 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, Function<Stream<U>, S_IN> m) {
+        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Function<S_IN, Stream<U>> m) {
             ArrayList<U> list = m.apply(data.parallel()).sequential().into(new ArrayList<U>());
             for (U u : list)
-                b.apply(u);
+                b.accept(u);
         }
     },
 
     // 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, Function<Stream<U>, S_IN> m) {
+        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Function<S_IN, Stream<U>> m) {
             Stream<U> stream = m.apply(data.parallel());
             Iterator<U> iter = stream.iterator();
             if (iter.hasNext())
-                b.apply(iter.next());
+                b.accept(iter.next());
             for (Object t : stream.toArray())
-                b.apply((U) t);
+                b.accept((U) t);
         }
     },
 
     // 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, Function<Stream<U>, S_IN> m) {
+        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Function<S_IN, Stream<U>> m) {
             AbstractPipeline<T, T> pipe1 = data.seq(new NoOp(data.getShape()));
             Stream<U> pipe2 = m.apply((S_IN) pipe1);
 
             pipe1.iterator();
             for (Object t : pipe2.toArray())
-                b.apply((U) t);
+                b.accept((U) t);
         }
     },
 
     // 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, Function<Stream<U>, S_IN> m) {
+        <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Function<S_IN, Stream<U>> m) {
             Stream<U> stream = m.apply(data.parallel());
             Iterator<U> iter = stream.iterator();
             if (iter.hasNext())
-                b.apply(iter.next());
+                b.accept(iter.next());
             stream.sequential().forEach(b);
         }
     },
@@ -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, Function<S_OUT, S_IN> m) {
-        _run(data, b, (Function<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_IN, S_OUT> m) {
+        _run(data, b, (Function<S_IN, Stream<U>>) 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);
+    abstract <T, U, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, Block<U> b, Function<S_IN, Stream<U>> m);
 }
--- a/test-ng/tests/org/openjdk/tests/java/util/stream/op/FlatMapOpTest.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/test-ng/tests/org/openjdk/tests/java/util/stream/op/FlatMapOpTest.java	Sat Nov 17 12:16:22 2012 -0500
@@ -30,7 +30,6 @@
 import org.testng.annotations.Test;
 
 import java.util.Arrays;
-import java.util.function.Block;
 import java.util.function.FlatMapper;
 import java.util.stream.Stream;
 import java.util.stream.op.FlatMapOp;
@@ -50,7 +49,7 @@
         for (int i = 0; i < 16 && num != 0; i++) {
             if ((num & (1 << i)) != 0) {
                 num &= ~(1 << i);
-                block.apply(i);
+                block.accept(i);
             }
         }
     };
--- a/test-ng/tests/org/openjdk/tests/java/util/stream/op/GroupByOpTest.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/test-ng/tests/org/openjdk/tests/java/util/stream/op/GroupByOpTest.java	Sat Nov 17 12:16:22 2012 -0500
@@ -32,9 +32,7 @@
 import java.util.*;
 import java.util.function.*;
 import java.util.stream.Stream;
-import java.util.stream.StreamOpFlags;
 import java.util.stream.op.GroupByOp;
-import java.util.stream.op.FlagDeclaringOp;
 
 import static org.openjdk.tests.java.util.LambdaTestHelpers.*;
 
@@ -80,10 +78,10 @@
     }
 
     static class MapperData<T, K> {
-        Function<K, T> m;
+        Function<T, K> m;
         int expectedSize;
 
-        MapperData(Function<K, T> m, int expectedSize) {
+        MapperData(Function<T, K> m, int expectedSize) {
             this.m = m;
             this.expectedSize = expectedSize;
         }
--- a/test-ng/tests/org/openjdk/tests/java/util/stream/op/IntNodeTest.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/test-ng/tests/org/openjdk/tests/java/util/stream/op/IntNodeTest.java	Sat Nov 17 12:16:22 2012 -0500
@@ -112,7 +112,7 @@
         }
     }
 
-    IntNode tree(List<Integer> l, Function<IntNode, List<Integer>> m) {
+    IntNode tree(List<Integer> l, Function<List<Integer>, IntNode> m) {
         if (l.size() < 3) {
             return m.apply(l);
         }
--- a/test-ng/tests/org/openjdk/tests/java/util/stream/op/MatchOpTest.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/test-ng/tests/org/openjdk/tests/java/util/stream/op/MatchOpTest.java	Sat Nov 17 12:16:22 2012 -0500
@@ -31,14 +31,10 @@
 
 import java.util.HashMap;
 import java.util.Map;
-import java.util.function.Combiner;
 import java.util.function.Function;
 import java.util.function.Predicate;
-import java.util.function.Supplier;
 import java.util.stream.Stream;
 import java.util.stream.Streamable;
-import java.util.stream.op.FilterOp;
-import java.util.stream.op.MatchOp;
 
 import static java.util.stream.op.MatchOp.MatchKind;
 import static org.openjdk.tests.java.util.LambdaTestHelpers.*;
@@ -83,7 +79,7 @@
 
     @Test(dataProvider = "opArrays", dataProviderClass = StreamTestDataProvider.class)
     public void testOps(String name, StreamTestData<Integer> data) {
-        Map<MatchKind, Function<Function<Boolean, Stream<Integer>>, Predicate<Integer>>> m = new HashMap<>();
+        Map<MatchKind, Function<Predicate<Integer>, Function<Stream<Integer>, Boolean>>> m = new HashMap<>();
         m.put(MatchKind.ANY, p -> s -> s.anyMatch(p));
         m.put(MatchKind.ALL, p -> s -> s.allMatch(p));
         m.put(MatchKind.NONE, p -> s -> s.noneMatch(p));
--- a/test-ng/tests/org/openjdk/tests/java/util/stream/op/NodeBuilderTest.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/test-ng/tests/org/openjdk/tests/java/util/stream/op/NodeBuilderTest.java	Sat Nov 17 12:16:22 2012 -0500
@@ -54,7 +54,7 @@
             ls.add(countTo(size));
         }
 
-        List<Function<NodeBuilder<Integer>, Integer>> ms = Arrays.<Function<NodeBuilder<Integer>, Integer>>asList(
+        List<Function<Integer, NodeBuilder<Integer>>> ms = Arrays.<Function<Integer, NodeBuilder<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 (Function<NodeBuilder<Integer>, Integer> m : ms) {
+            for (Function<Integer, NodeBuilder<Integer>> m : ms) {
                 params[i++] = new Object[]{l, m};
             }
         }
@@ -71,11 +71,11 @@
     }
 
     @Test(dataProvider = "sizes")
-    public void testIteration(List<Integer> l, Function<NodeBuilder<Integer>, Integer> m) {
+    public void testIteration(List<Integer> l, Function<Integer, NodeBuilder<Integer>> m) {
         NodeBuilder<Integer> nb = m.apply(l.size());
         nb.begin(l.size());
         for (int i : l) {
-            nb.apply(i);
+            nb.accept(i);
         }
         nb.end();
 
@@ -101,11 +101,11 @@
     }
 
     @Test(dataProvider = "sizes")
-    public void testUpdate(List<Integer> l, Function<NodeBuilder<Integer>, Integer> m) {
+    public void testUpdate(List<Integer> l, Function<Integer, NodeBuilder<Integer>> m) {
         NodeBuilder<Integer> nb = m.apply(l.size());
         nb.begin(l.size());
         for (int i : l) {
-            nb.apply(i);
+            nb.accept(i);
         }
         nb.end();
 
--- a/test-ng/tests/org/openjdk/tests/java/util/stream/op/NodeTest.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/test-ng/tests/org/openjdk/tests/java/util/stream/op/NodeTest.java	Sat Nov 17 12:16:22 2012 -0500
@@ -77,7 +77,7 @@
     Node<Integer> fill(Integer[] array, NodeBuilder<Integer> nb) {
         nb.begin(array.length);
         for (Integer i : array) {
-            nb.apply(i);
+            nb.accept(i);
         }
         nb.end();
         return nb.build();
@@ -97,7 +97,7 @@
         }
     }
 
-    Node<Integer> tree(List<Integer> l, Function<Node<Integer>, List<Integer>> m) {
+    Node<Integer> tree(List<Integer> l, Function<List<Integer>, Node<Integer>> m) {
         if (l.size() < 3) {
             return m.apply(l);
         }
--- a/test-ng/tests/org/openjdk/tests/java/util/stream/op/TeeOpTest.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/test-ng/tests/org/openjdk/tests/java/util/stream/op/TeeOpTest.java	Sat Nov 17 12:16:22 2012 -0500
@@ -89,7 +89,7 @@
                 list = Collections.<Integer>synchronizedList(new ArrayList<>());
             }
 
-            public void apply(Integer t) {
+            public void accept(Integer t) {
                 list.add(t);
             }
 
--- a/test-ng/tests/org/openjdk/tests/java/util/stream/op/ToArrayOpTest.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/test-ng/tests/org/openjdk/tests/java/util/stream/op/ToArrayOpTest.java	Sat Nov 17 12:16:22 2012 -0500
@@ -74,8 +74,8 @@
         // Double the size of the source
         Object[] objects = exerciseTerminalOps(data, Arrays::equals,
                                                s -> s.flatMap((Block<? super Integer> b, Integer e) -> {
-                                                   b.apply(e);
-                                                   b.apply(e);
+                                                   b.accept(e);
+                                                   b.accept(e);
                                                }),
                                                s -> s.toArray());
         assertTrue(objects.length == data.size() * 2);
@@ -129,7 +129,7 @@
         {
             NodeBuilder<Integer> nodeBuilder = Nodes.makeBuilder(l.size());
             for (Integer i : l) {
-                nodeBuilder.apply(i);
+                nodeBuilder.accept(i);
             }
             Object[] output = Streams.stream(Streams.sequentialSpliterator(nodeBuilder), StreamOpFlags.IS_SIZED | StreamOpFlags.IS_ORDERED).toArray();
             assertEquals(Arrays.asList(output), l);
@@ -139,7 +139,7 @@
             NodeBuilder<Integer> nodeBuilder = Nodes.makeVariableSizeBuilder();
             nodeBuilder.begin(l.size());
             for (Integer i : l) {
-                nodeBuilder.apply(i);
+                nodeBuilder.accept(i);
             }
             nodeBuilder.end();
             Object[] output = Streams.stream(Streams.sequentialSpliterator(nodeBuilder), StreamOpFlags.IS_SIZED | StreamOpFlags.IS_ORDERED).toArray();
--- a/test-ng/tests/org/openjdk/tests/java/util/stream/primitive/IntStreamTestDataProvider.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/test-ng/tests/org/openjdk/tests/java/util/stream/primitive/IntStreamTestDataProvider.java	Sat Nov 17 12:16:22 2012 -0500
@@ -87,7 +87,7 @@
         testData = list.toArray(new Object[0][]);
     }
 
-    static <T> Object[] e(String description, int[] data, Combiner<IntStreamTestData, String, int[]> m) {
+    static <T> Object[] e(String description, int[] data, Combiner<String, int[], IntStreamTestData> m) {
         return new Object[] { description, m.combine(description, data) };
     }
 
--- a/test-ng/tests/org/openjdk/tests/java/util/stream/primitive/IntStreamTestScenario.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/test-ng/tests/org/openjdk/tests/java/util/stream/primitive/IntStreamTestScenario.java	Sat Nov 17 12:16:22 2012 -0500
@@ -40,13 +40,13 @@
 public enum IntStreamTestScenario implements OpTestCase.BaseStreamTestScenario {
 
     STREAM_FOR_EACH(false) {
-        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Function<IntStream, S_IN> m) {
+        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Function<S_IN, IntStream> 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, Function<IntStream, S_IN> m) {
+        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Function<S_IN, IntStream> m) {
             for (int t : m.apply(data.stream()).toArray()) {
                 b.applyInt(t);
             }
@@ -54,14 +54,14 @@
     },
 
     STREAM_ITERATOR(false) {
-        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Function<IntStream, S_IN> m) {
+        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Function<S_IN, IntStream> 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, Function<IntStream, S_IN> m) {
+        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Function<S_IN, IntStream> m) {
             IntStream stream = m.apply(data.stream());
             IntIterator iter = stream.iterator();
             if (iter.hasNext())
@@ -71,7 +71,7 @@
     },
 
     STREAM_MIXED_ITERATOR_FOR_EACH(false) {
-        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Function<IntStream, S_IN> m) {
+        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Function<S_IN, IntStream> m) {
             AbstractPipeline<?, ?> pipe1 = data.seq(new NoOp(data.getShape()));
             IntStream pipe2 = m.apply((S_IN) pipe1);
 
@@ -81,20 +81,20 @@
     },
 
     PAR_STREAM_SEQUENTIAL_FOR_EACH(true) {
-        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Function<IntStream, S_IN> m) {
+        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Function<S_IN, IntStream> 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, Function<IntStream, S_IN> m) {
+        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Function<S_IN, IntStream> 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, Function<IntStream, S_IN> m) {
+        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Function<S_IN, IntStream> m) {
             AbstractPipeline<?, ?> pipe1 = data.par(new FlagDeclaringOp(StreamOpFlags.NOT_SIZED) {
                 @Override
                 public StreamShape outputShape() {
@@ -114,7 +114,7 @@
     },
 
     PAR_STREAM_ITERATOR_TO_ARRAY_MIXED(true) {
-        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Function<IntStream, S_IN> m) {
+        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Function<S_IN, IntStream> m) {
             IntStream stream = m.apply(data.parallel());
             IntIterator iter = stream.iterator();
             if (iter.hasNext())
@@ -125,7 +125,7 @@
     },
 
     PAR_STREAM_MIXED_ITERATOR_TO_ARRAY(true) {
-        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Function<IntStream, S_IN> m) {
+        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Function<S_IN, IntStream> m) {
             AbstractPipeline<?, ?> pipe1 = data.par(new NoOp(data.getShape()));
             IntStream pipe2 = m.apply((S_IN) pipe1);
 
@@ -137,7 +137,7 @@
 
     // 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, Function<IntStream, S_IN> m) {
+        <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> data, IntBlock b, Function<S_IN, IntStream> m) {
             IntStream stream = m.apply(data.parallel());
             IntIterator iter = stream.iterator();
             if (iter.hasNext())
@@ -191,10 +191,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, Function<S_OUT, S_IN> m) {
-        _run(data, (IntBlock) b, (Function<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_IN, S_OUT> m) {
+        _run(data, (IntBlock) b, (Function<S_IN, IntStream>) m);
     }
 
-    abstract <T, S_IN extends BaseStream<T>> void _run(OpTestCase.TestData<T, S_IN> 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, Function<S_IN, IntStream> m);
 
 }
--- a/test-ng/tests/org/openjdk/tests/javac/LambdaTranslationTest1.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/test-ng/tests/org/openjdk/tests/javac/LambdaTranslationTest1.java	Sat Nov 17 12:16:22 2012 -0500
@@ -70,54 +70,54 @@
 
     public void testLambdas() {
         Block<Object> b = t -> {setResult("Sink0::" + t);};
-        b.apply("Howdy");
+        b.accept("Howdy");
         assertResult("Sink0::Howdy");
 
         Block<String> b1 = t -> {setResult("Sink1::" + t);};
-        b1.apply("Rowdy");
+        b1.accept("Rowdy");
         assertResult("Sink1::Rowdy");
 
         for (int i = 5; i < 10; ++i) {
             Block<Integer> b2 = t -> {setResult("Sink2::" + t);};
-            b2.apply(i);
+            b2.accept(i);
             assertResult("Sink2::" + i);
         }
 
         Block<Integer> b3 = t -> {setResult("Sink3::" + t);};
         for (int i = 900; i > 0; i -= 100) {
-            b3.apply(i);
+            b3.accept(i);
             assertResult("Sink3::" + i);
         }
 
         cntxt = "blah";
         Block<String> b4 = t -> {setResult(String.format("b4: %s .. %s", cntxt, t));};
-        b4.apply("Yor");
+        b4.accept("Yor");
         assertResult("b4: blah .. Yor");
 
         String flaw = "flaw";
         Block<String> b5 = t -> {setResult(String.format("b5: %s .. %s", flaw, t));};
-        b5.apply("BB");
+        b5.accept("BB");
         assertResult("b5: flaw .. BB");
 
         cntxt = "flew";
         Block<String> b6 = t -> {setResult(String.format("b6: %s .. %s .. %s", t, cntxt, flaw));};
-        b6.apply("flee");
+        b6.accept("flee");
         assertResult("b6: flee .. flew .. flaw");
 
         Block<String> b7 = t -> {setResult(String.format("b7: %s %s", t, this.protectedSuperclassMethod()));};
-        b7.apply("this:");
+        b7.accept("this:");
         assertResult("b7: this: instance:flew");
 
         Block<String> b8 = t -> {setResult(String.format("b8: %s %s", t, super.protectedSuperclassMethod()));};
-        b8.apply("super:");
+        b8.accept("super:");
         assertResult("b8: super: I'm the sub");
 
         Block<String> b7b = t -> {setResult(String.format("b9: %s %s", t, protectedSuperclassMethod()));};
-        b7b.apply("implicit this:");
+        b7b.accept("implicit this:");
         assertResult("b9: implicit this: instance:flew");
 
         Block<Object> b10 = t -> {setResult(String.format("b10: new LT1Thing: %s", (new LT1Thing(t)).str));};
-        b10.apply("thing");
+        b10.accept("thing");
         assertResult("b10: new LT1Thing: thing");
 
         Block<Object> b11 = t -> {setResult(String.format("b11: %s", (new LT1Thing(t) {
@@ -125,7 +125,7 @@
                 return "*" + str.toString() + "*";
             }
         }).get()));};
-        b11.apply(999);
+        b11.accept(999);
         assertResult("b11: *999*");
     }
 
@@ -163,16 +163,16 @@
 
         void doInner() {
             Block<String> i4 = t -> {setResult(String.format("i4: %d .. %s", that, t));};
-            i4.apply("=1234");
+            i4.accept("=1234");
             assertResult("i4: 1234 .. =1234");
 
             Block<String> i5 = t -> {setResult(""); appendResult(t); appendResult(t);};
-            i5.apply("fruit");
+            i5.accept("fruit");
             assertResult("fruitfruit");
 
             cntxt = "human";
             Block<String> b4 = t -> {setResult(String.format("b4: %s .. %s", cntxt, t));};
-            b4.apply("bin");
+            b4.accept("bin");
             assertResult("b4: human .. bin");
 
             final String flaw = "flaw";
@@ -183,16 +183,16 @@
  **/
 
             Block<String> b5 = t -> {setResult(String.format("b5: %s .. %s", flaw, t));};
-            b5.apply("BB");
+            b5.accept("BB");
             assertResult("b5: flaw .. BB");
 
             cntxt = "borg";
             Block<String> b6 = t -> {setResult(String.format("b6: %s .. %s .. %s", t, cntxt, flaw));};
-            b6.apply("flee");
+            b6.accept("flee");
             assertResult("b6: flee .. borg .. flaw");
 
             Block<String> b7b = t -> {setResult(String.format("b7b: %s %s", t, protectedSuperclassMethod()));};
-            b7b.apply("implicit outer this");
+            b7b.accept("implicit outer this");
             assertResult("b7b: implicit outer this instance:borg");
 
             /**
--- a/test-ng/tests/org/openjdk/tests/javac/MethodReferenceTestInstanceMethod.java	Sat Nov 17 10:13:03 2012 -0500
+++ b/test-ng/tests/org/openjdk/tests/javac/MethodReferenceTestInstanceMethod.java	Sat Nov 17 12:16:22 2012 -0500
@@ -43,7 +43,7 @@
     }
 
     class Thingy<T,U> {
-        U blah(Function<U, T> m, T val) {
+        U blah(Function<T, U> m, T val) {
 	    return m.apply(val);
         }
     }