polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [03/24] zest-java git commit: ZEST-112, Replaced org.apache.zest.functional.Function and org.apache.zest.functional.Function2 with java.util.functional.Function and java.util.functional.BiFunction
Date Wed, 26 Aug 2015 15:45:06 GMT
http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/functional/src/test/java/org/apache/zest/functional/FunctionsTest.java
----------------------------------------------------------------------
diff --git a/core/functional/src/test/java/org/apache/zest/functional/FunctionsTest.java b/core/functional/src/test/java/org/apache/zest/functional/FunctionsTest.java
index 0c9ea0f..bb2428c 100644
--- a/core/functional/src/test/java/org/apache/zest/functional/FunctionsTest.java
+++ b/core/functional/src/test/java/org/apache/zest/functional/FunctionsTest.java
@@ -23,6 +23,7 @@ import java.util.Comparator;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.function.Function;
 import org.junit.Test;
 
 import static org.hamcrest.CoreMatchers.equalTo;
@@ -46,7 +47,7 @@ public class FunctionsTest
     Function<Object, String> stringifier = new Function<Object, String>()
     {
         @Override
-        public String map( Object s )
+        public String apply( Object s )
         {
             return s.toString();
         }
@@ -55,7 +56,7 @@ public class FunctionsTest
     Function<String, Integer> length = new Function<String, Integer>()
     {
         @Override
-        public Integer map( String s )
+        public Integer apply( String s )
         {
             return s.length();
         }
@@ -65,9 +66,9 @@ public class FunctionsTest
     public void testCompose()
     {
         assertThat( Functions.<Object, String, Integer>compose()
-                        .map( length, stringifier )
-                        .map( 12345L ), equalTo( 5 ) );
-        assertThat( compose( length, stringifier ).map( 12345L ), equalTo( 5 ) );
+                        .apply( length, stringifier )
+                        .apply( 12345L ), equalTo( 5 ) );
+        assertThat( compose( length, stringifier ).apply( 12345L ), equalTo( 5 ) );
     }
 
     @Test
@@ -130,7 +131,7 @@ public class FunctionsTest
         Comparator<Integer> comparator = Functions.comparator( new Function<Integer, Comparable>()
         {
             @Override
-            public Comparable map( Integer integer )
+            public Comparable apply( Integer integer )
             {
                 return integer.toString();
             }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/functional/src/test/java/org/apache/zest/functional/IterablesTest.java
----------------------------------------------------------------------
diff --git a/core/functional/src/test/java/org/apache/zest/functional/IterablesTest.java b/core/functional/src/test/java/org/apache/zest/functional/IterablesTest.java
index e970666..3171fbc 100644
--- a/core/functional/src/test/java/org/apache/zest/functional/IterablesTest.java
+++ b/core/functional/src/test/java/org/apache/zest/functional/IterablesTest.java
@@ -18,6 +18,7 @@ import java.util.Collection;
 import java.util.Comparator;
 import java.util.Enumeration;
 import java.util.List;
+import java.util.function.Function;
 import org.hamcrest.CoreMatchers;
 import org.junit.Test;
 
@@ -103,7 +104,7 @@ public class IterablesTest
             int sum = 0;
 
             @Override
-            public Integer map( Integer number )
+            public Integer apply( Integer number )
             {
                 return sum += number;
             }
@@ -172,7 +173,7 @@ public class IterablesTest
         assertThat( Iterables.toList( Iterables.map( new Function<String, String>()
         {
 
-            public String map( String s )
+            public String apply( String s )
             {
                 return s + s;
             }
@@ -184,7 +185,7 @@ public class IterablesTest
         {
 
             @Override
-            public Integer map( Collection collection )
+            public Integer apply( Collection collection )
             {
                 return collection.size();
             }
@@ -231,7 +232,7 @@ public class IterablesTest
         {
 
             @Override
-            public String map( String s )
+            public String apply( String s )
             {
                 return s + ":" + s.length();
             }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/functional/src/test/java/org/apache/zest/functional/SpecificationsTest.java
----------------------------------------------------------------------
diff --git a/core/functional/src/test/java/org/apache/zest/functional/SpecificationsTest.java b/core/functional/src/test/java/org/apache/zest/functional/SpecificationsTest.java
index 7a1601d..7767ffe 100644
--- a/core/functional/src/test/java/org/apache/zest/functional/SpecificationsTest.java
+++ b/core/functional/src/test/java/org/apache/zest/functional/SpecificationsTest.java
@@ -14,6 +14,7 @@
 
 package org.apache.zest.functional;
 
+import java.util.function.Function;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -74,7 +75,7 @@ public class SpecificationsTest
         Function<Object, String> stringifier = new Function<Object, String>()
         {
             @Override
-            public String map( Object s )
+            public String apply( Object s )
             {
                 return s.toString();
             }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/io/src/main/java/org/apache/zest/io/Transforms.java
----------------------------------------------------------------------
diff --git a/core/io/src/main/java/org/apache/zest/io/Transforms.java b/core/io/src/main/java/org/apache/zest/io/Transforms.java
index b17c542..db5890f 100644
--- a/core/io/src/main/java/org/apache/zest/io/Transforms.java
+++ b/core/io/src/main/java/org/apache/zest/io/Transforms.java
@@ -19,8 +19,8 @@ import java.nio.charset.Charset;
 import java.text.MessageFormat;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.locks.Lock;
+import java.util.function.Function;
 import java.util.logging.Logger;
-import org.apache.zest.functional.Function;
 import org.apache.zest.functional.Specification;
 
 /**
@@ -105,7 +105,7 @@ public class Transforms
                             public void receive( From item )
                                 throws ReceiverThrowableType
                             {
-                                receiver.receive( function.map( item ) );
+                                receiver.receive( function.apply( item ) );
                             }
                         } );
                     }
@@ -151,7 +151,7 @@ public class Transforms
                             {
                                 if( specification.satisfiedBy( item ) )
                                 {
-                                    receiver.receive( function.map( item ) );
+                                    receiver.receive( function.apply( item ) );
                                 }
                                 else
                                 {
@@ -291,7 +291,7 @@ public class Transforms
         }
 
         @Override
-        public T map( T t )
+        public T apply( T t )
         {
             count++;
             return t;
@@ -314,7 +314,7 @@ public class Transforms
         }
 
         @Override
-        public byte[] map( String s )
+        public byte[] apply( String s )
         {
             return s.getBytes( charSet );
         }
@@ -334,7 +334,7 @@ public class Transforms
         }
 
         @Override
-        public String map( ByteBuffer buffer )
+        public String apply( ByteBuffer buffer )
         {
             return new String( buffer.array(), charSet );
         }
@@ -348,7 +348,7 @@ public class Transforms
         implements Function<Object, String>
     {
         @Override
-        public String map( Object o )
+        public String apply( Object o )
         {
             return o.toString();
         }
@@ -373,7 +373,7 @@ public class Transforms
         }
 
         @Override
-        public T map( T item )
+        public T apply( T item )
         {
             logger.info( format.format( new String[]{ item.toString() } ) );
             return item;
@@ -412,9 +412,9 @@ public class Transforms
         }
 
         @Override
-        public T map( T t )
+        public T apply( T t )
         {
-            counter.map( t );
+            counter.apply( t );
             if( counter.count % interval == 0 )
             {
                 logProgress();
@@ -427,7 +427,7 @@ public class Transforms
         {
             if( log != null )
             {
-                log.map( counter.count + "" );
+                log.apply( counter.count + "" );
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/io/src/test/java/org/apache/zest/io/InputOutputTest.java
----------------------------------------------------------------------
diff --git a/core/io/src/test/java/org/apache/zest/io/InputOutputTest.java b/core/io/src/test/java/org/apache/zest/io/InputOutputTest.java
index bc40f2e..d1d6c0e 100644
--- a/core/io/src/test/java/org/apache/zest/io/InputOutputTest.java
+++ b/core/io/src/test/java/org/apache/zest/io/InputOutputTest.java
@@ -33,11 +33,11 @@ import java.util.Arrays;
 import java.util.List;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
+import java.util.function.Function;
 import java.util.logging.Logger;
 import org.hamcrest.CoreMatchers;
 import org.junit.Assert;
 import org.junit.Test;
-import org.apache.zest.functional.Function;
 import org.apache.zest.functional.Visitor;
 
 import static java.util.Arrays.asList;
@@ -176,7 +176,7 @@ public class InputOutputTest
                 stringCounter,
                 Transforms.map( new Function<String, String>()
                 {
-                    public String map( String s )
+                    public String apply( String s )
                     {
                         System.out.println( s );
                         return s;
@@ -205,7 +205,7 @@ public class InputOutputTest
                 stringCounter,
                 Transforms.map( new Function<String, String>()
             {
-                public String map( String s )
+                public String apply( String s )
                 {
                     System.out.println( s );
                     return s;

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/main/java/org/apache/zest/runtime/association/AbstractAssociationInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/association/AbstractAssociationInstance.java b/core/runtime/src/main/java/org/apache/zest/runtime/association/AbstractAssociationInstance.java
index 7dcfd1c..374cd1e 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/association/AbstractAssociationInstance.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/association/AbstractAssociationInstance.java
@@ -19,10 +19,10 @@
 package org.apache.zest.runtime.association;
 
 import java.lang.reflect.Type;
+import java.util.function.BiFunction;
 import org.apache.zest.api.association.AbstractAssociation;
 import org.apache.zest.api.entity.EntityReference;
 import org.apache.zest.api.entity.Identity;
-import org.apache.zest.functional.Function2;
 
 /**
  * Implementation of AbstractAssociation. Includes helper methods for subclasses
@@ -31,10 +31,10 @@ public abstract class AbstractAssociationInstance<T>
     implements AbstractAssociation
 {
     protected AssociationInfo associationInfo;
-    private final Function2<EntityReference, Type, Object> entityFunction;
+    private final BiFunction<EntityReference, Type, Object> entityFunction;
 
     public AbstractAssociationInstance( AssociationInfo associationInfo,
-                                        Function2<EntityReference, Type, Object> entityFunction
+                                        BiFunction<EntityReference, Type, Object> entityFunction
     )
     {
         this.associationInfo = associationInfo;
@@ -59,7 +59,7 @@ public abstract class AbstractAssociationInstance<T>
             return null;
         }
 
-        return (T) entityFunction.map( entityId, associationInfo.type() );
+        return (T) entityFunction.apply( entityId, associationInfo.type() );
     }
 
     protected EntityReference getEntityReference( Object composite )

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/main/java/org/apache/zest/runtime/association/AssociationInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/association/AssociationInstance.java b/core/runtime/src/main/java/org/apache/zest/runtime/association/AssociationInstance.java
index 84568d4..d79bdfa 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/association/AssociationInstance.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/association/AssociationInstance.java
@@ -15,13 +15,13 @@
 package org.apache.zest.runtime.association;
 
 import java.lang.reflect.Type;
+import java.util.function.BiFunction;
 import org.apache.zest.api.association.Association;
 import org.apache.zest.api.association.AssociationDescriptor;
 import org.apache.zest.api.association.AssociationWrapper;
 import org.apache.zest.api.entity.EntityReference;
 import org.apache.zest.api.entity.Identity;
 import org.apache.zest.api.property.Property;
-import org.apache.zest.functional.Function2;
 
 /**
  * Implementation of Association to a single Entity.
@@ -33,7 +33,7 @@ public final class AssociationInstance<T>
     private Property<EntityReference> associationState;
 
     public AssociationInstance( AssociationInfo associationInfo,
-                                Function2<EntityReference, Type, Object> entityFunction,
+                                BiFunction<EntityReference, Type, Object> entityFunction,
                                 Property<EntityReference> associationState
     )
     {

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/main/java/org/apache/zest/runtime/association/ManyAssociationInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/association/ManyAssociationInstance.java b/core/runtime/src/main/java/org/apache/zest/runtime/association/ManyAssociationInstance.java
index 4dce5a7..33506dc 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/association/ManyAssociationInstance.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/association/ManyAssociationInstance.java
@@ -24,13 +24,13 @@ import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
+import java.util.function.BiFunction;
 import org.apache.zest.api.association.AssociationDescriptor;
 import org.apache.zest.api.association.ManyAssociation;
 import org.apache.zest.api.association.ManyAssociationWrapper;
 import org.apache.zest.api.entity.EntityReference;
 import org.apache.zest.api.entity.Identity;
 import org.apache.zest.api.util.NullArgumentException;
-import org.apache.zest.functional.Function2;
 import org.apache.zest.functional.Iterables;
 import org.apache.zest.spi.entity.ManyAssociationState;
 
@@ -44,7 +44,7 @@ public class ManyAssociationInstance<T>
     private ManyAssociationState manyAssociationState;
 
     public ManyAssociationInstance( AssociationInfo associationInfo,
-                                    Function2<EntityReference, Type, Object> associationFunction,
+                                    BiFunction<EntityReference, Type, Object> associationFunction,
                                     ManyAssociationState manyAssociationState
     )
     {

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/main/java/org/apache/zest/runtime/association/ManyAssociationModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/association/ManyAssociationModel.java b/core/runtime/src/main/java/org/apache/zest/runtime/association/ManyAssociationModel.java
index fe35926..73fa70c 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/association/ManyAssociationModel.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/association/ManyAssociationModel.java
@@ -24,6 +24,7 @@ import java.lang.reflect.Method;
 import java.lang.reflect.Type;
 import java.lang.reflect.TypeVariable;
 import java.util.List;
+import java.util.function.BiFunction;
 import org.apache.zest.api.association.AssociationDescriptor;
 import org.apache.zest.api.association.GenericAssociationInfo;
 import org.apache.zest.api.association.ManyAssociation;
@@ -37,7 +38,6 @@ import org.apache.zest.api.entity.Queryable;
 import org.apache.zest.api.property.Immutable;
 import org.apache.zest.api.util.Classes;
 import org.apache.zest.bootstrap.BindingException;
-import org.apache.zest.functional.Function2;
 import org.apache.zest.functional.Visitable;
 import org.apache.zest.functional.Visitor;
 import org.apache.zest.runtime.composite.ValueConstraintsInstance;
@@ -142,12 +142,12 @@ public final class ManyAssociationModel
 
     public <T> ManyAssociation<T> newInstance( final ModuleUnitOfWork uow, EntityState state )
     {
-        return new ManyAssociationInstance<>( state instanceof BuilderEntityState ? builderInfo : this, new Function2<EntityReference, Type, Object>()
+        return new ManyAssociationInstance<>( state instanceof BuilderEntityState ? builderInfo : this, new BiFunction<EntityReference, Type, Object>()
         {
             @Override
-            public Object map( EntityReference entityReference, Type type )
+            public Object apply( EntityReference entityReference, Type type )
             {
-                return uow.get( Classes.RAW_CLASS.map( type ), entityReference.identity() );
+                return uow.get( Classes.RAW_CLASS.apply( type ), entityReference.identity() );
             }
         }, state.manyAssociationValueOf( qualifiedName ) );
     }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/main/java/org/apache/zest/runtime/association/NamedAssociationInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/association/NamedAssociationInstance.java b/core/runtime/src/main/java/org/apache/zest/runtime/association/NamedAssociationInstance.java
index 46e8b87..7d1385b 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/association/NamedAssociationInstance.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/association/NamedAssociationInstance.java
@@ -22,14 +22,14 @@ import java.lang.reflect.Type;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.function.BiFunction;
+import java.util.function.Function;
 import org.apache.zest.api.association.AssociationDescriptor;
 import org.apache.zest.api.association.NamedAssociation;
 import org.apache.zest.api.association.NamedAssociationWrapper;
 import org.apache.zest.api.entity.EntityReference;
 import org.apache.zest.api.entity.Identity;
 import org.apache.zest.api.util.NullArgumentException;
-import org.apache.zest.functional.Function;
-import org.apache.zest.functional.Function2;
 import org.apache.zest.spi.entity.NamedAssociationState;
 
 import static org.apache.zest.functional.Iterables.map;
@@ -42,7 +42,7 @@ public class NamedAssociationInstance<T>
     private final NamedAssociationState namedAssociationState;
 
     public NamedAssociationInstance( AssociationInfo associationInfo,
-                                     Function2<EntityReference, Type, Object> associationFunction,
+                                     BiFunction<EntityReference, Type, Object> associationFunction,
                                      NamedAssociationState namedAssociationState
     )
     {
@@ -114,7 +114,7 @@ public class NamedAssociationInstance<T>
         return map( new Function<String, EntityReference>()
         {
             @Override
-            public EntityReference map( String name )
+            public EntityReference apply( String name )
             {
                 return namedAssociationState.get( name );
             }
@@ -132,7 +132,7 @@ public class NamedAssociationInstance<T>
         return map( new Function<String, Map.Entry<String, EntityReference>>()
         {
             @Override
-            public Map.Entry<String, EntityReference> map( final String key )
+            public Map.Entry<String, EntityReference> apply( final String key )
             {
                 final EntityReference value = namedAssociationState.get( key );
                 return new Map.Entry<String, EntityReference>()

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/main/java/org/apache/zest/runtime/association/NamedAssociationModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/association/NamedAssociationModel.java b/core/runtime/src/main/java/org/apache/zest/runtime/association/NamedAssociationModel.java
index d4dd6a6..82a7af5 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/association/NamedAssociationModel.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/association/NamedAssociationModel.java
@@ -25,6 +25,7 @@ import java.lang.reflect.Method;
 import java.lang.reflect.Type;
 import java.lang.reflect.TypeVariable;
 import java.util.List;
+import java.util.function.BiFunction;
 import org.apache.zest.api.association.AssociationDescriptor;
 import org.apache.zest.api.association.GenericAssociationInfo;
 import org.apache.zest.api.association.NamedAssociation;
@@ -38,7 +39,6 @@ import org.apache.zest.api.entity.Queryable;
 import org.apache.zest.api.property.Immutable;
 import org.apache.zest.api.util.Classes;
 import org.apache.zest.bootstrap.BindingException;
-import org.apache.zest.functional.Function2;
 import org.apache.zest.functional.Visitable;
 import org.apache.zest.functional.Visitor;
 import org.apache.zest.runtime.composite.ValueConstraintsInstance;
@@ -143,12 +143,12 @@ public final class NamedAssociationModel
 
     public <T> NamedAssociation<T> newInstance( final ModuleUnitOfWork uow, EntityState state )
     {
-        return new NamedAssociationInstance<>( state instanceof BuilderEntityState ? builderInfo : this, new Function2<EntityReference, Type, Object>()
+        return new NamedAssociationInstance<>( state instanceof BuilderEntityState ? builderInfo : this, new BiFunction<EntityReference, Type, Object>()
         {
             @Override
-            public Object map( EntityReference entityReference, Type type )
+            public Object apply( EntityReference entityReference, Type type )
             {
-                return uow.get( Classes.RAW_CLASS.map( type ), entityReference.identity() );
+                return uow.get( Classes.RAW_CLASS.apply( type ), entityReference.identity() );
             }
         }, state.namedAssociationValueOf( qualifiedName ) );
     }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/main/java/org/apache/zest/runtime/bootstrap/CompositeAssemblyImpl.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/bootstrap/CompositeAssemblyImpl.java b/core/runtime/src/main/java/org/apache/zest/runtime/bootstrap/CompositeAssemblyImpl.java
index 458ff79..5ab762f 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/bootstrap/CompositeAssemblyImpl.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/bootstrap/CompositeAssemblyImpl.java
@@ -32,6 +32,7 @@ import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
+import java.util.function.Function;
 import org.apache.zest.api.common.MetaInfo;
 import org.apache.zest.api.common.Optional;
 import org.apache.zest.api.common.QualifiedName;
@@ -58,7 +59,6 @@ import org.apache.zest.api.util.Classes;
 import org.apache.zest.api.util.Fields;
 import org.apache.zest.bootstrap.StateDeclarations;
 import org.apache.zest.functional.ForEach;
-import org.apache.zest.functional.Function;
 import org.apache.zest.functional.HierarchicalVisitorAdapter;
 import org.apache.zest.functional.Iterables;
 import org.apache.zest.functional.Specification;
@@ -399,7 +399,7 @@ public abstract class CompositeAssemblyImpl
                             return true;
                         }
                     };
-                    ForEach.forEach( Fields.FIELDS_OF.map( model.mixinClass() ) ).
+                    ForEach.forEach( Fields.FIELDS_OF.apply( model.mixinClass() ) ).
                         filter( Annotations.hasAnnotation( State.class ) ).
                         visit( addState );
                     return false;
@@ -420,7 +420,7 @@ public abstract class CompositeAssemblyImpl
             return; // Skip already registered names
         }
 
-        if( Property.class.isAssignableFrom( Classes.RAW_CLASS.map( typeOf( accessor ) ) ) )
+        if( Property.class.isAssignableFrom( Classes.RAW_CLASS.apply( typeOf( accessor ) ) ) )
         {
             propertiesModel.addProperty( newPropertyModel( accessor, constraintClasses ) );
             registeredStateNames.add( stateName );
@@ -694,7 +694,7 @@ public abstract class CompositeAssemblyImpl
         Function<Type, Iterable<Class<? extends Constraint<?, ?>>>> function = new Function<Type, Iterable<Class<? extends Constraint<?, ?>>>>()
         {
             @Override
-            public Iterable<Class<? extends Constraint<?, ?>>> map( Type type )
+            public Iterable<Class<? extends Constraint<?, ?>>> apply( Type type )
             {
                 Constraints constraints = Annotations.annotationOn( type, Constraints.class );
                 if( constraints == null )
@@ -724,7 +724,7 @@ public abstract class CompositeAssemblyImpl
         Function<Type, Iterable<Class<?>>> function = new Function<Type, Iterable<Class<?>>>()
         {
             @Override
-            public Iterable<Class<?>> map( Type type )
+            public Iterable<Class<?>> apply( Type type )
             {
                 Concerns concerns = Annotations.annotationOn( type, Concerns.class );
                 if( concerns == null )
@@ -754,7 +754,7 @@ public abstract class CompositeAssemblyImpl
         Function<Type, Iterable<Class<?>>> function = new Function<Type, Iterable<Class<?>>>()
         {
             @Override
-            public Iterable<Class<?>> map( Type type )
+            public Iterable<Class<?>> apply( Type type )
             {
                 SideEffects sideEffects = Annotations.annotationOn( type, SideEffects.class );
                 if( sideEffects == null )
@@ -818,7 +818,7 @@ public abstract class CompositeAssemblyImpl
         Function<Type, Iterable<Class<?>>> function = new Function<Type, Iterable<Class<?>>>()
         {
             @Override
-            public Iterable<Class<?>> map( Type type )
+            public Iterable<Class<?>> apply( Type type )
             {
                 Mixins mixins = Annotations.annotationOn( type, Mixins.class );
                 if( mixins == null )

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/main/java/org/apache/zest/runtime/bootstrap/EntityAssemblyImpl.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/bootstrap/EntityAssemblyImpl.java b/core/runtime/src/main/java/org/apache/zest/runtime/bootstrap/EntityAssemblyImpl.java
index 6daba43..23c0eb6 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/bootstrap/EntityAssemblyImpl.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/bootstrap/EntityAssemblyImpl.java
@@ -139,7 +139,7 @@ public final class EntityAssemblyImpl
             return; // Skip already registered names
         }
 
-        Class<?> accessorType = Classes.RAW_CLASS.map( typeOf( accessor ) );
+        Class<?> accessorType = Classes.RAW_CLASS.apply( typeOf( accessor ) );
         if( Property.class.isAssignableFrom( accessorType ) )
         {
             propertiesModel.addProperty( newPropertyModel( accessor, constraintClasses ) );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/main/java/org/apache/zest/runtime/bootstrap/ServiceAssemblyImpl.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/bootstrap/ServiceAssemblyImpl.java b/core/runtime/src/main/java/org/apache/zest/runtime/bootstrap/ServiceAssemblyImpl.java
index 530aeb7..fc1e91b 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/bootstrap/ServiceAssemblyImpl.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/bootstrap/ServiceAssemblyImpl.java
@@ -17,6 +17,7 @@ package org.apache.zest.runtime.bootstrap;
 import java.lang.reflect.Type;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.function.Function;
 import org.apache.zest.api.activation.Activator;
 import org.apache.zest.api.activation.Activators;
 import org.apache.zest.api.common.InvalidApplicationException;
@@ -25,7 +26,6 @@ import org.apache.zest.api.util.Annotations;
 import org.apache.zest.api.util.Classes;
 import org.apache.zest.bootstrap.ServiceAssembly;
 import org.apache.zest.bootstrap.StateDeclarations;
-import org.apache.zest.functional.Function;
 import org.apache.zest.functional.Iterables;
 import org.apache.zest.runtime.activation.ActivatorsModel;
 import org.apache.zest.runtime.service.ServiceModel;
@@ -88,7 +88,7 @@ public final class ServiceAssemblyImpl extends CompositeAssemblyImpl
         Function<Type, Iterable<Class<? extends Activator<?>>>> function = new Function<Type, Iterable<Class<? extends Activator<?>>>>()
         {
             @Override
-            public Iterable<Class<? extends Activator<?>>> map( Type type )
+            public Iterable<Class<? extends Activator<?>>> apply( Type type )
             {
                 Activators activators = Annotations.annotationOn( type, Activators.class );
                 if( activators == null )

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/main/java/org/apache/zest/runtime/bootstrap/ValueAssemblyImpl.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/bootstrap/ValueAssemblyImpl.java b/core/runtime/src/main/java/org/apache/zest/runtime/bootstrap/ValueAssemblyImpl.java
index 268ba75..e3d9c5d 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/bootstrap/ValueAssemblyImpl.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/bootstrap/ValueAssemblyImpl.java
@@ -118,7 +118,7 @@ public final class ValueAssemblyImpl
             return; // Skip already registered names
         }
 
-        Class<?> accessorType = Classes.RAW_CLASS.map( typeOf( accessor ) );
+        Class<?> accessorType = Classes.RAW_CLASS.apply( typeOf( accessor ) );
         if( Property.class.isAssignableFrom( accessorType ) )
         {
             propertiesModel.addProperty( newPropertyModel( accessor, constraintClasses ) );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/main/java/org/apache/zest/runtime/composite/ConstraintDeclaration.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/composite/ConstraintDeclaration.java b/core/runtime/src/main/java/org/apache/zest/runtime/composite/ConstraintDeclaration.java
index 18184cc..bff8a1a 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/composite/ConstraintDeclaration.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/composite/ConstraintDeclaration.java
@@ -51,14 +51,14 @@ public final class ConstraintDeclaration
         if( constraintValueType instanceof Class )
         {
             Class constraintValueClass = (Class) constraintValueType;
-            Class valueClass = Classes.RAW_CLASS.map( valueType );
+            Class valueClass = Classes.RAW_CLASS.apply( valueType );
             return constraintAnnotationType.equals( annotationType ) && constraintValueClass.isAssignableFrom( valueClass );
         }
         else if( constraintValueType instanceof ParameterizedType )
         {
             // TODO Handle nested generics
-            Class constraintValueClass = Classes.RAW_CLASS.map( constraintValueType );
-            Class valueClass = Classes.RAW_CLASS.map( valueType );
+            Class constraintValueClass = Classes.RAW_CLASS.apply( constraintValueType );
+            Class valueClass = Classes.RAW_CLASS.apply( valueType );
             return constraintAnnotationType.equals( annotationType ) && constraintValueClass.isAssignableFrom( valueClass );
         }
         else

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/main/java/org/apache/zest/runtime/composite/ConstructorsModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/composite/ConstructorsModel.java b/core/runtime/src/main/java/org/apache/zest/runtime/composite/ConstructorsModel.java
index 4b14cc3..9bc075f 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/composite/ConstructorsModel.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/composite/ConstructorsModel.java
@@ -24,6 +24,7 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
+import java.util.function.Function;
 import org.apache.zest.api.common.ConstructionException;
 import org.apache.zest.api.composite.CompositeDescriptor;
 import org.apache.zest.api.composite.InvalidCompositeException;
@@ -32,7 +33,6 @@ import org.apache.zest.api.injection.scope.Uses;
 import org.apache.zest.api.util.Annotations;
 import org.apache.zest.api.util.Classes;
 import org.apache.zest.bootstrap.BindingException;
-import org.apache.zest.functional.Function;
 import org.apache.zest.functional.HierarchicalVisitor;
 import org.apache.zest.functional.HierarchicalVisitorAdapter;
 import org.apache.zest.functional.Iterables;
@@ -112,7 +112,7 @@ public final class ConstructorsModel
         Function<ConstructorModel, Iterable<DependencyModel>> constructorDependencies = new Function<ConstructorModel, Iterable<DependencyModel>>()
         {
             @Override
-            public Iterable<DependencyModel> map( ConstructorModel constructorModel )
+            public Iterable<DependencyModel> apply( ConstructorModel constructorModel )
             {
                 return constructorModel.dependencies();
             }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/main/java/org/apache/zest/runtime/composite/FunctionStateResolver.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/composite/FunctionStateResolver.java b/core/runtime/src/main/java/org/apache/zest/runtime/composite/FunctionStateResolver.java
index 9c2943b..a0ade3d 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/composite/FunctionStateResolver.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/composite/FunctionStateResolver.java
@@ -17,10 +17,10 @@ package org.apache.zest.runtime.composite;
 
 import java.util.List;
 import java.util.Map;
+import java.util.function.Function;
 import org.apache.zest.api.association.AssociationDescriptor;
 import org.apache.zest.api.entity.EntityReference;
 import org.apache.zest.api.property.PropertyDescriptor;
-import org.apache.zest.functional.Function;
 import org.apache.zest.functional.Iterables;
 import org.apache.zest.runtime.association.ManyAssociationModel;
 import org.apache.zest.runtime.association.NamedAssociationModel;
@@ -54,25 +54,25 @@ public class FunctionStateResolver
     @Override
     public Object getPropertyState( PropertyDescriptor propertyDescriptor )
     {
-        return propertyFunction.map( propertyDescriptor );
+        return propertyFunction.apply( propertyDescriptor );
     }
 
     @Override
     public EntityReference getAssociationState( AssociationDescriptor associationDescriptor )
     {
-        return associationFunction.map( associationDescriptor );
+        return associationFunction.apply( associationDescriptor );
     }
 
     @Override
     public List<EntityReference> getManyAssociationState( AssociationDescriptor associationDescriptor )
     {
-        return Iterables.toList( manyAssociationFunction.map( associationDescriptor ) );
+        return Iterables.toList( manyAssociationFunction.apply( associationDescriptor ) );
     }
 
     @Override
     public Map<String, EntityReference> getNamedAssociationState( AssociationDescriptor associationDescriptor )
     {
-        return namedAssociationFunction.map( associationDescriptor );
+        return namedAssociationFunction.apply( associationDescriptor );
     }
 
     public void populateState( EntityModel model, EntityState state )

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/main/java/org/apache/zest/runtime/composite/MixinsModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/composite/MixinsModel.java b/core/runtime/src/main/java/org/apache/zest/runtime/composite/MixinsModel.java
index d90f9d9..8c78f26 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/composite/MixinsModel.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/composite/MixinsModel.java
@@ -23,9 +23,9 @@ import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.function.Function;
 import org.apache.zest.api.util.Classes;
 import org.apache.zest.bootstrap.BindingException;
-import org.apache.zest.functional.Function;
 import org.apache.zest.functional.HierarchicalVisitor;
 import org.apache.zest.functional.HierarchicalVisitorAdapter;
 import org.apache.zest.functional.Specification;
@@ -90,7 +90,7 @@ public class MixinsModel
     {
         for( Type type : interfacesOf( mixinType ) )
         {
-            mixinTypes.add( Classes.RAW_CLASS.map( type ) );
+            mixinTypes.add( Classes.RAW_CLASS.apply( type ) );
         }
     }
 
@@ -194,7 +194,7 @@ public class MixinsModel
         return flattenIterables( map( new Function<MixinModel, Iterable<DependencyModel>>()
         {
             @Override
-            public Iterable<DependencyModel> map( MixinModel mixinModel )
+            public Iterable<DependencyModel> apply( MixinModel mixinModel )
             {
                 return mixinModel.dependencies();
             }
@@ -206,7 +206,7 @@ public class MixinsModel
         return map( new Function<Map.Entry<Method, MixinModel>, Method>()
         {
             @Override
-            public Method map( Map.Entry<Method, MixinModel> entry )
+            public Method apply( Map.Entry<Method, MixinModel> entry )
             {
                 return entry.getKey();
             }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/main/java/org/apache/zest/runtime/composite/TransientInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/composite/TransientInstance.java b/core/runtime/src/main/java/org/apache/zest/runtime/composite/TransientInstance.java
index 3a92397..df15d5c 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/composite/TransientInstance.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/composite/TransientInstance.java
@@ -150,7 +150,7 @@ public class TransientInstance
         {
             return false;
         }
-        TransientInstance other = (TransientInstance) ZestAPI.FUNCTION_COMPOSITE_INSTANCE_OF.map( (Composite) o );
+        TransientInstance other = (TransientInstance) ZestAPI.FUNCTION_COMPOSITE_INSTANCE_OF.apply( (Composite) o );
         if( other.mixins.length != mixins.length )
         {
             return false;

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/main/java/org/apache/zest/runtime/entity/EntityStateInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/entity/EntityStateInstance.java b/core/runtime/src/main/java/org/apache/zest/runtime/entity/EntityStateInstance.java
index fe528b3..82a511b 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/entity/EntityStateInstance.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/entity/EntityStateInstance.java
@@ -23,6 +23,8 @@ import java.lang.reflect.AccessibleObject;
 import java.lang.reflect.Type;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.function.BiFunction;
+import java.util.function.Function;
 import org.apache.zest.api.association.Association;
 import org.apache.zest.api.association.AssociationDescriptor;
 import org.apache.zest.api.association.AssociationStateHolder;
@@ -33,8 +35,6 @@ import org.apache.zest.api.property.Property;
 import org.apache.zest.api.property.PropertyDescriptor;
 import org.apache.zest.api.unitofwork.UnitOfWork;
 import org.apache.zest.api.util.Classes;
-import org.apache.zest.functional.Function;
-import org.apache.zest.functional.Function2;
 import org.apache.zest.functional.Iterables;
 import org.apache.zest.runtime.association.AssociationInstance;
 import org.apache.zest.runtime.association.AssociationModel;
@@ -57,19 +57,19 @@ public final class EntityStateInstance
 
     private final EntityStateModel stateModel;
     private EntityState entityState;
-    private final Function2<EntityReference, Type, Object> entityFunction;
+    private final BiFunction<EntityReference, Type, Object> entityFunction;
 
     public EntityStateInstance( EntityStateModel stateModel, final UnitOfWork uow, EntityState entityState )
     {
         this.stateModel = stateModel;
         this.entityState = entityState;
 
-        entityFunction = new Function2<EntityReference, Type, Object>()
+        entityFunction = new BiFunction<EntityReference, Type, Object>()
         {
             @Override
-            public Object map( EntityReference entityReference, Type type )
+            public Object apply( EntityReference entityReference, Type type )
             {
-                return uow.get( Classes.RAW_CLASS.map( type ), entityReference.identity() );
+                return uow.get( Classes.RAW_CLASS.apply( type ), entityReference.identity() );
             }
         };
     }
@@ -103,7 +103,7 @@ public final class EntityStateInstance
         return Iterables.map( new Function<PropertyDescriptor, Property<?>>()
         {
             @Override
-            public Property<?> map( PropertyDescriptor propertyDescriptor )
+            public Property<?> apply( PropertyDescriptor propertyDescriptor )
             {
                 return propertyFor( propertyDescriptor.accessor() );
             }
@@ -153,7 +153,7 @@ public final class EntityStateInstance
         return Iterables.map( new Function<AssociationDescriptor, Association<?>>()
         {
             @Override
-            public Association<?> map( AssociationDescriptor associationDescriptor )
+            public Association<?> apply( AssociationDescriptor associationDescriptor )
             {
                 return associationFor( associationDescriptor.accessor() );
             }
@@ -189,7 +189,7 @@ public final class EntityStateInstance
         return Iterables.map( new Function<AssociationDescriptor, ManyAssociation<?>>()
         {
             @Override
-            public ManyAssociation<?> map( AssociationDescriptor associationDescriptor )
+            public ManyAssociation<?> apply( AssociationDescriptor associationDescriptor )
             {
                 return manyAssociationFor( associationDescriptor.accessor() );
             }
@@ -225,7 +225,7 @@ public final class EntityStateInstance
         return Iterables.map( new Function<AssociationDescriptor, NamedAssociation<?>>()
         {
             @Override
-            public NamedAssociation<?> map( AssociationDescriptor associationDescriptor )
+            public NamedAssociation<?> apply( AssociationDescriptor associationDescriptor )
             {
                 return namedAssociationFor( associationDescriptor.accessor() );
             }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/main/java/org/apache/zest/runtime/injection/Dependencies.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/injection/Dependencies.java b/core/runtime/src/main/java/org/apache/zest/runtime/injection/Dependencies.java
index f2b3cf5..4d68cff 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/injection/Dependencies.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/injection/Dependencies.java
@@ -18,7 +18,7 @@
  */
 package org.apache.zest.runtime.injection;
 
-import org.apache.zest.functional.Function;
+import java.util.function.Function;
 
 /**
  * TODO
@@ -28,7 +28,7 @@ public interface Dependencies
     public static Function<Dependencies, Iterable<DependencyModel>> DEPENDENCIES_FUNCTION = new Function<Dependencies, Iterable<DependencyModel>>()
     {
         @Override
-        public Iterable<DependencyModel> map( Dependencies dependencies )
+        public Iterable<DependencyModel> apply( Dependencies dependencies )
         {
             return dependencies.dependencies();
         }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/main/java/org/apache/zest/runtime/injection/DependencyModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/injection/DependencyModel.java b/core/runtime/src/main/java/org/apache/zest/runtime/injection/DependencyModel.java
index 8ceecba..619c570 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/injection/DependencyModel.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/injection/DependencyModel.java
@@ -19,12 +19,12 @@ import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
 import java.lang.reflect.TypeVariable;
 import java.util.Collections;
+import java.util.function.Function;
 import org.apache.zest.api.common.ConstructionException;
 import org.apache.zest.api.common.Optional;
 import org.apache.zest.api.composite.DependencyDescriptor;
 import org.apache.zest.bootstrap.BindingException;
 import org.apache.zest.bootstrap.InvalidInjectionException;
-import org.apache.zest.functional.Function;
 import org.apache.zest.functional.Iterables;
 import org.apache.zest.functional.Specification;
 import org.apache.zest.functional.Visitable;
@@ -404,7 +404,7 @@ public final class DependencyModel
         implements Function<DependencyModel, Class<?>>
     {
         @Override
-        public Class<?> map( DependencyModel dependencyModel )
+        public Class<?> apply( DependencyModel dependencyModel )
         {
             return dependencyModel.rawInjectionType();
         }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/main/java/org/apache/zest/runtime/injection/InjectedFieldsModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/injection/InjectedFieldsModel.java b/core/runtime/src/main/java/org/apache/zest/runtime/injection/InjectedFieldsModel.java
index e61bc39..0767282 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/injection/InjectedFieldsModel.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/injection/InjectedFieldsModel.java
@@ -21,10 +21,10 @@ import java.lang.reflect.Type;
 import java.lang.reflect.TypeVariable;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.function.Function;
 import org.apache.zest.api.injection.InjectionScope;
 import org.apache.zest.api.util.Classes;
 import org.apache.zest.api.util.Fields;
-import org.apache.zest.functional.Function;
 import org.apache.zest.functional.HierarchicalVisitor;
 import org.apache.zest.functional.Iterables;
 import org.apache.zest.functional.VisitableHierarchy;
@@ -46,7 +46,7 @@ public final class InjectedFieldsModel
 
     public InjectedFieldsModel( Class fragmentClass )
     {
-        Iterable<Field> mappedFields = Fields.FIELDS_OF.map( fragmentClass );
+        Iterable<Field> mappedFields = Fields.FIELDS_OF.apply( fragmentClass );
         for( Field field : mappedFields )
         {
             Annotation injectionAnnotation = first( filter( translate( type(), hasAnnotation( InjectionScope.class ) ), iterable( field
@@ -90,7 +90,7 @@ public final class InjectedFieldsModel
         return Iterables.map( new Function<InjectedFieldModel, DependencyModel>()
         {
             @Override
-            public DependencyModel map( InjectedFieldModel injectedFieldModel )
+            public DependencyModel apply( InjectedFieldModel injectedFieldModel )
             {
                 return injectedFieldModel.dependency();
             }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/main/java/org/apache/zest/runtime/injection/InjectedMethodsModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/injection/InjectedMethodsModel.java b/core/runtime/src/main/java/org/apache/zest/runtime/injection/InjectedMethodsModel.java
index 82121a4..864143e 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/injection/InjectedMethodsModel.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/injection/InjectedMethodsModel.java
@@ -48,7 +48,7 @@ public final class InjectedMethodsModel
     public InjectedMethodsModel( Class fragmentClass )
     {
         nextMethod:
-        for( Method method : Methods.METHODS_OF.map( fragmentClass ) )
+        for( Method method : Methods.METHODS_OF.apply( fragmentClass ) )
         {
             Annotation[][] parameterAnnotations = method.getParameterAnnotations();
             if( parameterAnnotations.length > 0 )

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/main/java/org/apache/zest/runtime/injection/provider/InvocationInjectionProviderFactory.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/injection/provider/InvocationInjectionProviderFactory.java b/core/runtime/src/main/java/org/apache/zest/runtime/injection/provider/InvocationInjectionProviderFactory.java
index d7348ff..faa3ae8 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/injection/provider/InvocationInjectionProviderFactory.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/injection/provider/InvocationInjectionProviderFactory.java
@@ -43,7 +43,7 @@ public final class InvocationInjectionProviderFactory
     public InjectionProvider newInjectionProvider( Resolution resolution, DependencyModel dependencyModel )
         throws InvalidInjectionException
     {
-        Class injectionClass = Classes.RAW_CLASS.map( dependencyModel.injectionType() );
+        Class injectionClass = Classes.RAW_CLASS.apply( dependencyModel.injectionType() );
         if( injectionClass.equals( Method.class ) ||
             injectionClass.equals( AnnotatedElement.class ) ||
             injectionClass.equals( Iterable.class ) ||
@@ -75,7 +75,7 @@ public final class InvocationInjectionProviderFactory
         public Object provideInjection( InjectionContext context )
             throws InjectionProviderException
         {
-            Class injectionClass = Classes.RAW_CLASS.map( dependencyModel.injectionType() );
+            Class injectionClass = Classes.RAW_CLASS.apply( dependencyModel.injectionType() );
             final CompositeMethodModel methodModel = resolution.method();
             if( injectionClass.equals( Method.class ) )
             {

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/main/java/org/apache/zest/runtime/injection/provider/ModifiesInjectionProviderFactory.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/injection/provider/ModifiesInjectionProviderFactory.java b/core/runtime/src/main/java/org/apache/zest/runtime/injection/provider/ModifiesInjectionProviderFactory.java
index fedb010..48310f5 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/injection/provider/ModifiesInjectionProviderFactory.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/injection/provider/ModifiesInjectionProviderFactory.java
@@ -39,7 +39,7 @@ public final class ModifiesInjectionProviderFactory
     {
         if( bindingContext.model() instanceof CompositeDescriptor )
         {
-            Class<?> type = Classes.RAW_CLASS.map( dependencyModel.injectionType() );
+            Class<?> type = Classes.RAW_CLASS.apply( dependencyModel.injectionType() );
             if( type.isAssignableFrom( dependencyModel.injectedClass() ) )
             {
                 return new ModifiedInjectionProvider();

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/main/java/org/apache/zest/runtime/injection/provider/ServiceInjectionProviderFactory.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/injection/provider/ServiceInjectionProviderFactory.java b/core/runtime/src/main/java/org/apache/zest/runtime/injection/provider/ServiceInjectionProviderFactory.java
index 4c5bb26..952a73c 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/injection/provider/ServiceInjectionProviderFactory.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/injection/provider/ServiceInjectionProviderFactory.java
@@ -17,13 +17,13 @@ package org.apache.zest.runtime.injection.provider;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
+import java.util.function.Function;
 import org.apache.zest.api.service.NoSuchServiceException;
 import org.apache.zest.api.service.ServiceReference;
 import org.apache.zest.api.service.qualifier.Qualifier;
 import org.apache.zest.api.util.Annotations;
 import org.apache.zest.api.util.Classes;
 import org.apache.zest.bootstrap.InvalidInjectionException;
-import org.apache.zest.functional.Function;
 import org.apache.zest.functional.Iterables;
 import org.apache.zest.functional.Specification;
 import org.apache.zest.functional.Specifications;
@@ -66,7 +66,7 @@ public final class ServiceInjectionProviderFactory
         if( dependencyModel.rawInjectionType().equals( Iterable.class ) )
         {
             Type iterableType = ( (ParameterizedType) dependencyModel.injectionType() ).getActualTypeArguments()[ 0 ];
-            if( Classes.RAW_CLASS.map( iterableType ).equals( ServiceReference.class ) )
+            if( Classes.RAW_CLASS.apply( iterableType ).equals( ServiceReference.class ) )
             {
                 // @Service Iterable<ServiceReference<MyService<Foo>> serviceRefs
                 Type serviceType = ( (ParameterizedType) iterableType ).getActualTypeArguments()[ 0 ];
@@ -129,7 +129,7 @@ public final class ServiceInjectionProviderFactory
         }
 
         @Override
-        public Object map( ServiceReference<?> objectServiceReference )
+        public Object apply( ServiceReference<?> objectServiceReference )
         {
             return objectServiceReference.get();
         }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/main/java/org/apache/zest/runtime/query/IterableQuerySource.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/query/IterableQuerySource.java b/core/runtime/src/main/java/org/apache/zest/runtime/query/IterableQuerySource.java
index 41ec961..451f1d1 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/query/IterableQuerySource.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/query/IterableQuerySource.java
@@ -183,8 +183,8 @@ public class IterableQuerySource
             {
                 try
                 {
-                    final Property prop1 = orderBySegment.property().map( o1 );
-                    final Property prop2 = orderBySegment.property().map( o2 );
+                    final Property prop1 = orderBySegment.property().apply( o1 );
+                    final Property prop2 = orderBySegment.property().apply( o2 );
                     if( prop1 == null || prop2 == null )
                     {
                         if( prop1 == null && prop2 == null )

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/main/java/org/apache/zest/runtime/service/ServiceModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/service/ServiceModel.java b/core/runtime/src/main/java/org/apache/zest/runtime/service/ServiceModel.java
index 86eaa3f..276a8c4 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/service/ServiceModel.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/service/ServiceModel.java
@@ -196,7 +196,7 @@ public final class ServiceModel extends CompositeModel
                     .equals( Configuration.class ) && dependencyModel.injectionType() instanceof ParameterizedType )
             {
                 Class<?> type = Classes.RAW_CLASS
-                    .map( ( (ParameterizedType) dependencyModel.injectionType() ).getActualTypeArguments()[ 0 ] );
+                    .apply( ( (ParameterizedType) dependencyModel.injectionType() ).getActualTypeArguments()[ 0 ] );
                 if( injectionClass == null )
                 {
                     injectionClass = type;

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/main/java/org/apache/zest/runtime/structure/LayerInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/structure/LayerInstance.java b/core/runtime/src/main/java/org/apache/zest/runtime/structure/LayerInstance.java
index 074dccb..f4c9cca 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/structure/LayerInstance.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/structure/LayerInstance.java
@@ -16,6 +16,7 @@ package org.apache.zest.runtime.structure;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.function.Function;
 import org.apache.zest.api.activation.ActivationEventListener;
 import org.apache.zest.api.activation.ActivationException;
 import org.apache.zest.api.activation.PassivationException;
@@ -26,7 +27,6 @@ import org.apache.zest.api.object.ObjectDescriptor;
 import org.apache.zest.api.service.ServiceReference;
 import org.apache.zest.api.structure.Layer;
 import org.apache.zest.api.value.ValueDescriptor;
-import org.apache.zest.functional.Function;
 import org.apache.zest.runtime.activation.ActivationDelegate;
 import org.apache.zest.spi.module.ModelModule;
 
@@ -138,7 +138,7 @@ public class LayerInstance
         {
 
             @Override
-            public Iterable<ModelModule<ObjectDescriptor>> map( ModuleInstance moduleInstance )
+            public Iterable<ModelModule<ObjectDescriptor>> apply( ModuleInstance moduleInstance )
             {
                 return moduleInstance.visibleObjects( visibility );
             }
@@ -151,7 +151,7 @@ public class LayerInstance
         {
 
             @Override
-            public Iterable<ModelModule<TransientDescriptor>> map( ModuleInstance moduleInstance )
+            public Iterable<ModelModule<TransientDescriptor>> apply( ModuleInstance moduleInstance )
             {
                 return moduleInstance.visibleTransients( visibility );
             }
@@ -164,7 +164,7 @@ public class LayerInstance
         {
 
             @Override
-            public Iterable<ModelModule<EntityDescriptor>> map( ModuleInstance moduleInstance )
+            public Iterable<ModelModule<EntityDescriptor>> apply( ModuleInstance moduleInstance )
             {
                 return moduleInstance.visibleEntities( visibility );
             }
@@ -177,7 +177,7 @@ public class LayerInstance
         {
 
             @Override
-            public Iterable<ModelModule<ValueDescriptor>> map( ModuleInstance moduleInstance )
+            public Iterable<ModelModule<ValueDescriptor>> apply( ModuleInstance moduleInstance )
             {
                 return moduleInstance.visibleValues( visibility );
             }
@@ -190,7 +190,7 @@ public class LayerInstance
         {
 
             @Override
-            public Iterable<ServiceReference<?>> map( ModuleInstance moduleInstance )
+            public Iterable<ServiceReference<?>> apply( ModuleInstance moduleInstance )
             {
                 return moduleInstance.visibleServices( visibility );
             }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/main/java/org/apache/zest/runtime/structure/ModuleInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/structure/ModuleInstance.java b/core/runtime/src/main/java/org/apache/zest/runtime/structure/ModuleInstance.java
index 0a110e4..0f934aa 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/structure/ModuleInstance.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/structure/ModuleInstance.java
@@ -25,6 +25,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.Stack;
 import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.BiFunction;
+import java.util.function.Function;
 import org.apache.zest.api.activation.Activation;
 import org.apache.zest.api.activation.ActivationEventListener;
 import org.apache.zest.api.activation.ActivationException;
@@ -64,8 +66,6 @@ import org.apache.zest.api.value.ValueComposite;
 import org.apache.zest.api.value.ValueDescriptor;
 import org.apache.zest.api.value.ValueSerialization;
 import org.apache.zest.api.value.ValueSerializationException;
-import org.apache.zest.functional.Function;
-import org.apache.zest.functional.Function2;
 import org.apache.zest.functional.Specification;
 import org.apache.zest.functional.Specifications;
 import org.apache.zest.runtime.activation.ActivationDelegate;
@@ -588,13 +588,13 @@ public class ModuleInstance
         return typeLookup;
     }
 
-    public Function2<EntityReference, Type, Object> getEntityFunction()
+    public BiFunction<EntityReference, Type, Object> getEntityFunction()
     {
         return entityFunction;
     }
 
     private static class EntityFunction
-        implements Function2<EntityReference, Type, Object>
+        implements BiFunction<EntityReference, Type, Object>
     {
 
         private final UnitOfWorkFactory uowf;
@@ -605,9 +605,9 @@ public class ModuleInstance
         }
 
         @Override
-        public Object map( EntityReference entityReference, Type type )
+        public Object apply( EntityReference entityReference, Type type )
         {
-            return uowf.currentUnitOfWork().get( RAW_CLASS.map( type ), entityReference.identity() );
+            return uowf.currentUnitOfWork().get( RAW_CLASS.apply( type ), entityReference.identity() );
         }
     }
 

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/main/java/org/apache/zest/runtime/structure/ModuleUnitOfWork.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/structure/ModuleUnitOfWork.java b/core/runtime/src/main/java/org/apache/zest/runtime/structure/ModuleUnitOfWork.java
index f052de2..c61adcd 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/structure/ModuleUnitOfWork.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/structure/ModuleUnitOfWork.java
@@ -19,6 +19,7 @@ import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.function.Function;
 import org.apache.zest.api.association.AssociationDescriptor;
 import org.apache.zest.api.association.AssociationStateHolder;
 import org.apache.zest.api.common.QualifiedName;
@@ -48,7 +49,6 @@ import org.apache.zest.api.usecase.Usecase;
 import org.apache.zest.api.util.NullArgumentException;
 import org.apache.zest.api.value.ValueBuilder;
 import org.apache.zest.api.value.ValueComposite;
-import org.apache.zest.functional.Function;
 import org.apache.zest.functional.Iterables;
 import org.apache.zest.functional.Specification;
 import org.apache.zest.runtime.association.AssociationInstance;
@@ -619,7 +619,7 @@ public class ModuleUnitOfWork
         }
 
         @Override
-        public Object map( PropertyDescriptor propertyDescriptor )
+        public Object apply( PropertyDescriptor propertyDescriptor )
         {
             EntityState entityState = EntityInstance.entityInstanceOf( (EntityComposite) entity ).entityState();
             return entityState.propertyValueOf( propertyDescriptor.qualifiedName() );
@@ -637,7 +637,7 @@ public class ModuleUnitOfWork
         }
 
         @Override
-        public EntityReference map( AssociationDescriptor associationDescriptor )
+        public EntityReference apply( AssociationDescriptor associationDescriptor )
         {
             EntityState entityState = EntityInstance.entityInstanceOf( (EntityComposite) entity ).entityState();
             return entityState.associationValueOf( associationDescriptor.qualifiedName() );
@@ -655,7 +655,7 @@ public class ModuleUnitOfWork
         }
 
         @Override
-        public Iterable<EntityReference> map( AssociationDescriptor associationDescriptor )
+        public Iterable<EntityReference> apply( AssociationDescriptor associationDescriptor )
         {
             EntityState entityState = EntityInstance.entityInstanceOf( (EntityComposite) entity ).entityState();
             return entityState.manyAssociationValueOf( associationDescriptor.qualifiedName() );
@@ -673,7 +673,7 @@ public class ModuleUnitOfWork
         }
 
         @Override
-        public Map<String, EntityReference> map( AssociationDescriptor associationDescriptor )
+        public Map<String, EntityReference> apply( AssociationDescriptor associationDescriptor )
         {
             Map<String, EntityReference> result = new HashMap<>();
             EntityState entityState = EntityInstance.entityInstanceOf( (EntityComposite) entity ).entityState();
@@ -697,7 +697,7 @@ public class ModuleUnitOfWork
         }
 
         @Override
-        public Object map( PropertyDescriptor propertyDescriptor )
+        public Object apply( PropertyDescriptor propertyDescriptor )
         {
             StateHolder state = ValueInstance.valueInstanceOf( (ValueComposite) value ).state();
             Property<Object> property = state.propertyFor( propertyDescriptor.accessor() );
@@ -717,7 +717,7 @@ public class ModuleUnitOfWork
         }
 
         @Override
-        public EntityReference map( AssociationDescriptor associationDescriptor )
+        public EntityReference apply( AssociationDescriptor associationDescriptor )
         {
             AssociationStateHolder state = ValueInstance.valueInstanceOf( (ValueComposite) value ).state();
             AssociationInstance<T> association = (AssociationInstance<T>) state.associationFor( associationDescriptor.accessor() );
@@ -737,7 +737,7 @@ public class ModuleUnitOfWork
         }
 
         @Override
-        public Iterable<EntityReference> map( AssociationDescriptor associationDescriptor )
+        public Iterable<EntityReference> apply( AssociationDescriptor associationDescriptor )
         {
             AssociationStateHolder state = ValueInstance.valueInstanceOf( (ValueComposite) value ).state();
             ManyAssociationInstance<T> association =
@@ -757,7 +757,7 @@ public class ModuleUnitOfWork
         }
 
         @Override
-        public Map<String, EntityReference> map( AssociationDescriptor associationDescriptor )
+        public Map<String, EntityReference> apply( AssociationDescriptor associationDescriptor )
         {
             AssociationStateHolder state = ValueInstance.valueInstanceOf( (ValueComposite) value ).state();
             NamedAssociationInstance<T> association =

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/main/java/org/apache/zest/runtime/structure/TypeLookup.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/structure/TypeLookup.java b/core/runtime/src/main/java/org/apache/zest/runtime/structure/TypeLookup.java
index 0ebfbbb..fcae944 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/structure/TypeLookup.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/structure/TypeLookup.java
@@ -27,11 +27,11 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Function;
 import org.apache.zest.api.composite.AmbiguousTypeException;
 import org.apache.zest.api.composite.ModelDescriptor;
 import org.apache.zest.api.service.NoSuchServiceException;
 import org.apache.zest.api.service.ServiceReference;
-import org.apache.zest.functional.Function;
 import org.apache.zest.functional.Specification;
 import org.apache.zest.functional.Specifications;
 import org.apache.zest.runtime.composite.TransientModel;
@@ -385,7 +385,7 @@ public class TypeLookup
 
         if( serviceReference == null )
         {
-            throw new NoSuchServiceException( RAW_CLASS.map( serviceType ).getName(), moduleInstance.name() );
+            throw new NoSuchServiceException( RAW_CLASS.apply( serviceType ).getName(), moduleInstance.name() );
         }
 
         return (ServiceReference<T>) serviceReference;
@@ -514,7 +514,7 @@ public class TypeLookup
     {
 
         @Override
-        public Iterable<Class<?>> map( ModelModule<T> modelModule )
+        public Iterable<Class<?>> apply( ModelModule<T> modelModule )
         {
             return modelModule.model().types();
         }
@@ -525,7 +525,7 @@ public class TypeLookup
     {
 
         @Override
-        public Iterable<Class<?>> map( ServiceReference<?> serviceReference )
+        public Iterable<Class<?>> apply( ServiceReference<?> serviceReference )
         {
             return serviceReference.types();
         }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/main/java/org/apache/zest/runtime/structure/UsedLayersInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/structure/UsedLayersInstance.java b/core/runtime/src/main/java/org/apache/zest/runtime/structure/UsedLayersInstance.java
index 12893cf..22f2996 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/structure/UsedLayersInstance.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/structure/UsedLayersInstance.java
@@ -15,13 +15,13 @@
 package org.apache.zest.runtime.structure;
 
 import java.util.List;
+import java.util.function.Function;
 import org.apache.zest.api.common.Visibility;
 import org.apache.zest.api.composite.TransientDescriptor;
 import org.apache.zest.api.entity.EntityDescriptor;
 import org.apache.zest.api.object.ObjectDescriptor;
 import org.apache.zest.api.service.ServiceReference;
 import org.apache.zest.api.value.ValueDescriptor;
-import org.apache.zest.functional.Function;
 import org.apache.zest.spi.module.ModelModule;
 
 import static org.apache.zest.functional.Iterables.*;
@@ -43,7 +43,7 @@ public final class UsedLayersInstance
         return flattenIterables( map( new Function<LayerInstance, Iterable<ModelModule<ObjectDescriptor>>>()
         {
             @Override
-            public Iterable<ModelModule<ObjectDescriptor>> map( LayerInstance layerInstance )
+            public Iterable<ModelModule<ObjectDescriptor>> apply( LayerInstance layerInstance )
             {
                 return layerInstance.visibleObjects( Visibility.application );
             }
@@ -55,7 +55,7 @@ public final class UsedLayersInstance
         return flattenIterables( map( new Function<LayerInstance, Iterable<ModelModule<TransientDescriptor>>>()
         {
             @Override
-            public Iterable<ModelModule<TransientDescriptor>> map( LayerInstance layerInstance )
+            public Iterable<ModelModule<TransientDescriptor>> apply( LayerInstance layerInstance )
             {
                 return layerInstance.visibleTransients( Visibility.application );
             }
@@ -67,7 +67,7 @@ public final class UsedLayersInstance
         return flattenIterables( map( new Function<LayerInstance, Iterable<ModelModule<EntityDescriptor>>>()
         {
             @Override
-            public Iterable<ModelModule<EntityDescriptor>> map( LayerInstance layerInstance )
+            public Iterable<ModelModule<EntityDescriptor>> apply( LayerInstance layerInstance )
             {
                 return layerInstance.visibleEntities( Visibility.application );
             }
@@ -79,7 +79,7 @@ public final class UsedLayersInstance
         return flattenIterables( map( new Function<LayerInstance, Iterable<ModelModule<ValueDescriptor>>>()
         {
             @Override
-            public Iterable<ModelModule<ValueDescriptor>> map( LayerInstance layerInstance )
+            public Iterable<ModelModule<ValueDescriptor>> apply( LayerInstance layerInstance )
             {
                 return layerInstance.visibleValues( Visibility.application );
             }
@@ -91,7 +91,7 @@ public final class UsedLayersInstance
         return flattenIterables( map( new Function<LayerInstance, Iterable<ServiceReference<?>>>()
         {
             @Override
-            public Iterable<ServiceReference<?>> map( LayerInstance layerInstance )
+            public Iterable<ServiceReference<?>> apply( LayerInstance layerInstance )
             {
                 return layerInstance.visibleServices( Visibility.application );
             }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/main/java/org/apache/zest/runtime/types/ValueTypeFactory.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/types/ValueTypeFactory.java b/core/runtime/src/main/java/org/apache/zest/runtime/types/ValueTypeFactory.java
index 2c7951c..e3195ba 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/types/ValueTypeFactory.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/types/ValueTypeFactory.java
@@ -79,12 +79,12 @@ public class ValueTypeFactory
                     collectionType = Classes.resolveTypeVariable( collectionTypeVariable, declaringClass, compositeType );
                 }
                 ValueType collectedType = newValueType( collectionType, declaringClass, compositeType, layer, module, variant );
-                valueType = new CollectionType( Classes.RAW_CLASS.map( type ), collectedType );
+                valueType = new CollectionType( Classes.RAW_CLASS.apply( type ), collectedType );
             }
             else
             {
                 ValueType collectedType = newValueType( Object.class, declaringClass, compositeType, layer, module, variant );
-                valueType = new CollectionType( Classes.RAW_CLASS.map( type ), collectedType );
+                valueType = new CollectionType( Classes.RAW_CLASS.apply( type ), collectedType );
             }
         }
         else if( MapType.isMap( type ) )
@@ -106,19 +106,19 @@ public class ValueTypeFactory
                     valType = Classes.resolveTypeVariable( valueTypeVariable, declaringClass, compositeType );
                 }
                 ValueType valuedType = newValueType( valType, declaringClass, compositeType, layer, module, variant );
-                valueType = new MapType( Classes.RAW_CLASS.map( type ), keyedType, valuedType, variant );
+                valueType = new MapType( Classes.RAW_CLASS.apply( type ), keyedType, valuedType, variant );
             }
             else
             {
                 ValueType keyType = newValueType( Object.class, declaringClass, compositeType, layer, module, variant );
                 ValueType valuesType = newValueType( Object.class, declaringClass, compositeType, layer, module, variant );
-                valueType = new MapType( Classes.RAW_CLASS.map( type ), keyType, valuesType, variant );
+                valueType = new MapType( Classes.RAW_CLASS.apply( type ), keyType, valuesType, variant );
             }
         }
         else if( ValueCompositeType.isValueComposite( type ) )
         {
             // Find ValueModel in module/layer/used layers
-            ValueModel model = new ValueFinder( layer, module, Classes.RAW_CLASS.map( type ) ).getFoundModel();
+            ValueModel model = new ValueFinder( layer, module, Classes.RAW_CLASS.apply( type ) ).getFoundModel();
 
             if( model == null )
             {
@@ -144,11 +144,11 @@ public class ValueTypeFactory
         }
         else if( EnumType.isEnum( type ) )
         {
-            valueType = new EnumType( Classes.RAW_CLASS.map( type ) );
+            valueType = new EnumType( Classes.RAW_CLASS.apply( type ) );
         }
         else
         {
-            valueType = new ValueType( Classes.RAW_CLASS.map( type ) );
+            valueType = new ValueType( Classes.RAW_CLASS.apply( type ) );
         }
 
         return valueType;

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueBuilderWithPrototype.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueBuilderWithPrototype.java b/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueBuilderWithPrototype.java
index f6a40ae..3c9a280 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueBuilderWithPrototype.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/value/ValueBuilderWithPrototype.java
@@ -22,6 +22,7 @@ package org.apache.zest.runtime.value;
 
 import java.util.HashMap;
 import java.util.Map;
+import java.util.function.Function;
 import org.apache.zest.api.association.AssociationDescriptor;
 import org.apache.zest.api.association.AssociationStateHolder;
 import org.apache.zest.api.association.NamedAssociation;
@@ -30,7 +31,6 @@ import org.apache.zest.api.entity.EntityReference;
 import org.apache.zest.api.property.PropertyDescriptor;
 import org.apache.zest.api.value.ValueBuilder;
 import org.apache.zest.api.value.ValueComposite;
-import org.apache.zest.functional.Function;
 import org.apache.zest.runtime.composite.FunctionStateResolver;
 import org.apache.zest.runtime.composite.MixinModel;
 import org.apache.zest.runtime.composite.MixinsModel;
@@ -163,7 +163,7 @@ public class ValueBuilderWithPrototype<T>
         }
 
         @Override
-        public Object map( PropertyDescriptor descriptor )
+        public Object apply( PropertyDescriptor descriptor )
         {
             return prototypeState.propertyFor( descriptor.accessor() ).get();
         }
@@ -180,7 +180,7 @@ public class ValueBuilderWithPrototype<T>
         }
 
         @Override
-        public EntityReference map( AssociationDescriptor descriptor )
+        public EntityReference apply( AssociationDescriptor descriptor )
         {
             return prototypeState.associationFor( descriptor.accessor() ).reference();
         }
@@ -197,7 +197,7 @@ public class ValueBuilderWithPrototype<T>
         }
 
         @Override
-        public Iterable<EntityReference> map( AssociationDescriptor descriptor )
+        public Iterable<EntityReference> apply( AssociationDescriptor descriptor )
         {
             return prototypeState.manyAssociationFor( descriptor.accessor() ).references();
         }
@@ -214,7 +214,7 @@ public class ValueBuilderWithPrototype<T>
         }
 
         @Override
-        public Map<String, EntityReference> map( AssociationDescriptor descriptor )
+        public Map<String, EntityReference> apply( AssociationDescriptor descriptor )
         {
             Map<String, EntityReference> result = new HashMap<>();
             NamedAssociation<?> namedAssociation = prototypeState.namedAssociationFor( descriptor.accessor() );

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/test/java/org/apache/zest/runtime/composite/FunctionalListTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/composite/FunctionalListTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/composite/FunctionalListTest.java
index 43e9e44..28acf98 100644
--- a/core/runtime/src/test/java/org/apache/zest/runtime/composite/FunctionalListTest.java
+++ b/core/runtime/src/test/java/org/apache/zest/runtime/composite/FunctionalListTest.java
@@ -20,6 +20,7 @@ package org.apache.zest.runtime.composite;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.function.Function;
 import org.junit.Test;
 import org.apache.zest.api.injection.scope.Structure;
 import org.apache.zest.api.injection.scope.This;
@@ -27,7 +28,6 @@ import org.apache.zest.api.mixin.Mixins;
 import org.apache.zest.api.structure.Module;
 import org.apache.zest.bootstrap.AssemblyException;
 import org.apache.zest.bootstrap.ModuleAssembly;
-import org.apache.zest.functional.Function;
 import org.apache.zest.test.AbstractZestTest;
 
 import static org.hamcrest.CoreMatchers.hasItems;
@@ -56,7 +56,7 @@ public class FunctionalListTest extends AbstractZestTest
         List<String> strings = list.translate( new Function<Integer, String>()
         {
             @Override
-            public String map( Integer x )
+            public String apply( Integer x )
             {
                 return x.toString();
             }
@@ -90,7 +90,7 @@ public class FunctionalListTest extends AbstractZestTest
             List<TO> result = module.newTransient( List.class );
             for( FROM data : list )
             {
-                result.add( function.map( data ) );
+                result.add( function.apply( data ) );
             }
             return result;
         }

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/runtime/src/test/java/org/apache/zest/runtime/entity/EntityBuilderWithStateTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/entity/EntityBuilderWithStateTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/entity/EntityBuilderWithStateTest.java
index 4fa4322..2f23f8a 100644
--- a/core/runtime/src/test/java/org/apache/zest/runtime/entity/EntityBuilderWithStateTest.java
+++ b/core/runtime/src/test/java/org/apache/zest/runtime/entity/EntityBuilderWithStateTest.java
@@ -18,6 +18,7 @@ package org.apache.zest.runtime.entity;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.Map;
+import java.util.function.Function;
 import org.junit.Test;
 import org.apache.zest.api.association.Association;
 import org.apache.zest.api.association.AssociationDescriptor;
@@ -33,7 +34,6 @@ import org.apache.zest.api.unitofwork.UnitOfWork;
 import org.apache.zest.api.unitofwork.UnitOfWorkCompletionException;
 import org.apache.zest.bootstrap.AssemblyException;
 import org.apache.zest.bootstrap.ModuleAssembly;
-import org.apache.zest.functional.Function;
 import org.apache.zest.test.AbstractZestTest;
 import org.apache.zest.test.EntityTestAssembler;
 
@@ -74,7 +74,7 @@ public class EntityBuilderWithStateTest
                 new Function<PropertyDescriptor, Object>()
                 {
                     @Override
-                    public Object map( PropertyDescriptor descriptor )
+                    public Object apply( PropertyDescriptor descriptor )
                     {
                         if( "prop".equals( descriptor.qualifiedName().name() ) )
                         {
@@ -86,7 +86,7 @@ public class EntityBuilderWithStateTest
                 new Function<AssociationDescriptor, EntityReference>()
                 {
                     @Override
-                    public EntityReference map( AssociationDescriptor descriptor )
+                    public EntityReference apply( AssociationDescriptor descriptor )
                     {
                         if( "ass".equals( descriptor.qualifiedName().name() ) )
                         {
@@ -98,7 +98,7 @@ public class EntityBuilderWithStateTest
                 new Function<AssociationDescriptor, Iterable<EntityReference>>()
                 {
                     @Override
-                    public Iterable<EntityReference> map( AssociationDescriptor descriptor )
+                    public Iterable<EntityReference> apply( AssociationDescriptor descriptor )
                     {
                         if( "manyAss".equals( descriptor.qualifiedName().name() ) )
                         {
@@ -110,7 +110,7 @@ public class EntityBuilderWithStateTest
                 new Function<AssociationDescriptor, Map<String, EntityReference>>()
                 {
                     @Override
-                    public Map<String, EntityReference> map( AssociationDescriptor descriptor )
+                    public Map<String, EntityReference> apply( AssociationDescriptor descriptor )
                     {
                         if( "namedAss".equals( descriptor.qualifiedName().name() ) )
                         {

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/spi/src/main/java/org/apache/zest/spi/entity/QualifiedIdentity.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/apache/zest/spi/entity/QualifiedIdentity.java b/core/spi/src/main/java/org/apache/zest/spi/entity/QualifiedIdentity.java
index 527052b..04088a2 100644
--- a/core/spi/src/main/java/org/apache/zest/spi/entity/QualifiedIdentity.java
+++ b/core/spi/src/main/java/org/apache/zest/spi/entity/QualifiedIdentity.java
@@ -62,7 +62,7 @@ public final class QualifiedIdentity
     public QualifiedIdentity( EntityComposite entityComposite )
     {
         this( entityComposite.identity().get(), first( ZestAPI.FUNCTION_DESCRIPTOR_FOR
-                                                           .map( entityComposite )
+                                                           .apply( entityComposite )
                                                            .types() ).getName() );
     }
 

http://git-wip-us.apache.org/repos/asf/zest-java/blob/5989a71e/core/spi/src/main/java/org/apache/zest/spi/module/ModelModule.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/apache/zest/spi/module/ModelModule.java b/core/spi/src/main/java/org/apache/zest/spi/module/ModelModule.java
index 330b19b..2aab450 100644
--- a/core/spi/src/main/java/org/apache/zest/spi/module/ModelModule.java
+++ b/core/spi/src/main/java/org/apache/zest/spi/module/ModelModule.java
@@ -18,8 +18,8 @@
  */
 package org.apache.zest.spi.module;
 
+import java.util.function.Function;
 import org.apache.zest.api.composite.ModelDescriptor;
-import org.apache.zest.functional.Function;
 
 /**
  * TODO
@@ -30,7 +30,7 @@ public class ModelModule<T extends ModelDescriptor>
     public static Function<?, String> toStringFunction = new Function<ModelModule<?>, String>()
     {
         @Override
-        public String map( ModelModule item )
+        public String apply( ModelModule item )
         {
             return item.model()
                        .types()
@@ -45,7 +45,7 @@ public class ModelModule<T extends ModelDescriptor>
         return new Function<T, ModelModule<T>>()
         {
             @Override
-            public ModelModule<T> map( T model )
+            public ModelModule<T> apply( T model )
             {
                 return new ModelModule<>( module, model );
             }
@@ -57,7 +57,7 @@ public class ModelModule<T extends ModelDescriptor>
         return new Function<ModelModule<T>, T>()
         {
             @Override
-            public T map( ModelModule<T> modelModule )
+            public T apply( ModelModule<T> modelModule )
             {
                 return modelModule.model();
             }


Mime
View raw message