polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [23/50] [abbrv] zest-qi4j git commit: Removed Function, Function2 and Specification and replaced with the equivalents in JDK, Function, BiFunction and Predicate.
Date Fri, 17 Apr 2015 16:08:35 GMT
http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/conversion/src/main/java/org/qi4j/library/conversion/values/EntityToValue.java
----------------------------------------------------------------------
diff --git a/libraries/conversion/src/main/java/org/qi4j/library/conversion/values/EntityToValue.java b/libraries/conversion/src/main/java/org/qi4j/library/conversion/values/EntityToValue.java
index c48266c..71ab0e8 100644
--- a/libraries/conversion/src/main/java/org/qi4j/library/conversion/values/EntityToValue.java
+++ b/libraries/conversion/src/main/java/org/qi4j/library/conversion/values/EntityToValue.java
@@ -25,6 +25,7 @@ import java.util.Collections;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.function.Function;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.association.AssociationDescriptor;
 import org.qi4j.api.association.AssociationStateDescriptor;
@@ -44,7 +45,6 @@ import org.qi4j.api.type.MapType;
 import org.qi4j.api.value.NoSuchValueException;
 import org.qi4j.api.value.ValueBuilder;
 import org.qi4j.api.value.ValueDescriptor;
-import org.qi4j.functional.Function;
 import org.qi4j.functional.Iterables;
 import org.qi4j.spi.Qi4jSPI;
 
@@ -114,7 +114,7 @@ public interface EntityToValue
         public <T> T convert( final Class<T> valueType, Object entity, Function<T, T> prototypeOpportunity )
         {
             ValueBuilder<?> builder = doConversion( valueType, entity );
-            prototypeOpportunity.map( (T) builder.prototype() );
+            prototypeOpportunity.apply( (T) builder.prototype() );
             return createInstance( builder );
         }
 
@@ -125,7 +125,7 @@ public interface EntityToValue
                 new Function<Object, T>()
                 {
                     @Override
-                    public T map( Object entity )
+                    public T apply( Object entity )
                     {
                         return convert( valueType, entity );
                     }
@@ -139,7 +139,7 @@ public interface EntityToValue
                 new Function<Object, T>()
                 {
                     @Override
-                    public T map( Object entity )
+                    public T apply( Object entity )
                     {
                         return convert( valueType, entity, prototypeOpportunity );
                     }
@@ -168,7 +168,7 @@ public interface EntityToValue
                     new Function<PropertyDescriptor, Object>()
                 {
                     @Override
-                    public Object map( PropertyDescriptor descriptor )
+                    public Object apply( PropertyDescriptor descriptor )
                     {
                         try
                         {
@@ -254,7 +254,7 @@ public interface EntityToValue
                     new Function<AssociationDescriptor, EntityReference>()
                     {
                         @Override
-                        public EntityReference map( AssociationDescriptor associationDescriptor )
+                        public EntityReference apply( AssociationDescriptor associationDescriptor )
                         {
                             return EntityReference.entityReferenceFor(
                                 associationState.associationFor( associationDescriptor.accessor() ).get() );
@@ -263,7 +263,7 @@ public interface EntityToValue
                     new Function<AssociationDescriptor, Iterable<EntityReference>>()
                     {
                         @Override
-                        public Iterable<EntityReference> map( AssociationDescriptor associationDescriptor )
+                        public Iterable<EntityReference> apply( AssociationDescriptor associationDescriptor )
                         {
                             ManyAssociation<?> state = associationState.manyAssociationFor( associationDescriptor.accessor() );
                             List<EntityReference> refs = new ArrayList<>( state.count() );
@@ -277,7 +277,7 @@ public interface EntityToValue
                     new Function<AssociationDescriptor, Map<String, EntityReference>>()
                     {
                         @Override
-                        public Map<String, EntityReference> map( AssociationDescriptor associationDescriptor )
+                        public Map<String, EntityReference> apply( AssociationDescriptor associationDescriptor )
                         {
                             NamedAssociation<?> assoc = associationState.namedAssociationFor( associationDescriptor.accessor() );
                             Map<String, EntityReference> refs = new LinkedHashMap<>( assoc.count() );
@@ -296,7 +296,7 @@ public interface EntityToValue
                     new Function<PropertyDescriptor, Object>()
                 {
                     @Override
-                    public Object map( final PropertyDescriptor descriptor )
+                    public Object apply( final PropertyDescriptor descriptor )
                     {
                         AssociationStateDescriptor entityState = entityDescriptor.state();
                         String propertyName = descriptor.qualifiedName().name();
@@ -383,7 +383,7 @@ public interface EntityToValue
                     new Function<AssociationDescriptor, EntityReference>()
                     {
                         @Override
-                        public EntityReference map( AssociationDescriptor descriptor )
+                        public EntityReference apply( AssociationDescriptor descriptor )
                         {
                             AssociationDescriptor associationDescriptor;
                             try
@@ -404,7 +404,7 @@ public interface EntityToValue
                     new Function<AssociationDescriptor, Iterable<EntityReference>>()
                     {
                         @Override
-                        public Iterable<EntityReference> map( final AssociationDescriptor descriptor )
+                        public Iterable<EntityReference> apply( final AssociationDescriptor descriptor )
                         {
                             AssociationDescriptor associationDescriptor;
                             try
@@ -430,7 +430,7 @@ public interface EntityToValue
                     new Function<AssociationDescriptor, Map<String, EntityReference>>()
                     {
                         @Override
-                        public Map<String, EntityReference> map( AssociationDescriptor descriptor )
+                        public Map<String, EntityReference> apply( AssociationDescriptor descriptor )
                         {
                             AssociationDescriptor associationDescriptor;
                             try

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/conversion/src/test/java/org/qi4j/library/conversion/values/EntityToValueTest.java
----------------------------------------------------------------------
diff --git a/libraries/conversion/src/test/java/org/qi4j/library/conversion/values/EntityToValueTest.java b/libraries/conversion/src/test/java/org/qi4j/library/conversion/values/EntityToValueTest.java
index 7f29eb3..3b15258 100644
--- a/libraries/conversion/src/test/java/org/qi4j/library/conversion/values/EntityToValueTest.java
+++ b/libraries/conversion/src/test/java/org/qi4j/library/conversion/values/EntityToValueTest.java
@@ -21,6 +21,7 @@ import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
 import java.util.TimeZone;
+import java.util.function.Function;
 import org.junit.Test;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.association.ManyAssociation;
@@ -37,7 +38,6 @@ import org.qi4j.api.unitofwork.UnitOfWorkCompletionException;
 import org.qi4j.api.value.ValueComposite;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.functional.Function;
 import org.qi4j.test.AbstractQi4jTest;
 import org.qi4j.test.EntityTestAssembler;
 
@@ -172,7 +172,7 @@ public class EntityToValueTest
             PersonValue value = conversion.convert( PersonValue.class, entity, new Function<PersonValue, PersonValue>()
             {
                 @Override
-                public PersonValue map( PersonValue prototype )
+                public PersonValue apply( PersonValue prototype )
                 {
                     prototype.firstName().set( "Prototype Opportunity" );
                     return prototype;

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/cxf/src/main/java/org/qi4j/library/cxf/Qi4jTypeCreator.java
----------------------------------------------------------------------
diff --git a/libraries/cxf/src/main/java/org/qi4j/library/cxf/Qi4jTypeCreator.java b/libraries/cxf/src/main/java/org/qi4j/library/cxf/Qi4jTypeCreator.java
index 9c71d59..9bbf262 100644
--- a/libraries/cxf/src/main/java/org/qi4j/library/cxf/Qi4jTypeCreator.java
+++ b/libraries/cxf/src/main/java/org/qi4j/library/cxf/Qi4jTypeCreator.java
@@ -48,7 +48,7 @@ public class Qi4jTypeCreator extends AbstractTypeCreator
     @Override
     public AegisType createDefaultType( TypeClassInfo info )
     {
-        if( ValueComposite.class.isAssignableFrom( Classes.RAW_CLASS.map( info.getType() ) ) )
+        if( ValueComposite.class.isAssignableFrom( Classes.RAW_CLASS.apply( info.getType() ) ) )
         {
             return module.newObject( ValueCompositeCxfType.class, info.getType(), getTypeMapping() );
         }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/cxf/src/main/java/org/qi4j/library/cxf/ValueCompositeCxfType.java
----------------------------------------------------------------------
diff --git a/libraries/cxf/src/main/java/org/qi4j/library/cxf/ValueCompositeCxfType.java b/libraries/cxf/src/main/java/org/qi4j/library/cxf/ValueCompositeCxfType.java
index bd1fb58..ff7c403 100644
--- a/libraries/cxf/src/main/java/org/qi4j/library/cxf/ValueCompositeCxfType.java
+++ b/libraries/cxf/src/main/java/org/qi4j/library/cxf/ValueCompositeCxfType.java
@@ -23,6 +23,7 @@ import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.function.Function;
 import javax.xml.namespace.QName;
 import org.apache.cxf.aegis.Context;
 import org.apache.cxf.aegis.DatabindingException;
@@ -59,7 +60,6 @@ import org.qi4j.api.value.NoSuchValueException;
 import org.qi4j.api.value.ValueBuilder;
 import org.qi4j.api.value.ValueComposite;
 import org.qi4j.api.value.ValueDescriptor;
-import org.qi4j.functional.Function;
 import org.qi4j.functional.Iterables;
 import org.qi4j.spi.Qi4jSPI;
 
@@ -91,7 +91,7 @@ public class ValueCompositeCxfType
         // Read attributes
         ValueDescriptor descriptor = module.valueDescriptor( className );
         StateDescriptor stateDescriptor = descriptor.state();
-        final Map<QualifiedName, Object> values = new HashMap<>();
+        final Map<QualifiedName, ? super Object> values = new HashMap<>();
         while( reader.hasMoreElementReaders() )
         {
             MessageReader childReader = reader.getNextElementReader();
@@ -111,7 +111,7 @@ public class ValueCompositeCxfType
             new Function<PropertyDescriptor, Object>()
         {
             @Override
-            public Object map( PropertyDescriptor descriptor1 )
+            public Object apply( PropertyDescriptor descriptor1 )
             {
                 return values.get( descriptor1.qualifiedName() );
             }
@@ -119,7 +119,7 @@ public class ValueCompositeCxfType
             new Function<AssociationDescriptor, EntityReference>()
             {
                 @Override
-                public EntityReference map( AssociationDescriptor descriptor )
+                public EntityReference apply( AssociationDescriptor descriptor )
                 {
                     Object value = values.get( descriptor.qualifiedName() );
                     if( value == null )
@@ -132,7 +132,7 @@ public class ValueCompositeCxfType
             new Function<AssociationDescriptor, Iterable<EntityReference>>()
             {
                 @Override
-                public Iterable<EntityReference> map( AssociationDescriptor descriptor )
+                public Iterable<EntityReference> apply( AssociationDescriptor descriptor )
                 {
                     Object value = values.get( descriptor.qualifiedName() );
                     if( value == null )
@@ -151,7 +151,7 @@ public class ValueCompositeCxfType
             new Function<AssociationDescriptor, Map<String, EntityReference>>()
             {
                 @Override
-                public Map<String, EntityReference> map( AssociationDescriptor descriptor )
+                public Map<String, EntityReference> apply( AssociationDescriptor descriptor )
                 {
                     Object value = values.get( descriptor.qualifiedName() );
                     if( value == null )
@@ -178,7 +178,7 @@ public class ValueCompositeCxfType
     {
         ValueComposite composite = (ValueComposite) object;
         writer.writeXsiType( NamespaceUtil.convertJavaTypeToQName(
-            first( Qi4j.FUNCTION_DESCRIPTOR_FOR.map( composite ).types() ) ) );
+            first( Qi4j.FUNCTION_DESCRIPTOR_FOR.apply( composite ).types() ) ) );
         AssociationStateHolder state = spi.stateOf( composite );
         for( Property<?> property : state.properties() )
         {
@@ -188,7 +188,7 @@ public class ValueCompositeCxfType
             {
                 ValueComposite compositeValue = (ValueComposite) value;
                 type = getTypeMapping().getType( NamespaceUtil.convertJavaTypeToQName(
-                    first( Qi4j.FUNCTION_DESCRIPTOR_FOR.map( compositeValue ).types() ) ) );
+                    first( Qi4j.FUNCTION_DESCRIPTOR_FOR.apply( compositeValue ).types() ) ) );
             }
             else if( value != null )
             {
@@ -358,7 +358,7 @@ public class ValueCompositeCxfType
         {
             AegisType keyType = getOrCreateAegisType( getMapKeyComponentType( type ), root );
             AegisType valueType = getOrCreateAegisType( getMapValueComponentType( type ), root );
-            QName schemaType = new QName( Classes.toURI( Classes.RAW_CLASS.map( type ) ), "map" );
+            QName schemaType = new QName( Classes.toURI( Classes.RAW_CLASS.apply( type ) ), "map" );
             return new MapType( schemaType, keyType, valueType );
         }
         else if( isValueComposite( type ) )
@@ -470,7 +470,7 @@ public class ValueCompositeCxfType
     @SuppressWarnings( "raw" )
     private boolean isValueComposite( Type type )
     {
-        Class clazz = Classes.RAW_CLASS.map( type );
+        Class clazz = Classes.RAW_CLASS.apply( type );
         ValueDescriptor descriptor = module.valueDescriptor( clazz.getName() );
         return descriptor != null;
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/eventsourcing-jdbm/src/main/java/org/qi4j/library/eventsourcing/domain/source/jdbm/JdbmEventStoreService.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing-jdbm/src/main/java/org/qi4j/library/eventsourcing/domain/source/jdbm/JdbmEventStoreService.java b/libraries/eventsourcing-jdbm/src/main/java/org/qi4j/library/eventsourcing/domain/source/jdbm/JdbmEventStoreService.java
index 4448210..75aa344 100644
--- a/libraries/eventsourcing-jdbm/src/main/java/org/qi4j/library/eventsourcing/domain/source/jdbm/JdbmEventStoreService.java
+++ b/libraries/eventsourcing-jdbm/src/main/java/org/qi4j/library/eventsourcing/domain/source/jdbm/JdbmEventStoreService.java
@@ -21,6 +21,7 @@ import java.io.File;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.util.Properties;
+import java.util.function.Function;
 import jdbm.RecordManager;
 import jdbm.RecordManagerFactory;
 import jdbm.RecordManagerOptions;
@@ -37,7 +38,6 @@ import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.service.ServiceComposite;
 import org.qi4j.api.service.qualifier.Tagged;
 import org.qi4j.api.value.ValueSerialization;
-import org.qi4j.functional.Function;
 import org.qi4j.io.Input;
 import org.qi4j.io.Output;
 import org.qi4j.io.Receiver;
@@ -123,7 +123,7 @@ public interface JdbmEventStoreService
             }, Transforms.map( new Function<String, UnitOfWorkDomainEventsValue>()
             {
                 @Override
-                public UnitOfWorkDomainEventsValue map( String item )
+                public UnitOfWorkDomainEventsValue apply( String item )
                 {
                     return valueSerialization.<UnitOfWorkDomainEventsValue>deserialize( eventsType, item );
                 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/eventsourcing-jdbm/src/test/java/org/qi4j/library/eventsourcing/domain/source/jdbm/JdbmEventStoreServiceTest.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing-jdbm/src/test/java/org/qi4j/library/eventsourcing/domain/source/jdbm/JdbmEventStoreServiceTest.java b/libraries/eventsourcing-jdbm/src/test/java/org/qi4j/library/eventsourcing/domain/source/jdbm/JdbmEventStoreServiceTest.java
index 0068c5f..705d051 100644
--- a/libraries/eventsourcing-jdbm/src/test/java/org/qi4j/library/eventsourcing/domain/source/jdbm/JdbmEventStoreServiceTest.java
+++ b/libraries/eventsourcing-jdbm/src/test/java/org/qi4j/library/eventsourcing/domain/source/jdbm/JdbmEventStoreServiceTest.java
@@ -16,6 +16,7 @@ package org.qi4j.library.eventsourcing.domain.source.jdbm;
 
 import java.io.IOException;
 import java.security.Principal;
+import java.util.function.Function;
 import org.junit.Test;
 import org.qi4j.api.common.UseDefaults;
 import org.qi4j.api.entity.EntityComposite;
@@ -27,7 +28,6 @@ import org.qi4j.api.usecase.UsecaseBuilder;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ImportedServiceDeclaration;
 import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.functional.Function;
 import org.qi4j.io.Outputs;
 import org.qi4j.io.Transforms;
 import org.qi4j.library.eventsourcing.domain.api.DomainEvent;
@@ -91,7 +91,7 @@ public class JdbmEventStoreServiceTest
 
             source.events( 0, Long.MAX_VALUE ).transferTo( Transforms.map( new Function<UnitOfWorkDomainEventsValue, String>()
                     {
-                        public String map( UnitOfWorkDomainEventsValue unitOfWorkDomainEventsValue )
+                        public String apply( UnitOfWorkDomainEventsValue unitOfWorkDomainEventsValue )
                         {
                             return unitOfWorkDomainEventsValue.toString();
                         }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/source/helper/ApplicationEvents.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/source/helper/ApplicationEvents.java b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/source/helper/ApplicationEvents.java
index 4205cd0..c79f130 100644
--- a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/source/helper/ApplicationEvents.java
+++ b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/source/helper/ApplicationEvents.java
@@ -20,10 +20,10 @@ import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.function.Function;
+import java.util.function.Predicate;
 import org.qi4j.api.util.Methods;
-import org.qi4j.functional.Function;
 import org.qi4j.functional.Iterables;
-import org.qi4j.functional.Specification;
 import org.qi4j.io.Output;
 import org.qi4j.io.Receiver;
 import org.qi4j.io.Sender;
@@ -61,19 +61,19 @@ public class ApplicationEvents
         return Iterables.flatten( events.<Iterable<ApplicationEvent>>toArray( iterables ) );
     }
 
-    public static boolean matches( Specification<ApplicationEvent> specification, Iterable<TransactionApplicationEvents> transactions )
+    public static boolean matches( Predicate<ApplicationEvent> specification, Iterable<TransactionApplicationEvents> transactions )
     {
         return Iterables.filter( specification, events( transactions ) ).iterator().hasNext();
     }
 
     // Common specifications
 
-    public static Specification<ApplicationEvent> withNames( final Iterable<String> names )
+    public static Predicate<ApplicationEvent> withNames( final Iterable<String> names )
     {
-        return new Specification<ApplicationEvent>()
+        return new Predicate<ApplicationEvent>()
         {
             @Override
-            public boolean satisfiedBy( ApplicationEvent event )
+            public boolean test( ApplicationEvent event )
             {
                 for (String name : names)
                 {
@@ -85,12 +85,12 @@ public class ApplicationEvents
         };
     }
 
-    public static Specification<ApplicationEvent> withNames( final String... names )
+    public static Predicate<ApplicationEvent> withNames( final String... names )
     {
-        return new Specification<ApplicationEvent>()
+        return new Predicate<ApplicationEvent>()
         {
             @Override
-            public boolean satisfiedBy( ApplicationEvent event )
+            public boolean test( ApplicationEvent event )
             {
                 for (String name : names)
                 {
@@ -102,48 +102,48 @@ public class ApplicationEvents
         };
     }
 
-    public static Specification<ApplicationEvent> withNames( final Class eventClass )
+    public static Predicate<ApplicationEvent> withNames( final Class eventClass )
     {
         return ApplicationEvents.withNames( Iterables.map( new Function<Method, String>()
         {
             @Override
-            public String map( Method method )
+            public String apply( Method method )
             {
                 return method.getName();
             }
-        }, Iterables.toList( Methods.METHODS_OF.map( eventClass ) ) ));
+        }, Iterables.toList( Methods.METHODS_OF.apply( eventClass ) ) ));
     }
 
-    public static Specification<ApplicationEvent> afterDate( final Date afterDate )
+    public static Predicate<ApplicationEvent> afterDate( final Date afterDate )
     {
-        return new Specification<ApplicationEvent>()
+        return new Predicate<ApplicationEvent>()
         {
             @Override
-            public boolean satisfiedBy( ApplicationEvent event )
+            public boolean test( ApplicationEvent event )
             {
                 return event.on().get().after( afterDate );
             }
         };
     }
 
-    public static Specification<ApplicationEvent> beforeDate( final Date beforeDate )
+    public static Predicate<ApplicationEvent> beforeDate( final Date beforeDate )
     {
-        return new Specification<ApplicationEvent>()
+        return new Predicate<ApplicationEvent>()
         {
             @Override
-            public boolean satisfiedBy( ApplicationEvent event )
+            public boolean test( ApplicationEvent event )
             {
                 return event.on().get().before( beforeDate );
             }
         };
     }
 
-    public static Specification<ApplicationEvent> withUsecases( final String... names )
+    public static Predicate<ApplicationEvent> withUsecases( final String... names )
     {
-        return new Specification<ApplicationEvent>()
+        return new Predicate<ApplicationEvent>()
         {
             @Override
-            public boolean satisfiedBy( ApplicationEvent event )
+            public boolean test( ApplicationEvent event )
             {
                 for (String name : names)
                 {
@@ -155,12 +155,12 @@ public class ApplicationEvents
         };
     }
 
-    public static Specification<ApplicationEvent> paramIs( final String name, final String value )
+    public static Predicate<ApplicationEvent> paramIs( final String name, final String value )
     {
-        return new Specification<ApplicationEvent>()
+        return new Predicate<ApplicationEvent>()
         {
             @Override
-            public boolean satisfiedBy( ApplicationEvent event )
+            public boolean test( ApplicationEvent event )
             {
                 return ApplicationEventParameters.getParameter( event, name ).equals( value );
             }
@@ -169,7 +169,7 @@ public class ApplicationEvents
 
     public static Output<TransactionApplicationEvents, ApplicationEventReplayException> playEvents( final ApplicationEventPlayer player, final Object eventHandler )
     {
-        final Specification<ApplicationEvent> specification = ApplicationEvents.withNames( eventHandler.getClass() );
+        final Predicate<ApplicationEvent> specification = ApplicationEvents.withNames( eventHandler.getClass() );
 
         return new Output<TransactionApplicationEvents, ApplicationEventReplayException>()
         {
@@ -183,7 +183,7 @@ public class ApplicationEvents
                     {
                         for (ApplicationEvent applicationEvent : events( item ))
                         {
-                            if (specification.satisfiedBy( applicationEvent ))
+                            if (specification.test( applicationEvent ))
                                 player.playEvent( applicationEvent, eventHandler );
                         }
                     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/factory/DomainEventFactoryService.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/factory/DomainEventFactoryService.java b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/factory/DomainEventFactoryService.java
index 9194ba1..6212038 100644
--- a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/factory/DomainEventFactoryService.java
+++ b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/factory/DomainEventFactoryService.java
@@ -54,7 +54,7 @@ public interface DomainEventFactoryService
 
             DomainEventValue prototype = builder.prototype();
             prototype.name().set( name );
-            prototype.entityType().set( first(Qi4j.FUNCTION_DESCRIPTOR_FOR.map( entity ).types()).getName() );
+            prototype.entityType().set( first(Qi4j.FUNCTION_DESCRIPTOR_FOR.apply( entity ).types()).getName() );
             prototype.entityId().set( entity.identity().get() );
 
             // JSON-ify parameters

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/helper/EventRouter.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/helper/EventRouter.java b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/helper/EventRouter.java
index 9594a8b..dcdd1f0 100644
--- a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/helper/EventRouter.java
+++ b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/helper/EventRouter.java
@@ -19,7 +19,7 @@ package org.qi4j.library.eventsourcing.domain.source.helper;
 
 import java.util.LinkedHashMap;
 import java.util.Map;
-import org.qi4j.functional.Specification;
+import java.util.function.Predicate;
 import org.qi4j.io.Output;
 import org.qi4j.io.Receiver;
 import org.qi4j.io.Sender;
@@ -35,7 +35,7 @@ import org.qi4j.library.eventsourcing.domain.api.UnitOfWorkDomainEventsValue;
 public class EventRouter<T extends Throwable>
         implements Output<DomainEventValue, T>, Receiver<UnitOfWorkDomainEventsValue, T>
 {
-    private Map<Specification<DomainEventValue>, Receiver<DomainEventValue, T>> routeEvent = new LinkedHashMap<Specification<DomainEventValue>, Receiver<DomainEventValue, T>>();
+    private Map<Predicate<DomainEventValue>, Receiver<DomainEventValue, T>> routeEvent = new LinkedHashMap<Predicate<DomainEventValue>, Receiver<DomainEventValue, T>>();
 
     private Receiver<DomainEventValue, T> defaultReceiver = new Receiver<DomainEventValue, T>()
     {
@@ -46,7 +46,7 @@ public class EventRouter<T extends Throwable>
         }
     };
 
-    public EventRouter route( Specification<DomainEventValue> specification, Receiver<DomainEventValue, T> receiver )
+    public EventRouter route( Predicate<DomainEventValue> specification, Receiver<DomainEventValue, T> receiver )
     {
         routeEvent.put( specification, receiver );
 
@@ -67,9 +67,9 @@ public class EventRouter<T extends Throwable>
             @Override
             public void receive( DomainEventValue item ) throws T
             {
-                for( Map.Entry<Specification<DomainEventValue>, Receiver<DomainEventValue, T>> specificationReceiverEntry : routeEvent.entrySet() )
+                for( Map.Entry<Predicate<DomainEventValue>, Receiver<DomainEventValue, T>> specificationReceiverEntry : routeEvent.entrySet() )
                 {
-                    if( specificationReceiverEntry.getKey().satisfiedBy( item ) )
+                    if( specificationReceiverEntry.getKey().test( item ) )
                     {
                         specificationReceiverEntry.getValue().receive( item );
                         return;

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/helper/Events.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/helper/Events.java b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/helper/Events.java
index 238b85d..3d1d1a0 100644
--- a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/helper/Events.java
+++ b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/helper/Events.java
@@ -18,10 +18,10 @@ package org.qi4j.library.eventsourcing.domain.source.helper;
 
 import java.lang.reflect.Method;
 import java.util.Date;
+import java.util.function.Function;
+import java.util.function.Predicate;
 import org.qi4j.api.util.Methods;
-import org.qi4j.functional.Function;
 import org.qi4j.functional.Iterables;
-import org.qi4j.functional.Specification;
 import org.qi4j.library.eventsourcing.domain.api.DomainEventValue;
 import org.qi4j.library.eventsourcing.domain.api.UnitOfWorkDomainEventsValue;
 
@@ -37,7 +37,7 @@ public class Events
         return Iterables.flattenIterables( Iterables.map( new Function<UnitOfWorkDomainEventsValue, Iterable<DomainEventValue>>()
         {
             @Override
-            public Iterable<DomainEventValue> map( UnitOfWorkDomainEventsValue unitOfWorkDomainEventsValue )
+            public Iterable<DomainEventValue> apply( UnitOfWorkDomainEventsValue unitOfWorkDomainEventsValue )
             {
                 return unitOfWorkDomainEventsValue.events().get();
             }
@@ -50,36 +50,36 @@ public class Events
     }
 
     // Common specifications
-    public static Specification<UnitOfWorkDomainEventsValue> afterDate( final Date afterDate )
+    public static Predicate<UnitOfWorkDomainEventsValue> afterDate( final Date afterDate )
     {
-        return new Specification<UnitOfWorkDomainEventsValue>()
+        return new Predicate<UnitOfWorkDomainEventsValue>()
         {
             @Override
-            public boolean satisfiedBy( UnitOfWorkDomainEventsValue eventValue )
+            public boolean test( UnitOfWorkDomainEventsValue eventValue )
             {
                 return eventValue.timestamp().get() > afterDate.getTime();
             }
         };
     }
 
-    public static Specification<UnitOfWorkDomainEventsValue> beforeDate( final Date afterDate )
+    public static Predicate<UnitOfWorkDomainEventsValue> beforeDate( final Date afterDate )
     {
-        return new Specification<UnitOfWorkDomainEventsValue>()
+        return new Predicate<UnitOfWorkDomainEventsValue>()
         {
             @Override
-            public boolean satisfiedBy( UnitOfWorkDomainEventsValue eventValue )
+            public boolean test( UnitOfWorkDomainEventsValue eventValue )
             {
                 return eventValue.timestamp().get() < afterDate.getTime();
             }
         };
     }
 
-    public static Specification<UnitOfWorkDomainEventsValue> withUsecases( final String... names )
+    public static Predicate<UnitOfWorkDomainEventsValue> withUsecases( final String... names )
     {
-        return new Specification<UnitOfWorkDomainEventsValue>()
+        return new Predicate<UnitOfWorkDomainEventsValue>()
         {
             @Override
-            public boolean satisfiedBy( UnitOfWorkDomainEventsValue eventValue )
+            public boolean test( UnitOfWorkDomainEventsValue eventValue )
             {
                 for (String name : names)
                 {
@@ -91,12 +91,12 @@ public class Events
         };
     }
 
-    public static Specification<UnitOfWorkDomainEventsValue> byUser( final String... by )
+    public static Predicate<UnitOfWorkDomainEventsValue> byUser( final String... by )
     {
-        return new Specification<UnitOfWorkDomainEventsValue>()
+        return new Predicate<UnitOfWorkDomainEventsValue>()
         {
             @Override
-            public boolean satisfiedBy( UnitOfWorkDomainEventsValue eventValue )
+            public boolean test( UnitOfWorkDomainEventsValue eventValue )
             {
                 for (String user : by)
                 {
@@ -108,12 +108,12 @@ public class Events
         };
     }
 
-    public static Specification<DomainEventValue> withNames( final Iterable<String> names )
+    public static Predicate<DomainEventValue> withNames( final Iterable<String> names )
     {
-        return new Specification<DomainEventValue>()
+        return new Predicate<DomainEventValue>()
         {
             @Override
-            public boolean satisfiedBy( DomainEventValue eventValue )
+            public boolean test( DomainEventValue eventValue )
             {
                 for (String name : names)
                 {
@@ -125,12 +125,12 @@ public class Events
         };
     }
 
-    public static Specification<DomainEventValue> withNames( final String... names )
+    public static Predicate<DomainEventValue> withNames( final String... names )
     {
-        return new Specification<DomainEventValue>()
+        return new Predicate<DomainEventValue>()
         {
             @Override
-            public boolean satisfiedBy( DomainEventValue eventValue )
+            public boolean test( DomainEventValue eventValue )
             {
                 for (String name : names)
                 {
@@ -142,24 +142,24 @@ public class Events
         };
     }
 
-    public static Specification<DomainEventValue> withNames( final Class eventClass )
+    public static Predicate<DomainEventValue> withNames( final Class eventClass )
     {
         return Events.withNames( map( new Function<Method, String>()
         {
             @Override
-            public String map( Method method )
+            public String apply( Method method )
             {
                 return method.getName();
             }
-        }, Iterables.toList( Methods.METHODS_OF.map( eventClass ) ) ));
+        }, Iterables.toList( Methods.METHODS_OF.apply( eventClass ) ) ));
     }
 
-    public static Specification<DomainEventValue> onEntities( final String... entities )
+    public static Predicate<DomainEventValue> onEntities( final String... entities )
     {
-        return new Specification<DomainEventValue>()
+        return new Predicate<DomainEventValue>()
         {
             @Override
-            public boolean satisfiedBy( DomainEventValue eventValue )
+            public boolean test( DomainEventValue eventValue )
             {
                 for (String entity : entities)
                 {
@@ -171,12 +171,12 @@ public class Events
         };
     }
 
-    public static Specification<DomainEventValue> onEntityTypes( final String... entityTypes )
+    public static Predicate<DomainEventValue> onEntityTypes( final String... entityTypes )
     {
-        return new Specification<DomainEventValue>()
+        return new Predicate<DomainEventValue>()
         {
             @Override
-            public boolean satisfiedBy( DomainEventValue eventValue )
+            public boolean test( DomainEventValue eventValue )
             {
                 for (String entityType : entityTypes)
                 {
@@ -188,12 +188,12 @@ public class Events
         };
     }
 
-    public static Specification<DomainEventValue> paramIs( final String name, final String value )
+    public static Predicate<DomainEventValue> paramIs( final String name, final String value )
     {
-        return new Specification<DomainEventValue>()
+        return new Predicate<DomainEventValue>()
         {
             @Override
-            public boolean satisfiedBy( DomainEventValue eventValue )
+            public boolean test( DomainEventValue eventValue )
             {
                 return EventParameters.getParameter( eventValue, name ).equals( value );
             }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/helper/UnitOfWorkRouter.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/helper/UnitOfWorkRouter.java b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/helper/UnitOfWorkRouter.java
index fabbc34..72b188e 100644
--- a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/helper/UnitOfWorkRouter.java
+++ b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/helper/UnitOfWorkRouter.java
@@ -19,7 +19,7 @@ package org.qi4j.library.eventsourcing.domain.source.helper;
 
 import java.util.LinkedHashMap;
 import java.util.Map;
-import org.qi4j.functional.Specification;
+import java.util.function.Predicate;
 import org.qi4j.io.Output;
 import org.qi4j.io.Receiver;
 import org.qi4j.io.Sender;
@@ -33,7 +33,7 @@ import org.qi4j.library.eventsourcing.domain.api.UnitOfWorkDomainEventsValue;
 public class UnitOfWorkRouter<T extends Throwable>
     implements Output<UnitOfWorkDomainEventsValue, T>
 {
-    private Map<Specification<UnitOfWorkDomainEventsValue>, Receiver<UnitOfWorkDomainEventsValue, T>> routes = new LinkedHashMap<Specification<UnitOfWorkDomainEventsValue>, Receiver<UnitOfWorkDomainEventsValue, T>>(  );
+    private Map<Predicate<UnitOfWorkDomainEventsValue>, Receiver<UnitOfWorkDomainEventsValue, T>> routes = new LinkedHashMap<Predicate<UnitOfWorkDomainEventsValue>, Receiver<UnitOfWorkDomainEventsValue, T>>(  );
 
     private Receiver<UnitOfWorkDomainEventsValue, T> defaultReceiver = new Receiver<UnitOfWorkDomainEventsValue, T>()
     {
@@ -44,7 +44,7 @@ public class UnitOfWorkRouter<T extends Throwable>
         }
     };
 
-    public UnitOfWorkRouter route( Specification<UnitOfWorkDomainEventsValue> specification, Receiver<UnitOfWorkDomainEventsValue, T> receiver)
+    public UnitOfWorkRouter route( Predicate<UnitOfWorkDomainEventsValue> specification, Receiver<UnitOfWorkDomainEventsValue, T> receiver)
     {
         routes.put(specification, receiver);
 
@@ -65,9 +65,9 @@ public class UnitOfWorkRouter<T extends Throwable>
             @Override
             public void receive( UnitOfWorkDomainEventsValue item ) throws T
             {
-                for( Map.Entry<Specification<UnitOfWorkDomainEventsValue>, Receiver<UnitOfWorkDomainEventsValue, T>> specificationReceiverEntry : routes.entrySet() )
+                for( Map.Entry<Predicate<UnitOfWorkDomainEventsValue>, Receiver<UnitOfWorkDomainEventsValue, T>> specificationReceiverEntry : routes.entrySet() )
                 {
-                    if (specificationReceiverEntry.getKey().satisfiedBy( item ))
+                    if (specificationReceiverEntry.getKey().test( item ))
                     {
                         specificationReceiverEntry.getValue().receive( item );
                         return;

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/eventsourcing/src/test/java/org/qi4j/library/eventsourcing/domain/DomainEventTest.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/test/java/org/qi4j/library/eventsourcing/domain/DomainEventTest.java b/libraries/eventsourcing/src/test/java/org/qi4j/library/eventsourcing/domain/DomainEventTest.java
index 7a84999..0f7f4e0 100644
--- a/libraries/eventsourcing/src/test/java/org/qi4j/library/eventsourcing/domain/DomainEventTest.java
+++ b/libraries/eventsourcing/src/test/java/org/qi4j/library/eventsourcing/domain/DomainEventTest.java
@@ -14,6 +14,7 @@
 
 package org.qi4j.library.eventsourcing.domain;
 
+import java.util.function.Function;
 import org.junit.Test;
 import org.qi4j.api.common.UseDefaults;
 import org.qi4j.api.entity.EntityComposite;
@@ -25,7 +26,6 @@ import org.qi4j.api.usecase.UsecaseBuilder;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ImportedServiceDeclaration;
 import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.functional.Function;
 import org.qi4j.io.Outputs;
 import org.qi4j.io.Transforms;
 import org.qi4j.library.eventsourcing.domain.api.DomainEvent;
@@ -86,7 +86,7 @@ public class DomainEventTest
 
         source.events( 0, Long.MAX_VALUE ).transferTo( Transforms.map( new Function<UnitOfWorkDomainEventsValue, String>()
                 {
-                    public String map( UnitOfWorkDomainEventsValue unitOfWorkDomainEventsValue )
+                    public String apply( UnitOfWorkDomainEventsValue unitOfWorkDomainEventsValue )
                     {
                         return unitOfWorkDomainEventsValue.toString();
                     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/eventsourcing/src/test/java/org/qi4j/library/eventsourcing/domain/source/helper/DomainEventTrackerTest.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/test/java/org/qi4j/library/eventsourcing/domain/source/helper/DomainEventTrackerTest.java b/libraries/eventsourcing/src/test/java/org/qi4j/library/eventsourcing/domain/source/helper/DomainEventTrackerTest.java
index 6976a54..0054d33 100644
--- a/libraries/eventsourcing/src/test/java/org/qi4j/library/eventsourcing/domain/source/helper/DomainEventTrackerTest.java
+++ b/libraries/eventsourcing/src/test/java/org/qi4j/library/eventsourcing/domain/source/helper/DomainEventTrackerTest.java
@@ -16,6 +16,7 @@ package org.qi4j.library.eventsourcing.domain.source.helper;
 
 import java.io.IOException;
 import java.security.Principal;
+import java.util.function.Function;
 import org.junit.Test;
 import org.qi4j.api.activation.ActivatorAdapter;
 import org.qi4j.api.activation.Activators;
@@ -34,7 +35,6 @@ import org.qi4j.api.usecase.UsecaseBuilder;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ImportedServiceDeclaration;
 import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.functional.Function;
 import org.qi4j.io.Output;
 import org.qi4j.io.Outputs;
 import org.qi4j.io.Transforms;
@@ -163,7 +163,7 @@ public class DomainEventTrackerTest
 
                Output<UnitOfWorkDomainEventsValue,RuntimeException> map = Transforms.map( new Function<UnitOfWorkDomainEventsValue, String>()
                        {
-                           public String map( UnitOfWorkDomainEventsValue unitOfWorkDomainEventsValue )
+                           public String apply( UnitOfWorkDomainEventsValue unitOfWorkDomainEventsValue )
                            {
                                return unitOfWorkDomainEventsValue.toString();
                            }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/jmx/src/main/java/org/qi4j/library/jmx/ConfigurationManagerService.java
----------------------------------------------------------------------
diff --git a/libraries/jmx/src/main/java/org/qi4j/library/jmx/ConfigurationManagerService.java b/libraries/jmx/src/main/java/org/qi4j/library/jmx/ConfigurationManagerService.java
index a5194bb..b21a180 100644
--- a/libraries/jmx/src/main/java/org/qi4j/library/jmx/ConfigurationManagerService.java
+++ b/libraries/jmx/src/main/java/org/qi4j/library/jmx/ConfigurationManagerService.java
@@ -138,7 +138,7 @@ public interface ConfigurationManagerService
                 }
 
                 // Check if service has configuration
-                CompositeInstance compositeInstance = Qi4j.FUNCTION_COMPOSITE_INSTANCE_OF.map( (Composite) service );
+                CompositeInstance compositeInstance = Qi4j.FUNCTION_COMPOSITE_INSTANCE_OF.apply( (Composite) service );
                 try
                 {
                     Configuration config = compositeInstance.newProxy( Configuration.class );
@@ -406,7 +406,7 @@ public interface ConfigurationManagerService
                         {
                             // Refresh configuration
                             CompositeInstance compositeInstance = Qi4j.FUNCTION_COMPOSITE_INSTANCE_OF
-                                .map( (Composite) serviceRef.get() );
+                                .apply( (Composite) serviceRef.get() );
                             compositeInstance.newProxy( Configuration.class ).refresh();
 
                             ( (Activation) serviceRef ).passivate();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/jmx/src/main/java/org/qi4j/library/jmx/Qi4jMBeans.java
----------------------------------------------------------------------
diff --git a/libraries/jmx/src/main/java/org/qi4j/library/jmx/Qi4jMBeans.java b/libraries/jmx/src/main/java/org/qi4j/library/jmx/Qi4jMBeans.java
index 9ec0e95..8f719ef 100644
--- a/libraries/jmx/src/main/java/org/qi4j/library/jmx/Qi4jMBeans.java
+++ b/libraries/jmx/src/main/java/org/qi4j/library/jmx/Qi4jMBeans.java
@@ -13,11 +13,11 @@
  */
 package org.qi4j.library.jmx;
 
+import java.util.function.Predicate;
 import javax.management.MBeanServer;
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 import org.qi4j.functional.Iterables;
-import org.qi4j.functional.Specification;
 
 /**
  * Helper for working with Qi4j MBeans.
@@ -28,10 +28,10 @@ public class Qi4jMBeans
     public static ObjectName findServiceName( MBeanServer server, String applicationName, String serviceId )
             throws MalformedObjectNameException
     {
-        return Iterables.first( Iterables.filter( new Specification<ObjectName>()
+        return Iterables.first( Iterables.filter( new Predicate<ObjectName>()
         {
             @Override
-            public boolean satisfiedBy( ObjectName item )
+            public boolean test( ObjectName item )
             {
                 return item.getKeyPropertyList().size() == 5;
             }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/lang-scala/src/main/java/org/qi4j/lang/scala/ScalaTraitMixin.java
----------------------------------------------------------------------
diff --git a/libraries/lang-scala/src/main/java/org/qi4j/lang/scala/ScalaTraitMixin.java b/libraries/lang-scala/src/main/java/org/qi4j/lang/scala/ScalaTraitMixin.java
index 04c4048..9c0a24c 100644
--- a/libraries/lang-scala/src/main/java/org/qi4j/lang/scala/ScalaTraitMixin.java
+++ b/libraries/lang-scala/src/main/java/org/qi4j/lang/scala/ScalaTraitMixin.java
@@ -24,6 +24,7 @@ import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.function.Function;
 import org.qi4j.api.Qi4j;
 import org.qi4j.api.common.AppliesTo;
 import org.qi4j.api.common.AppliesToFilter;
@@ -33,7 +34,6 @@ import org.qi4j.api.injection.scope.Service;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.service.ServiceReference;
 import org.qi4j.api.util.Classes;
-import org.qi4j.functional.Function;
 import org.qi4j.functional.Iterables;
 
 import static org.qi4j.api.util.Classes.interfacesOf;
@@ -51,7 +51,7 @@ public class ScalaTraitMixin
 
     public ScalaTraitMixin( @This Composite composite )
     {
-        compositeType = Qi4j.FUNCTION_DESCRIPTOR_FOR.map( composite).primaryType();
+        compositeType = Qi4j.FUNCTION_DESCRIPTOR_FOR.apply( composite ).primaryType();
     }
 
     @Override
@@ -107,7 +107,7 @@ public class ScalaTraitMixin
                     Class current;
 
                     @Override
-                    public Class map( Class aClass )
+                    public Class apply( Class aClass )
                     {
                         if ( declaringClass.isAssignableFrom(aClass))
                         {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/logging/src/main/java/org/qi4j/logging/debug/service/DebugOnConsoleSideEffect.java
----------------------------------------------------------------------
diff --git a/libraries/logging/src/main/java/org/qi4j/logging/debug/service/DebugOnConsoleSideEffect.java b/libraries/logging/src/main/java/org/qi4j/logging/debug/service/DebugOnConsoleSideEffect.java
index 14fa3e4..ab4dc50 100644
--- a/libraries/logging/src/main/java/org/qi4j/logging/debug/service/DebugOnConsoleSideEffect.java
+++ b/libraries/logging/src/main/java/org/qi4j/logging/debug/service/DebugOnConsoleSideEffect.java
@@ -62,7 +62,7 @@ public class DebugOnConsoleSideEffect extends SideEffectOf<LoggingService>
 
     private String getCompositeName( Composite composite )
     {
-        return first(Qi4j.FUNCTION_DESCRIPTOR_FOR.map( composite ).types()).getName();
+        return first(Qi4j.FUNCTION_DESCRIPTOR_FOR.apply( composite ).types()).getName();
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/logging/src/main/java/org/qi4j/logging/debug/service/DebuggingServiceMixin.java
----------------------------------------------------------------------
diff --git a/libraries/logging/src/main/java/org/qi4j/logging/debug/service/DebuggingServiceMixin.java b/libraries/logging/src/main/java/org/qi4j/logging/debug/service/DebuggingServiceMixin.java
index a77307e..111ff75 100644
--- a/libraries/logging/src/main/java/org/qi4j/logging/debug/service/DebuggingServiceMixin.java
+++ b/libraries/logging/src/main/java/org/qi4j/logging/debug/service/DebuggingServiceMixin.java
@@ -175,6 +175,6 @@ public class DebuggingServiceMixin
 
     private String getCompositeName( Composite composite )
     {
-        return first(Qi4j.FUNCTION_DESCRIPTOR_FOR.map( composite ).types()).getName();
+        return first(Qi4j.FUNCTION_DESCRIPTOR_FOR.apply( composite ).types()).getName();
     }
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/logging/src/main/java/org/qi4j/logging/log/SimpleLogConcern.java
----------------------------------------------------------------------
diff --git a/libraries/logging/src/main/java/org/qi4j/logging/log/SimpleLogConcern.java b/libraries/logging/src/main/java/org/qi4j/logging/log/SimpleLogConcern.java
index d096aa5..3e74170 100644
--- a/libraries/logging/src/main/java/org/qi4j/logging/log/SimpleLogConcern.java
+++ b/libraries/logging/src/main/java/org/qi4j/logging/log/SimpleLogConcern.java
@@ -39,7 +39,7 @@ public final class SimpleLogConcern
     public SimpleLogConcern( @This Composite composite )
     {
         this.composite = composite;
-        Class<?> type = first( Qi4j.FUNCTION_DESCRIPTOR_FOR.map( composite ).types() );
+        Class<?> type = first( Qi4j.FUNCTION_DESCRIPTOR_FOR.apply( composite ).types() );
         category = type.getName();
     }
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/logging/src/main/java/org/qi4j/logging/log/service/LogOnConsoleSideEffect.java
----------------------------------------------------------------------
diff --git a/libraries/logging/src/main/java/org/qi4j/logging/log/service/LogOnConsoleSideEffect.java b/libraries/logging/src/main/java/org/qi4j/logging/log/service/LogOnConsoleSideEffect.java
index 72d3626..708cd14 100644
--- a/libraries/logging/src/main/java/org/qi4j/logging/log/service/LogOnConsoleSideEffect.java
+++ b/libraries/logging/src/main/java/org/qi4j/logging/log/service/LogOnConsoleSideEffect.java
@@ -54,7 +54,7 @@ public abstract class LogOnConsoleSideEffect extends SideEffectOf<LoggingService
 
     private String getCompositeName( Composite composite )
     {
-        return first( Qi4j.FUNCTION_DESCRIPTOR_FOR.map( composite ).types()).getName();
+        return first( Qi4j.FUNCTION_DESCRIPTOR_FOR.apply( composite ).types()).getName();
     }
 
     public void log( LogType type, Composite composite, String category, String message, Object param1 )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/logging/src/main/java/org/qi4j/logging/log/service/LoggingServiceMixin.java
----------------------------------------------------------------------
diff --git a/libraries/logging/src/main/java/org/qi4j/logging/log/service/LoggingServiceMixin.java b/libraries/logging/src/main/java/org/qi4j/logging/log/service/LoggingServiceMixin.java
index 9374913..70eb45c 100644
--- a/libraries/logging/src/main/java/org/qi4j/logging/log/service/LoggingServiceMixin.java
+++ b/libraries/logging/src/main/java/org/qi4j/logging/log/service/LoggingServiceMixin.java
@@ -166,6 +166,6 @@ public abstract class LoggingServiceMixin
 
     private String getCompositeName( Composite composite )
     {
-        return first(Qi4j.FUNCTION_DESCRIPTOR_FOR.map( composite ).types()).getName();
+        return first(Qi4j.FUNCTION_DESCRIPTOR_FOR.apply( composite ).types()).getName();
     }
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/logging/src/main/java/org/qi4j/logging/trace/service/TraceServiceMixin.java
----------------------------------------------------------------------
diff --git a/libraries/logging/src/main/java/org/qi4j/logging/trace/service/TraceServiceMixin.java b/libraries/logging/src/main/java/org/qi4j/logging/trace/service/TraceServiceMixin.java
index 8f20625..b926c12 100644
--- a/libraries/logging/src/main/java/org/qi4j/logging/trace/service/TraceServiceMixin.java
+++ b/libraries/logging/src/main/java/org/qi4j/logging/trace/service/TraceServiceMixin.java
@@ -104,7 +104,7 @@ public class TraceServiceMixin
             EntityComposite entity = (EntityComposite) object;
             String identity = entity.identity().get();
             EntityComposite source = (EntityComposite) uow.get( (Class<?>) first(
-                Qi4j.FUNCTION_DESCRIPTOR_FOR.map( entity ).types() ), identity );
+                Qi4j.FUNCTION_DESCRIPTOR_FOR.apply( entity ).types() ), identity );
             EntityBuilder<EntityTraceRecordEntity> builder = uow.newEntityBuilder( EntityTraceRecordEntity.class );
             EntityTraceRecordEntity state = builder.instance();
             setStandardStuff( compositeType, method, args, entryTime, durationNano, state, exception );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/logging/src/test/java/org/qi4j/logging/DebuggingTest.java
----------------------------------------------------------------------
diff --git a/libraries/logging/src/test/java/org/qi4j/logging/DebuggingTest.java b/libraries/logging/src/test/java/org/qi4j/logging/DebuggingTest.java
index 108da7a..c325da0 100644
--- a/libraries/logging/src/test/java/org/qi4j/logging/DebuggingTest.java
+++ b/libraries/logging/src/test/java/org/qi4j/logging/DebuggingTest.java
@@ -18,7 +18,7 @@
 
 package org.qi4j.logging;
 
-import org.junit.Ignore;
+import java.util.function.Function;
 import org.junit.Test;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.mixin.Mixins;
@@ -28,7 +28,6 @@ import org.qi4j.api.unitofwork.UnitOfWork;
 import org.qi4j.api.unitofwork.UnitOfWorkCompletionException;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.functional.Function;
 import org.qi4j.io.Outputs;
 import org.qi4j.io.Transforms;
 import org.qi4j.logging.debug.Debug;
@@ -79,7 +78,7 @@ public class DebuggingTest
             final String[] result = new String[1];
             es.entityStates( module ).transferTo( Transforms.map( new Function<EntityState, EntityState>()
                     {
-                        public EntityState map( EntityState entityState )
+                        public EntityState apply( EntityState entityState )
                         {
                             if( ServiceDebugRecordEntity.class.getName()
                                     .equals( first(entityState.entityDescriptor().types()).getName() ) )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/rdf/src/main/java/org/qi4j/library/rdf/entity/EntityStateSerializer.java
----------------------------------------------------------------------
diff --git a/libraries/rdf/src/main/java/org/qi4j/library/rdf/entity/EntityStateSerializer.java b/libraries/rdf/src/main/java/org/qi4j/library/rdf/entity/EntityStateSerializer.java
index b26fade..ad83bdb 100644
--- a/libraries/rdf/src/main/java/org/qi4j/library/rdf/entity/EntityStateSerializer.java
+++ b/libraries/rdf/src/main/java/org/qi4j/library/rdf/entity/EntityStateSerializer.java
@@ -168,7 +168,7 @@ public class EntityStateSerializer
         for( PropertyDescriptor persistentProperty : ( (ValueCompositeType) valueType ).properties() )
         {
             Object propertyValue = Qi4j.FUNCTION_COMPOSITE_INSTANCE_OF
-                .map( (Composite) value )
+                .apply( (Composite) value )
                 .state()
                 .propertyFor( persistentProperty.accessor() )
                 .get();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/rdf/src/main/java/org/qi4j/library/rdf/entity/EntityTypeSerializer.java
----------------------------------------------------------------------
diff --git a/libraries/rdf/src/main/java/org/qi4j/library/rdf/entity/EntityTypeSerializer.java b/libraries/rdf/src/main/java/org/qi4j/library/rdf/entity/EntityTypeSerializer.java
index 5f7cd97..a7c8aca 100644
--- a/libraries/rdf/src/main/java/org/qi4j/library/rdf/entity/EntityTypeSerializer.java
+++ b/libraries/rdf/src/main/java/org/qi4j/library/rdf/entity/EntityTypeSerializer.java
@@ -130,7 +130,7 @@ public class EntityTypeSerializer
             graph.add( associationURI, Rdfs.DOMAIN, entityTypeUri );
             graph.add( associationURI, Rdfs.TYPE, Rdfs.PROPERTY );
 
-            URI associatedURI = values.createURI( Classes.toURI( Classes.RAW_CLASS.map( associationType.type() ) ) );
+            URI associatedURI = values.createURI( Classes.toURI( Classes.RAW_CLASS.apply( associationType.type() ) ) );
             graph.add( associationURI, Rdfs.RANGE, associatedURI );
             graph.add( associationURI, Rdfs.RANGE, XMLSchema.ANYURI );
         }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/rdf/src/main/java/org/qi4j/library/rdf/model/Model2XML.java
----------------------------------------------------------------------
diff --git a/libraries/rdf/src/main/java/org/qi4j/library/rdf/model/Model2XML.java b/libraries/rdf/src/main/java/org/qi4j/library/rdf/model/Model2XML.java
index 615bc90..43d27c4 100644
--- a/libraries/rdf/src/main/java/org/qi4j/library/rdf/model/Model2XML.java
+++ b/libraries/rdf/src/main/java/org/qi4j/library/rdf/model/Model2XML.java
@@ -3,6 +3,7 @@ package org.qi4j.library.rdf.model;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Stack;
+import java.util.function.Function;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import org.qi4j.api.composite.DependencyDescriptor;
@@ -12,7 +13,6 @@ import org.qi4j.api.mixin.MixinDescriptor;
 import org.qi4j.api.structure.ApplicationDescriptor;
 import org.qi4j.api.structure.LayerDescriptor;
 import org.qi4j.api.structure.ModuleDescriptor;
-import org.qi4j.functional.Function;
 import org.qi4j.functional.HierarchicalVisitor;
 import org.w3c.dom.Attr;
 import org.w3c.dom.DOMException;
@@ -45,7 +45,7 @@ public class Model2XML
     }
 
     @Override
-    public Document map( ApplicationDescriptor Application )
+    public Document apply( ApplicationDescriptor Application )
     {
         try
         {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/rdf/src/test/java/org/qi4j/library/rdf/Model2XMLTest.java
----------------------------------------------------------------------
diff --git a/libraries/rdf/src/test/java/org/qi4j/library/rdf/Model2XMLTest.java b/libraries/rdf/src/test/java/org/qi4j/library/rdf/Model2XMLTest.java
index c1a2f3b..ba49327 100644
--- a/libraries/rdf/src/test/java/org/qi4j/library/rdf/Model2XMLTest.java
+++ b/libraries/rdf/src/test/java/org/qi4j/library/rdf/Model2XMLTest.java
@@ -49,7 +49,7 @@ public class Model2XMLTest
             }
         } );
 
-        Document document = new Model2XML().map( model );
+        Document document = new Model2XML().apply( model );
 
         TransformerFactory transformerFactory = TransformerFactory.newInstance();
         Transformer transformer = transformerFactory.newTransformer();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/rest-client/src/main/java/org/qi4j/library/rest/client/api/ContextResourceClient.java
----------------------------------------------------------------------
diff --git a/libraries/rest-client/src/main/java/org/qi4j/library/rest/client/api/ContextResourceClient.java b/libraries/rest-client/src/main/java/org/qi4j/library/rest/client/api/ContextResourceClient.java
index 053ce6d..4ed64e6 100644
--- a/libraries/rest-client/src/main/java/org/qi4j/library/rest/client/api/ContextResourceClient.java
+++ b/libraries/rest-client/src/main/java/org/qi4j/library/rest/client/api/ContextResourceClient.java
@@ -77,7 +77,7 @@ public class ContextResourceClient
             @Override
             public HandlerCommand handleResponse( Response response, ContextResourceClient client )
             {
-                final Class<T> resultType = (Class<T>) Classes.RAW_CLASS.map(( (ParameterizedType) handler.getClass().getGenericInterfaces()[ 0 ] ).getActualTypeArguments()[0]);
+                final Class<T> resultType = (Class<T>) Classes.RAW_CLASS.apply(( (ParameterizedType) handler.getClass().getGenericInterfaces()[ 0 ] ).getActualTypeArguments()[0]);
                 T result = contextResourceFactory.readResponse( response, resultType );
 
                 if (result instanceof Resource)
@@ -100,7 +100,7 @@ public class ContextResourceClient
     public <T> ContextResourceClient onQuery( String relation, final ResultHandler<T> handler
     )
     {
-        final Class<T> resultType = (Class<T>) Classes.RAW_CLASS.map(( (ParameterizedType) handler.getClass().getGenericInterfaces()[ 0 ] ).getActualTypeArguments()[0]);
+        final Class<T> resultType = (Class<T>) Classes.RAW_CLASS.apply(( (ParameterizedType) handler.getClass().getGenericInterfaces()[ 0 ] ).getActualTypeArguments()[0]);
 
         queryHandlers.put( relation,  new ResponseHandler()
         {
@@ -123,7 +123,7 @@ public class ContextResourceClient
 
     public <T> ContextResourceClient onCommand( String relation, final ResultHandler<T> handler )
     {
-        final Class<T> resultType = (Class<T>) Classes.RAW_CLASS.map(( (ParameterizedType) handler.getClass().getGenericInterfaces()[ 0 ] ).getActualTypeArguments()[0]);
+        final Class<T> resultType = (Class<T>) Classes.RAW_CLASS.apply(( (ParameterizedType) handler.getClass().getGenericInterfaces()[ 0 ] ).getActualTypeArguments()[0]);
 
         commandHandlers.put( relation,  new ResponseHandler()
         {
@@ -146,7 +146,7 @@ public class ContextResourceClient
 
     public <T> ContextResourceClient onProcessingError( String relation, final ResultHandler<T> handler)
     {
-        final Class<T> resultType = (Class<T>) Classes.RAW_CLASS.map(( (ParameterizedType) handler.getClass().getGenericInterfaces()[ 0 ] ).getActualTypeArguments()[0]);
+        final Class<T> resultType = (Class<T>) Classes.RAW_CLASS.apply(( (ParameterizedType) handler.getClass().getGenericInterfaces()[ 0 ] ).getActualTypeArguments()[0]);
 
         processingErrorHandlers.put( relation,  new ResponseHandler()
         {
@@ -272,7 +272,7 @@ public class ContextResourceClient
 
         // Check if we should do POST or PUT
         Method method;
-        if( LinksUtil.withClass( "idempotent" ).satisfiedBy( link ) )
+        if( LinksUtil.withClass( "idempotent" ).test( link ) )
         {
             method = Method.PUT;
         }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/rest-client/src/main/java/org/qi4j/library/rest/client/api/ErrorHandler.java
----------------------------------------------------------------------
diff --git a/libraries/rest-client/src/main/java/org/qi4j/library/rest/client/api/ErrorHandler.java b/libraries/rest-client/src/main/java/org/qi4j/library/rest/client/api/ErrorHandler.java
index e7ffb73..a76a8ec 100644
--- a/libraries/rest-client/src/main/java/org/qi4j/library/rest/client/api/ErrorHandler.java
+++ b/libraries/rest-client/src/main/java/org/qi4j/library/rest/client/api/ErrorHandler.java
@@ -2,7 +2,7 @@ package org.qi4j.library.rest.client.api;
 
 import java.util.LinkedHashMap;
 import java.util.Map;
-import org.qi4j.functional.Specification;
+import java.util.function.Predicate;
 import org.qi4j.functional.Specifications;
 import org.qi4j.library.rest.client.spi.ResponseHandler;
 import org.restlet.Response;
@@ -15,31 +15,31 @@ import org.restlet.resource.ResourceException;
 public class ErrorHandler
     implements ResponseHandler
 {
-    public static Specification<Response> AUTHENTICATION_REQUIRED = new Specification<Response>()
+    public static Predicate<Response> AUTHENTICATION_REQUIRED = new Predicate<Response>()
     {
         @Override
-        public boolean satisfiedBy( Response item )
+        public boolean test( Response item )
         {
             return item.getStatus().equals( Status.CLIENT_ERROR_UNAUTHORIZED );
         }
     };
 
-    public static Specification<Response> RECOVERABLE_ERROR = new Specification<Response>()
+    public static Predicate<Response> RECOVERABLE_ERROR = new Predicate<Response>()
     {
         @Override
-        public boolean satisfiedBy( Response item )
+        public boolean test( Response item )
         {
             return item.getStatus().isRecoverableError();
         }
     };
 
-    LinkedHashMap<Specification<Response>, ResponseHandler> handlers = new LinkedHashMap<Specification<Response>, ResponseHandler>(  );
+    LinkedHashMap<Predicate<Response>, ResponseHandler> handlers = new LinkedHashMap<Predicate<Response>, ResponseHandler>(  );
 
     public ErrorHandler()
     {
     }
 
-    public ErrorHandler onError(Specification<Response> responseSpecification, ResponseHandler handler)
+    public ErrorHandler onError(Predicate<Response> responseSpecification, ResponseHandler handler)
     {
         handlers.put( responseSpecification, handler );
         return this;
@@ -54,9 +54,9 @@ public class ErrorHandler
     @Override
     public HandlerCommand handleResponse( Response response, ContextResourceClient client )
     {
-        for( Map.Entry<Specification<Response>, ResponseHandler> specificationResponseHandlerEntry : handlers.entrySet() )
+        for( Map.Entry<Predicate<Response>, ResponseHandler> specificationResponseHandlerEntry : handlers.entrySet() )
         {
-            if (specificationResponseHandlerEntry.getKey().satisfiedBy( response ))
+            if (specificationResponseHandlerEntry.getKey().test( response ))
             {
                 return specificationResponseHandlerEntry.getValue().handleResponse( response, client );
             }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/rest-client/src/main/java/org/qi4j/library/rest/client/api/HandlerCommand.java
----------------------------------------------------------------------
diff --git a/libraries/rest-client/src/main/java/org/qi4j/library/rest/client/api/HandlerCommand.java b/libraries/rest-client/src/main/java/org/qi4j/library/rest/client/api/HandlerCommand.java
index 0ece52d..434797e 100644
--- a/libraries/rest-client/src/main/java/org/qi4j/library/rest/client/api/HandlerCommand.java
+++ b/libraries/rest-client/src/main/java/org/qi4j/library/rest/client/api/HandlerCommand.java
@@ -68,7 +68,7 @@ public abstract class HandlerCommand
 
     public <T> HandlerCommand onSuccess(final ResultHandler<T> resultHandler)
     {
-        final Class<T> resultType = (Class<T>) Classes.RAW_CLASS.map(( (ParameterizedType) resultHandler.getClass().getGenericInterfaces()[ 0 ] ).getActualTypeArguments()[0]);
+        final Class<T> resultType = (Class<T>) Classes.RAW_CLASS.apply(( (ParameterizedType) resultHandler.getClass().getGenericInterfaces()[ 0 ] ).getActualTypeArguments()[0]);
         this.responseHandler = new ResponseHandler()
         {
             @Override
@@ -89,7 +89,7 @@ public abstract class HandlerCommand
 
     public <T> HandlerCommand onProcessingError(final ResultHandler<T> resultHandler)
     {
-        final Class<T> resultType = (Class<T>) Classes.RAW_CLASS.map(( (ParameterizedType) resultHandler.getClass().getGenericInterfaces()[ 0 ] ).getActualTypeArguments()[0]);
+        final Class<T> resultType = (Class<T>) Classes.RAW_CLASS.apply(( (ParameterizedType) resultHandler.getClass().getGenericInterfaces()[ 0 ] ).getActualTypeArguments()[0]);
         this.processingErrorHandler = new ResponseHandler()
         {
             @Override

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/rest-common/src/main/java/org/qi4j/library/rest/common/link/LinksUtil.java
----------------------------------------------------------------------
diff --git a/libraries/rest-common/src/main/java/org/qi4j/library/rest/common/link/LinksUtil.java b/libraries/rest-common/src/main/java/org/qi4j/library/rest/common/link/LinksUtil.java
index 9443956..7d5f279 100644
--- a/libraries/rest-common/src/main/java/org/qi4j/library/rest/common/link/LinksUtil.java
+++ b/libraries/rest-common/src/main/java/org/qi4j/library/rest/common/link/LinksUtil.java
@@ -17,57 +17,57 @@
 
 package org.qi4j.library.rest.common.link;
 
-import org.qi4j.functional.Function;
+import java.util.function.Function;
+import java.util.function.Predicate;
 import org.qi4j.functional.Iterables;
-import org.qi4j.functional.Specification;
 
 /**
  * Helper methods for links
  */
 public final class LinksUtil
 {
-   public static Specification<Link> withId(final String id)
+   public static Predicate<Link> withId(final String id)
    {
-      return new Specification<Link>()
+      return new Predicate<Link>()
       {
          @Override
-         public boolean satisfiedBy(Link link )
+         public boolean test(Link link )
          {
             return link.id().get().equals(id);
          }
       };
    }
 
-   public static Specification<Link> withText(final String text)
+   public static Predicate<Link> withText(final String text)
    {
-      return new Specification<Link>()
+      return new Predicate<Link>()
       {
          @Override
-         public boolean satisfiedBy(Link link )
+         public boolean test(Link link )
          {
             return link.text().get().equals(text);
          }
       };
    }
 
-   public static Specification<Link> withRel(final String rel)
+   public static Predicate<Link> withRel(final String rel)
    {
-      return new Specification<Link>()
+      return new Predicate<Link>()
       {
          @Override
-         public boolean satisfiedBy(Link link )
+         public boolean test(Link link )
          {
             return link.rel().get().equals(rel);
          }
       };
    }
 
-   public static Specification<Link> withClass(final String clazz)
+   public static Predicate<Link> withClass(final String clazz)
    {
-      return new Specification<Link>()
+      return new Predicate<Link>()
       {
          @Override
-         public boolean satisfiedBy(Link link )
+         public boolean test(Link link )
          {
              String classes = link.classes().get();
              return classes != null && classes.contains( clazz );
@@ -90,7 +90,7 @@ public final class LinksUtil
       return new Function<Link, String>()
       {
          @Override
-         public String map(Link link )
+         public String apply(Link link )
          {
             return link.rel().get();
          }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/rest-common/src/main/java/org/qi4j/library/rest/common/table/TableBuilder.java
----------------------------------------------------------------------
diff --git a/libraries/rest-common/src/main/java/org/qi4j/library/rest/common/table/TableBuilder.java b/libraries/rest-common/src/main/java/org/qi4j/library/rest/common/table/TableBuilder.java
index 5b2a00f..4f89795 100644
--- a/libraries/rest-common/src/main/java/org/qi4j/library/rest/common/table/TableBuilder.java
+++ b/libraries/rest-common/src/main/java/org/qi4j/library/rest/common/table/TableBuilder.java
@@ -23,10 +23,10 @@ import java.util.Comparator;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
+import java.util.function.Function;
 import org.qi4j.api.util.Dates;
 import org.qi4j.api.value.ValueBuilder;
 import org.qi4j.api.value.ValueBuilderFactory;
-import org.qi4j.functional.Function;
 
 import static java.util.Collections.reverseOrder;
 
@@ -112,10 +112,10 @@ public class TableBuilder
             String f = null;
             Function valueFunction = columns.get( column.id().get()).getValueFunction();
             if (!no_values && valueFunction != null)
-               v = valueFunction.map(rowObject);
+               v = valueFunction.apply(rowObject);
             Function formattedFunction = columns.get( column.id().get()).getFormattedFunction();
             if (!no_format && formattedFunction != null)
-               f = (String) formattedFunction.map(rowObject);
+               f = (String) formattedFunction.apply(rowObject);
             else if (v != null)
             {
                if ( column.columnType().get().equals( Table.DATETIME))

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/rest-common/src/main/java/org/qi4j/library/rest/common/table/TableBuilderFactory.java
----------------------------------------------------------------------
diff --git a/libraries/rest-common/src/main/java/org/qi4j/library/rest/common/table/TableBuilderFactory.java b/libraries/rest-common/src/main/java/org/qi4j/library/rest/common/table/TableBuilderFactory.java
index 987c49f..3332de5 100644
--- a/libraries/rest-common/src/main/java/org/qi4j/library/rest/common/table/TableBuilderFactory.java
+++ b/libraries/rest-common/src/main/java/org/qi4j/library/rest/common/table/TableBuilderFactory.java
@@ -19,8 +19,8 @@ package org.qi4j.library.rest.common.table;
 
 import java.util.LinkedHashMap;
 import java.util.Map;
+import java.util.function.Function;
 import org.qi4j.api.value.ValueBuilderFactory;
-import org.qi4j.functional.Function;
 
 /**
  * Factory for setting up TableBuilder instances. Defines available columns, and how they are extracted from objects.

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/rest-common/src/main/java/org/qi4j/library/rest/common/table/TableQuery.java
----------------------------------------------------------------------
diff --git a/libraries/rest-common/src/main/java/org/qi4j/library/rest/common/table/TableQuery.java b/libraries/rest-common/src/main/java/org/qi4j/library/rest/common/table/TableQuery.java
index db70f8b..a5e4551 100644
--- a/libraries/rest-common/src/main/java/org/qi4j/library/rest/common/table/TableQuery.java
+++ b/libraries/rest-common/src/main/java/org/qi4j/library/rest/common/table/TableQuery.java
@@ -157,7 +157,7 @@ public interface TableQuery
       public Table applyTo(Table table)
       {
          ValueBuilder<Table> tableBuilder = Qi4j.FUNCTION_COMPOSITE_INSTANCE_OF
-             .map( table ).module().newValueBuilderWithPrototype( table );
+             .apply( table ).module().newValueBuilderWithPrototype( table );
 
 /* TODO Finish label setting
          if (label() != null)

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/rest-server/src/main/java/org/qi4j/library/rest/server/assembler/RestServerAssembler.java
----------------------------------------------------------------------
diff --git a/libraries/rest-server/src/main/java/org/qi4j/library/rest/server/assembler/RestServerAssembler.java b/libraries/rest-server/src/main/java/org/qi4j/library/rest/server/assembler/RestServerAssembler.java
index 2f4a888..7635c85 100644
--- a/libraries/rest-server/src/main/java/org/qi4j/library/rest/server/assembler/RestServerAssembler.java
+++ b/libraries/rest-server/src/main/java/org/qi4j/library/rest/server/assembler/RestServerAssembler.java
@@ -19,6 +19,7 @@ package org.qi4j.library.rest.server.assembler;
 
 import java.lang.reflect.Modifier;
 import java.util.Properties;
+import java.util.function.Predicate;
 import org.apache.velocity.app.VelocityEngine;
 import org.qi4j.api.common.Visibility;
 import org.qi4j.api.service.importer.NewObjectImporter;
@@ -26,7 +27,6 @@ import org.qi4j.bootstrap.Assembler;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ClassScanner;
 import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.functional.Specification;
 import org.qi4j.library.rest.server.restlet.InteractionConstraintsService;
 import org.qi4j.library.rest.server.restlet.RequestReaderDelegator;
 import org.qi4j.library.rest.server.restlet.ResponseWriterDelegator;
@@ -97,8 +97,8 @@ public class RestServerAssembler
 
         // Standard response writers
         Iterable<Class<?>> writers = ClassScanner.findClasses( DefaultResponseWriter.class );
-        Specification<Class<?>> responseWriterClass = isAssignableFrom( ResponseWriter.class );
-        Specification<Class<?>> isNotAnAbstract = not( hasModifier( Modifier.ABSTRACT ) );
+        Predicate<Class<?>> responseWriterClass = isAssignableFrom( ResponseWriter.class );
+        Predicate<Class<?>> isNotAnAbstract = not( hasModifier( Modifier.ABSTRACT ) );
         Iterable<Class<?>> candidates = filter( and( isNotAnAbstract, responseWriterClass ), writers );
         for( Class<?> responseWriter : candidates )
         {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/rest-server/src/main/java/org/qi4j/library/rest/server/restlet/freemarker/ValueCompositeTemplateModel.java
----------------------------------------------------------------------
diff --git a/libraries/rest-server/src/main/java/org/qi4j/library/rest/server/restlet/freemarker/ValueCompositeTemplateModel.java b/libraries/rest-server/src/main/java/org/qi4j/library/rest/server/restlet/freemarker/ValueCompositeTemplateModel.java
index b3f80ab..2751dc0 100644
--- a/libraries/rest-server/src/main/java/org/qi4j/library/rest/server/restlet/freemarker/ValueCompositeTemplateModel.java
+++ b/libraries/rest-server/src/main/java/org/qi4j/library/rest/server/restlet/freemarker/ValueCompositeTemplateModel.java
@@ -6,12 +6,12 @@ import freemarker.template.TemplateHashModelEx;
 import freemarker.template.TemplateModel;
 import freemarker.template.TemplateModelException;
 import freemarker.template.TemplateScalarModel;
+import java.util.function.Function;
 import org.qi4j.api.Qi4j;
 import org.qi4j.api.property.Property;
 import org.qi4j.api.property.PropertyDescriptor;
 import org.qi4j.api.value.ValueComposite;
 import org.qi4j.api.value.ValueDescriptor;
-import org.qi4j.functional.Function;
 import org.qi4j.functional.Iterables;
 
 /**
@@ -28,7 +28,7 @@ public class ValueCompositeTemplateModel
     {
         this.composite = composite;
         this.wrapper = wrapper;
-        descriptor = (ValueDescriptor) Qi4j.FUNCTION_DESCRIPTOR_FOR.map( composite );
+        descriptor = (ValueDescriptor) Qi4j.FUNCTION_DESCRIPTOR_FOR.apply( composite );
     }
 
     @Override
@@ -45,7 +45,7 @@ public class ValueCompositeTemplateModel
         return (TemplateCollectionModel) wrapper.wrap( Iterables.map( new Function<PropertyDescriptor, String>()
         {
             @Override
-            public String map( PropertyDescriptor propertyDescriptor )
+            public String apply( PropertyDescriptor propertyDescriptor )
             {
                 return propertyDescriptor.qualifiedName().name();
             }
@@ -59,7 +59,7 @@ public class ValueCompositeTemplateModel
         return (TemplateCollectionModel) wrapper.wrap( Iterables.map( new Function<Property<?>, Object>()
         {
             @Override
-            public Object map( Property<?> objectProperty )
+            public Object apply( Property<?> objectProperty )
             {
                 try
                 {
@@ -70,7 +70,7 @@ public class ValueCompositeTemplateModel
                     throw new IllegalStateException( e );
                 }
             }
-        }, Qi4j.FUNCTION_COMPOSITE_INSTANCE_OF.map( composite ).state().properties() ).iterator() );
+        }, Qi4j.FUNCTION_COMPOSITE_INSTANCE_OF.apply( composite ).state().properties() ).iterator() );
     }
 
     @Override
@@ -80,7 +80,7 @@ public class ValueCompositeTemplateModel
         try
         {
             return wrapper.wrap( Qi4j.FUNCTION_COMPOSITE_INSTANCE_OF
-                                     .map( composite )
+                                     .apply( composite )
                                      .state()
                                      .propertyFor( descriptor.state().findPropertyModelByName( key ).accessor() )
                                      .get() );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/rest-server/src/main/java/org/qi4j/library/rest/server/restlet/requestreader/DefaultRequestReader.java
----------------------------------------------------------------------
diff --git a/libraries/rest-server/src/main/java/org/qi4j/library/rest/server/restlet/requestreader/DefaultRequestReader.java b/libraries/rest-server/src/main/java/org/qi4j/library/rest/server/restlet/requestreader/DefaultRequestReader.java
index 0dc0bad..ca63132 100644
--- a/libraries/rest-server/src/main/java/org/qi4j/library/rest/server/restlet/requestreader/DefaultRequestReader.java
+++ b/libraries/rest-server/src/main/java/org/qi4j/library/rest/server/restlet/requestreader/DefaultRequestReader.java
@@ -5,6 +5,7 @@ import java.lang.reflect.Method;
 import java.util.Collections;
 import java.util.Date;
 import java.util.Map;
+import java.util.function.Function;
 import org.qi4j.api.association.AssociationDescriptor;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.constraint.Name;
@@ -20,7 +21,6 @@ import org.qi4j.api.value.ValueComposite;
 import org.qi4j.api.value.ValueDeserializer;
 import org.qi4j.api.value.ValueSerialization;
 import org.qi4j.api.value.ValueSerializationException;
-import org.qi4j.functional.Function;
 import org.qi4j.functional.Iterables;
 import org.qi4j.library.rest.server.spi.RequestReader;
 import org.restlet.Request;
@@ -265,7 +265,7 @@ public class DefaultRequestReader
             new Function<PropertyDescriptor, Object>()
         {
             @Override
-            public Object map( PropertyDescriptor propertyDescriptor )
+            public Object apply( PropertyDescriptor propertyDescriptor )
             {
                 Parameter param = queryAsForm.getFirst( propertyDescriptor.qualifiedName().name() );
 
@@ -296,7 +296,7 @@ public class DefaultRequestReader
             new Function<AssociationDescriptor, EntityReference>()
             {
                 @Override
-                public EntityReference map( AssociationDescriptor associationDescriptor )
+                public EntityReference apply( AssociationDescriptor associationDescriptor )
                 {
                     Parameter param = queryAsForm.getFirst( associationDescriptor.qualifiedName().name() );
 
@@ -318,7 +318,7 @@ public class DefaultRequestReader
             new Function<AssociationDescriptor, Iterable<EntityReference>>()
             {
                 @Override
-                public Iterable<EntityReference> map( AssociationDescriptor associationDescriptor )
+                public Iterable<EntityReference> apply( AssociationDescriptor associationDescriptor )
                 {
                     // TODO
                     return Iterables.empty();
@@ -327,7 +327,7 @@ public class DefaultRequestReader
             new Function<AssociationDescriptor, Map<String, EntityReference>>()
             {
                 @Override
-                public Map<String, EntityReference> map( AssociationDescriptor from )
+                public Map<String, EntityReference> apply( AssociationDescriptor from )
                 {
                     // TODO
                     return Collections.emptyMap();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/sql-liquibase/src/test/java/org/qi4j/library/sql/liquibase/LiquibaseServiceTest.java
----------------------------------------------------------------------
diff --git a/libraries/sql-liquibase/src/test/java/org/qi4j/library/sql/liquibase/LiquibaseServiceTest.java b/libraries/sql-liquibase/src/test/java/org/qi4j/library/sql/liquibase/LiquibaseServiceTest.java
index 3f89434..ad20e00 100644
--- a/libraries/sql-liquibase/src/test/java/org/qi4j/library/sql/liquibase/LiquibaseServiceTest.java
+++ b/libraries/sql-liquibase/src/test/java/org/qi4j/library/sql/liquibase/LiquibaseServiceTest.java
@@ -19,6 +19,7 @@ import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.function.Function;
 import javax.sql.DataSource;
 import org.junit.Test;
 import org.qi4j.api.activation.ActivationEvent;
@@ -33,7 +34,6 @@ import org.qi4j.api.value.ValueComposite;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ModuleAssembly;
 import org.qi4j.bootstrap.SingletonAssembler;
-import org.qi4j.functional.Function;
 import org.qi4j.io.Inputs;
 import org.qi4j.io.Outputs;
 import org.qi4j.library.sql.assembly.DataSourceAssembler;
@@ -134,7 +134,7 @@ public class LiquibaseServiceTest
         Function<ResultSet, SomeValue> toValue = new Function<ResultSet, SomeValue>()
         {
             @Override
-            public SomeValue map( ResultSet resultSet )
+            public SomeValue apply( ResultSet resultSet )
             {
                 ValueBuilder<SomeValue> builder = assembler.module().newValueBuilder( SomeValue.class );
                 try

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/sql/src/main/java/org/qi4j/library/sql/datasource/DataSources.java
----------------------------------------------------------------------
diff --git a/libraries/sql/src/main/java/org/qi4j/library/sql/datasource/DataSources.java b/libraries/sql/src/main/java/org/qi4j/library/sql/datasource/DataSources.java
index 8a52c41..c8bbac7 100644
--- a/libraries/sql/src/main/java/org/qi4j/library/sql/datasource/DataSources.java
+++ b/libraries/sql/src/main/java/org/qi4j/library/sql/datasource/DataSources.java
@@ -19,9 +19,9 @@ import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
 import java.net.ConnectException;
+import java.util.function.Predicate;
 import javax.sql.DataSource;
 import org.qi4j.api.service.ServiceImporterException;
-import org.qi4j.functional.Specification;
 import org.qi4j.library.circuitbreaker.CircuitBreaker;
 
 import static org.qi4j.functional.Specifications.not;
@@ -39,7 +39,7 @@ public class DataSources
     public static CircuitBreaker newDataSourceCircuitBreaker( int threshold, long timeout )
     {
         @SuppressWarnings( "unchecked" )
-        Specification<Throwable> in = in( ConnectException.class );
+        Predicate<Throwable> in = in( ConnectException.class );
         return new CircuitBreaker( threshold, timeout, not( rootCause( in ) ) );
     }
 


Mime
View raw message