You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@polygene.apache.org by ni...@apache.org on 2015/04/17 18:08:13 UTC

[01/50] [abbrv] zest-qi4j git commit: UoWFile, minor: java 7 changes, 2.0 usage, formatting

Repository: zest-qi4j
Updated Branches:
  refs/heads/3.0 [created] e62f94a34


UoWFile, minor: java 7 changes, 2.0 usage, formatting


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/b049e9b6
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/b049e9b6
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/b049e9b6

Branch: refs/heads/3.0
Commit: b049e9b65dcc7aec927e6c424d39c15069289104
Parents: b65ecb6
Author: Paul Merlin <pa...@nosphere.org>
Authored: Thu Feb 20 22:07:09 2014 +0100
Committer: Paul Merlin <pa...@nosphere.org>
Committed: Thu Feb 20 22:07:09 2014 +0100

----------------------------------------------------------------------
 .../uowfile/bootstrap/UoWFileAssembler.java     |  18 +-
 .../ConcurrentUoWFileModificationException.java |  22 +-
 ...urrentUoWFileStateModificationException.java |  22 +-
 .../qi4j/library/uowfile/internal/UoWFile.java  |  72 ++++--
 .../uowfile/internal/UoWFileException.java      |  22 +-
 .../uowfile/internal/UoWFileFactory.java        | 105 ++++----
 .../library/uowfile/plural/HasUoWFiles.java     |  28 ++-
 .../uowfile/plural/HasUoWFilesLifecycle.java    |  43 ++--
 .../library/uowfile/plural/UoWFilesLocator.java |  20 +-
 .../library/uowfile/singular/HasUoWFile.java    |  26 +-
 .../uowfile/singular/HasUoWFileLifecycle.java   |  32 +--
 .../uowfile/singular/UoWFileLocator.java        |  20 +-
 .../library/uowfile/AbstractUoWFileTest.java    |  60 +++--
 .../qi4j/library/uowfile/HasUoWFileTest.java    | 240 ++++++++++--------
 .../qi4j/library/uowfile/HasUoWFilesTest.java   | 248 +++++++++++--------
 15 files changed, 550 insertions(+), 428 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b049e9b6/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/bootstrap/UoWFileAssembler.java
----------------------------------------------------------------------
diff --git a/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/bootstrap/UoWFileAssembler.java b/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/bootstrap/UoWFileAssembler.java
index 020d458..c6feabc 100644
--- a/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/bootstrap/UoWFileAssembler.java
+++ b/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/bootstrap/UoWFileAssembler.java
@@ -1,15 +1,19 @@
 /*
- * Copyright (c) 2011, Paul Merlin. All Rights Reserved.
+ * Copyright 2011 Paul Merlin.
+ *
+ * Licensed  under the  Apache License,  Version 2.0  (the "License");
+ * you may not use  this file  except in  compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * distributed  under the  License is distributed on an "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+ * implied.
+ *
  * See the License for the specific language governing permissions and
  * limitations under the License.
- *
  */
 package org.qi4j.library.uowfile.bootstrap;
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b049e9b6/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/internal/ConcurrentUoWFileModificationException.java
----------------------------------------------------------------------
diff --git a/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/internal/ConcurrentUoWFileModificationException.java b/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/internal/ConcurrentUoWFileModificationException.java
index 2bc1700..1350011 100644
--- a/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/internal/ConcurrentUoWFileModificationException.java
+++ b/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/internal/ConcurrentUoWFileModificationException.java
@@ -1,15 +1,19 @@
 /*
- * Copyright (c) 2011, Paul Merlin. All Rights Reserved.
+ * Copyright 2011 Paul Merlin.
+ *
+ * Licensed  under the  Apache License,  Version 2.0  (the "License");
+ * you may not use  this file  except in  compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * distributed  under the  License is distributed on an "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+ * implied.
+ *
  * See the License for the specific language governing permissions and
  * limitations under the License.
- *
  */
 package org.qi4j.library.uowfile.internal;
 
@@ -18,9 +22,8 @@ import org.qi4j.api.entity.EntityComposite;
 import org.qi4j.api.unitofwork.ConcurrentEntityModificationException;
 
 public class ConcurrentUoWFileModificationException
-        extends ConcurrentEntityModificationException
+    extends ConcurrentEntityModificationException
 {
-
     private final Iterable<UoWFile> concurrentlyModifiedFiles;
 
     ConcurrentUoWFileModificationException( Iterable<UoWFile> concurrentlyModifiedFiles )
@@ -39,5 +42,4 @@ public class ConcurrentUoWFileModificationException
     {
         return "Files changed concurently: " + concurrentlyModifiedFiles;
     }
-
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b049e9b6/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/internal/ConcurrentUoWFileStateModificationException.java
----------------------------------------------------------------------
diff --git a/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/internal/ConcurrentUoWFileStateModificationException.java b/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/internal/ConcurrentUoWFileStateModificationException.java
index 862f348..7c09144 100644
--- a/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/internal/ConcurrentUoWFileStateModificationException.java
+++ b/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/internal/ConcurrentUoWFileStateModificationException.java
@@ -1,22 +1,25 @@
 /*
- * Copyright (c) 2011, Paul Merlin. All Rights Reserved.
+ * Copyright 2011 Paul Merlin.
+ *
+ * Licensed  under the  Apache License,  Version 2.0  (the "License");
+ * you may not use  this file  except in  compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * distributed  under the  License is distributed on an "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+ * implied.
+ *
  * See the License for the specific language governing permissions and
  * limitations under the License.
- *
  */
 package org.qi4j.library.uowfile.internal;
 
 class ConcurrentUoWFileStateModificationException
-        extends Exception
+    extends Exception
 {
-
     private final UoWFile file;
 
     ConcurrentUoWFileStateModificationException( UoWFile file )
@@ -34,5 +37,4 @@ class ConcurrentUoWFileStateModificationException
     {
         return "UoWFile modified concurently: " + file.toString();
     }
-
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b049e9b6/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/internal/UoWFile.java
----------------------------------------------------------------------
diff --git a/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/internal/UoWFile.java b/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/internal/UoWFile.java
index f6ab6e8..f8b0bb8 100644
--- a/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/internal/UoWFile.java
+++ b/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/internal/UoWFile.java
@@ -1,15 +1,19 @@
 /*
- * Copyright (c) 2011, Paul Merlin. All Rights Reserved.
+ * Copyright 2011 Paul Merlin.
+ *
+ * Licensed  under the  Apache License,  Version 2.0  (the "License");
+ * you may not use  this file  except in  compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * distributed  under the  License is distributed on an "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+ * implied.
+ *
  * See the License for the specific language governing permissions and
  * limitations under the License.
- *
  */
 package org.qi4j.library.uowfile.internal;
 
@@ -23,7 +27,6 @@ import org.slf4j.LoggerFactory;
 
 public class UoWFile
 {
-
     /* package */ static final Logger LOGGER = LoggerFactory.getLogger( "org.qi4j.library.uowfile" );
     private static final int FILE_BUFFER_SIZE = 4096;
     private static final AtomicLong COUNT = new AtomicLong( 0L );
@@ -52,33 +55,38 @@ public class UoWFile
         StringBuilder sb = new StringBuilder().append( UoWFile.class.getSimpleName() );
         // UoWFile{parent/( original(oid->id) | current(id) | backup(id) )}
         sb.append( "{" ).append( original.getParentFile().getName() ).append( "/( " ).
-                append( original.getName() ).append( "(" ).append( originalIdentity ).append( "->" ).append( fileTag( original ) ).append( ") | " ).
-                append( current.getName() ).append( "(" ).append( fileTag( current ) ).append( ") | " ).
-                append( backup.getName() ).append( "(" ).append( fileTag( backup ) ).
-                append( ") )}" );
+            append( original.getName() ).append( "(" ).append( originalIdentity ).append( "->" ).append( fileTag( original ) ).append( ") | " ).
+            append( current.getName() ).append( "(" ).append( fileTag( current ) ).append( ") | " ).
+            append( backup.getName() ).append( "(" ).append( fileTag( backup ) ).
+            append( ") )}" );
         return sb.toString();
     }
 
     void copyOriginalToCurrent()
     {
-        if ( original.exists() ) {
+        if( original.exists() )
+        {
             copy( original, current );
         }
     }
 
     void apply()
-            throws ConcurrentUoWFileStateModificationException
+        throws ConcurrentUoWFileStateModificationException
     {
         LOGGER.trace( "Will apply changes to {}", this );
-        if ( fileTag( current ) != originalIdentity ) {
-            if ( fileTag( original ) != originalIdentity ) {
+        if( fileTag( current ) != originalIdentity )
+        {
+            if( fileTag( original ) != originalIdentity )
+            {
                 LOGGER.info( "Concurrent modification, original creation identity is {} and original apply identity is {}", originalIdentity, fileTag( original ) );
                 throw new ConcurrentUoWFileStateModificationException( this );
             }
-            if ( original.exists() ) {
+            if( original.exists() )
+            {
                 move( original, backup );
             }
-            if ( current.exists() ) {
+            if( current.exists() )
+            {
                 move( current, original );
             }
             LOGGER.debug( "Applied changes to {}", original );
@@ -87,8 +95,10 @@ public class UoWFile
 
     void rollback()
     {
-        if ( backup.exists() ) {
-            if ( fileTag( original ) != originalIdentity ) {
+        if( backup.exists() )
+        {
+            if( fileTag( original ) != originalIdentity )
+            {
                 delete( original );
                 move( backup, original );
             }
@@ -98,10 +108,12 @@ public class UoWFile
 
     void cleanup()
     {
-        if ( current.exists() ) {
+        if( current.exists() )
+        {
             delete( current );
         }
-        if ( backup.exists() ) {
+        if( backup.exists() )
+        {
             delete( backup );
         }
     }
@@ -116,16 +128,20 @@ public class UoWFile
 
     private void copy( File source, File dest )
     {
-        try {
+        try
+        {
             Inputs.byteBuffer( source, FILE_BUFFER_SIZE ).transferTo( Outputs.byteBuffer( dest ) );
-        } catch ( IOException ex ) {
+        }
+        catch( IOException ex )
+        {
             throw new UoWFileException( ex );
         }
     }
 
     private void delete( File file )
     {
-        if ( !file.delete() ) {
+        if( !file.delete() )
+        {
             throw new UoWFileException( new IOException( "Unable to delete file " + file ) );
         }
     }
@@ -133,10 +149,12 @@ public class UoWFile
     private void move( File source, File dest )
     {
         // Atomic move attempt
-        if ( !source.renameTo( dest ) ) {
+        if( !source.renameTo( dest ) )
+        {
             // source and dest are probably on different filesystem, fallback to a non atomic copy/move operation
             copy( source, dest );
-            if ( !source.delete() ) {
+            if( !source.delete() )
+            {
                 throw new UoWFileException( new IOException( "Unable to delete source file " + source
                                                              + " after copy(move) to " + dest
                                                              + " (rename failed before that)." ) );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b049e9b6/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/internal/UoWFileException.java
----------------------------------------------------------------------
diff --git a/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/internal/UoWFileException.java b/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/internal/UoWFileException.java
index ee9900f..ee48c49 100644
--- a/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/internal/UoWFileException.java
+++ b/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/internal/UoWFileException.java
@@ -1,24 +1,27 @@
 /*
- * Copyright (c) 2011, Paul Merlin. All Rights Reserved.
+ * Copyright 2011 Paul Merlin.
+ *
+ * Licensed  under the  Apache License,  Version 2.0  (the "License");
+ * you may not use  this file  except in  compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * distributed  under the  License is distributed on an "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+ * implied.
+ *
  * See the License for the specific language governing permissions and
  * limitations under the License.
- *
  */
 package org.qi4j.library.uowfile.internal;
 
 import java.io.IOException;
 
 class UoWFileException
-        extends RuntimeException
+    extends RuntimeException
 {
-
     UoWFileException( IOException cause )
     {
         super( cause.getMessage(), cause );
@@ -28,5 +31,4 @@ class UoWFileException
     {
         super( message, cause );
     }
-
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b049e9b6/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/internal/UoWFileFactory.java
----------------------------------------------------------------------
diff --git a/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/internal/UoWFileFactory.java b/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/internal/UoWFileFactory.java
index b6ab5db..863a102 100644
--- a/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/internal/UoWFileFactory.java
+++ b/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/internal/UoWFileFactory.java
@@ -1,15 +1,19 @@
 /*
- * Copyright (c) 2011, Paul Merlin. All Rights Reserved.
+ * Copyright 2011 Paul Merlin.
+ *
+ * Licensed  under the  Apache License,  Version 2.0  (the "License");
+ * you may not use  this file  except in  compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * distributed  under the  License is distributed on an "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+ * implied.
+ *
  * See the License for the specific language governing permissions and
  * limitations under the License.
- *
  */
 package org.qi4j.library.uowfile.internal;
 
@@ -18,15 +22,13 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
-import org.qi4j.api.activation.ActivatorAdapter;
-import org.qi4j.api.activation.Activators;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.injection.scope.Service;
 import org.qi4j.api.injection.scope.Structure;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.mixin.Mixins;
+import org.qi4j.api.service.ServiceActivation;
 import org.qi4j.api.service.ServiceComposite;
-import org.qi4j.api.service.ServiceReference;
 import org.qi4j.api.structure.Application;
 import org.qi4j.api.structure.Module;
 import org.qi4j.api.unitofwork.UnitOfWork;
@@ -37,35 +39,18 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 @Mixins( UoWFileFactory.Mixin.class )
-@Activators( UoWFileFactory.Activator.class )
 public interface UoWFileFactory
-        extends ServiceComposite
+    extends ServiceActivation
 {
 
     UoWFile createCurrentUoWFile( File file );
 
-    void ensureWorkDirsExist()
-            throws IOException;
-
-    class Activator
-            extends ActivatorAdapter<ServiceReference<UoWFileFactory>>
-    {
-
-        @Override
-        public void afterActivation( ServiceReference<UoWFileFactory> activated )
-                throws Exception
-        {
-            activated.get().ensureWorkDirsExist();
-        }
-
-    }
-
-    abstract class Mixin
-            implements UoWFileFactory
+    class Mixin
+        implements UoWFileFactory
     {
 
         private static class UoWFilesMetaInfo
-                extends HashMap<String, UoWFile>
+            extends HashMap<String, UoWFile>
         {
         }
 
@@ -87,22 +72,32 @@ public interface UoWFileFactory
         private File workDir;
 
         @Override
-        public void ensureWorkDirsExist()
-                throws IOException
+        public void activateService()
+            throws IOException
         {
             File tmp;
-            if ( fileConfig == null ) {
+            if( fileConfig == null )
+            {
                 tmp = new File( "qi4j", app.name() + "-" + app.version() );
-            } else {
+            }
+            else
+            {
                 tmp = fileConfig.temporaryDirectory();
             }
             workDir = new File( tmp, "uowfile-" + me.identity().get() );
-            if ( !workDir.exists() && !workDir.mkdirs() ) {
+            if( !workDir.exists() && !workDir.mkdirs() )
+            {
                 throw new IOException( "Unable to create temporary directory: " + workDir );
             }
         }
 
         @Override
+        public void passivateService()
+            throws Exception
+        {
+        }
+
+        @Override
         public UoWFile createCurrentUoWFile( File file )
         {
             return createUoWFile( module.currentUnitOfWork(), file, workDir );
@@ -113,7 +108,8 @@ public interface UoWFileFactory
             UoWFilesMetaInfo uowMeta = ensureUoWMeta( uow );
             String absolutePath = file.getAbsolutePath();
             UoWFile uowFile = uowMeta.get( absolutePath );
-            if ( uowFile == null ) {
+            if( uowFile == null )
+            {
                 uowFile = new UoWFile( file, workDir );
                 uowFile.copyOriginalToCurrent();
                 uowMeta.put( absolutePath, uowFile );
@@ -128,7 +124,8 @@ public interface UoWFileFactory
         private static UoWFilesMetaInfo ensureUoWMeta( final UnitOfWork uow )
         {
             UoWFilesMetaInfo uowMeta = uow.metaInfo( UoWFilesMetaInfo.class );
-            if ( uowMeta != null ) {
+            if( uowMeta != null )
+            {
                 return uowMeta;
             }
 
@@ -137,22 +134,27 @@ public interface UoWFileFactory
 
             uow.addUnitOfWorkCallback( new UnitOfWorkCallback()
             {
-
                 @Override
                 public void beforeCompletion()
-                        throws UnitOfWorkCompletionException
+                    throws UnitOfWorkCompletionException
                 {
                     UoWFilesMetaInfo uowMeta = uow.metaInfo( UoWFilesMetaInfo.class );
-                    if ( uowMeta != null && !uowMeta.isEmpty() ) {
-                        List<UoWFile> concurrentlyModified = new ArrayList<UoWFile>();
-                        for ( UoWFile eachUoWFile : uowMeta.values() ) {
-                            try {
+                    if( uowMeta != null && !uowMeta.isEmpty() )
+                    {
+                        List<UoWFile> concurrentlyModified = new ArrayList<>();
+                        for( UoWFile eachUoWFile : uowMeta.values() )
+                        {
+                            try
+                            {
                                 eachUoWFile.apply();
-                            } catch ( ConcurrentUoWFileStateModificationException ex ) {
+                            }
+                            catch( ConcurrentUoWFileStateModificationException ex )
+                            {
                                 concurrentlyModified.add( ex.getUoWFile() );
                             }
                         }
-                        if ( !concurrentlyModified.isEmpty() ) {
+                        if( !concurrentlyModified.isEmpty() )
+                        {
                             throw new ConcurrentUoWFileModificationException( concurrentlyModified );
                         }
                     }
@@ -162,9 +164,12 @@ public interface UoWFileFactory
                 public void afterCompletion( UnitOfWorkStatus status )
                 {
                     UoWFilesMetaInfo uowMeta = uow.metaInfo( UoWFilesMetaInfo.class );
-                    if ( uowMeta != null && !uowMeta.isEmpty() ) {
-                        for ( UoWFile eachUoWFile : uowMeta.values() ) {
-                            if ( status == UnitOfWorkStatus.DISCARDED ) {
+                    if( uowMeta != null && !uowMeta.isEmpty() )
+                    {
+                        for( UoWFile eachUoWFile : uowMeta.values() )
+                        {
+                            if( status == UnitOfWorkStatus.DISCARDED )
+                            {
                                 eachUoWFile.rollback();
                             }
                             eachUoWFile.cleanup();
@@ -172,11 +177,9 @@ public interface UoWFileFactory
                         uow.metaInfo( UoWFilesMetaInfo.class ).clear();
                     }
                 }
-
             } );
             return uowMeta;
         }
-
     }
 
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b049e9b6/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/plural/HasUoWFiles.java
----------------------------------------------------------------------
diff --git a/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/plural/HasUoWFiles.java b/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/plural/HasUoWFiles.java
index 44f8766..f1d2ac1 100644
--- a/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/plural/HasUoWFiles.java
+++ b/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/plural/HasUoWFiles.java
@@ -1,15 +1,19 @@
 /*
- * Copyright (c) 2011, Paul Merlin. All Rights Reserved.
+ * Copyright 2011 Paul Merlin.
+ *
+ * Licensed  under the  Apache License,  Version 2.0  (the "License");
+ * you may not use  this file  except in  compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * distributed  under the  License is distributed on an "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+ * implied.
+ *
  * See the License for the specific language governing permissions and
  * limitations under the License.
- *
  */
 package org.qi4j.library.uowfile.plural;
 
@@ -26,7 +30,6 @@ import org.qi4j.library.uowfile.internal.UoWFileFactory;
 // START SNIPPET: contract
 public interface HasUoWFiles<T extends Enum<T>>
 {
-
     /**
      * IMPORTANT Use this {@link File} only inside read-only {@link UnitOfWork}s
      */
@@ -43,9 +46,8 @@ public interface HasUoWFiles<T extends Enum<T>>
     // END SNIPPET: contract
 
     abstract class Mixin<R extends Enum<R>>
-            implements HasUoWFiles<R>
+        implements HasUoWFiles<R>
     {
-
         @Service
         private UoWFileFactory uowFileFactory;
         @This
@@ -72,13 +74,13 @@ public interface HasUoWFiles<T extends Enum<T>>
         @Override
         public Iterable<File> managedFiles()
         {
-            List<File> managedFiles = new ArrayList<File>();
-            for ( File eachAttachedFile : locator.locateAttachedFiles() ) {
+            List<File> managedFiles = new ArrayList<>();
+            for( File eachAttachedFile : locator.locateAttachedFiles() )
+            {
                 managedFiles.add( uowFileFactory.createCurrentUoWFile( eachAttachedFile ).asFile() );
             }
             return managedFiles;
         }
-
     }
 
     // START SNIPPET: contract

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b049e9b6/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/plural/HasUoWFilesLifecycle.java
----------------------------------------------------------------------
diff --git a/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/plural/HasUoWFilesLifecycle.java b/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/plural/HasUoWFilesLifecycle.java
index 06d88c3..5a634f6 100644
--- a/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/plural/HasUoWFilesLifecycle.java
+++ b/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/plural/HasUoWFilesLifecycle.java
@@ -1,15 +1,19 @@
 /*
- * Copyright (c) 2011, Paul Merlin. All Rights Reserved.
+ * Copyright 2011 Paul Merlin.
+ *
+ * Licensed  under the  Apache License,  Version 2.0  (the "License");
+ * you may not use  this file  except in  compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * distributed  under the  License is distributed on an "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+ * implied.
+ *
  * See the License for the specific language governing permissions and
  * limitations under the License.
- *
  */
 package org.qi4j.library.uowfile.plural;
 
@@ -23,41 +27,42 @@ import org.qi4j.api.mixin.Mixins;
 
 @Mixins( HasUoWFilesLifecycle.Mixin.class )
 public interface HasUoWFilesLifecycle<T extends Enum<T>>
-        extends HasUoWFiles<T>, Lifecycle
+    extends HasUoWFiles<T>, Lifecycle
 {
-
     public class Mixin
-            implements Lifecycle
+        implements Lifecycle
     {
-
         @This
         private HasUoWFiles<?> hasUoWFiles;
 
         @Override
         public void create()
-                throws LifecycleException
+            throws LifecycleException
         {
             // NOOP
         }
 
         @Override
         public void remove()
-                throws LifecycleException
+            throws LifecycleException
         {
             // We use the managed files so that if the UoW gets discarded the files will be restored
-            List<File> errors = new ArrayList<File>();
-            for ( File eachFile : hasUoWFiles.managedFiles() ) {
-                if ( eachFile.exists() ) {
-                    if ( !eachFile.delete() ) {
+            List<File> errors = new ArrayList<>();
+            for( File eachFile : hasUoWFiles.managedFiles() )
+            {
+                if( eachFile.exists() )
+                {
+                    if( !eachFile.delete() )
+                    {
                         errors.add( eachFile );
                     }
                 }
             }
-            if ( !errors.isEmpty() ) {
+            if( !errors.isEmpty() )
+            {
                 throw new LifecycleException( "Unable to delete existing files: " + errors );
             }
         }
-
     }
 
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b049e9b6/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/plural/UoWFilesLocator.java
----------------------------------------------------------------------
diff --git a/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/plural/UoWFilesLocator.java b/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/plural/UoWFilesLocator.java
index 5b634fb..11e9263 100644
--- a/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/plural/UoWFilesLocator.java
+++ b/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/plural/UoWFilesLocator.java
@@ -1,15 +1,19 @@
 /*
- * Copyright (c) 2011, Paul Merlin. All Rights Reserved.
+ * Copyright 2011 Paul Merlin.
+ *
+ * Licensed  under the  Apache License,  Version 2.0  (the "License");
+ * you may not use  this file  except in  compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * distributed  under the  License is distributed on an "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+ * implied.
+ *
  * See the License for the specific language governing permissions and
  * limitations under the License.
- *
  */
 package org.qi4j.library.uowfile.plural;
 
@@ -17,9 +21,7 @@ import java.io.File;
 
 public interface UoWFilesLocator<T extends Enum<T>>
 {
-
     File locateAttachedFile( T key );
 
     Iterable<File> locateAttachedFiles();
-
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b049e9b6/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/singular/HasUoWFile.java
----------------------------------------------------------------------
diff --git a/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/singular/HasUoWFile.java b/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/singular/HasUoWFile.java
index 5316e41..074312c 100644
--- a/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/singular/HasUoWFile.java
+++ b/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/singular/HasUoWFile.java
@@ -1,15 +1,19 @@
 /*
- * Copyright (c) 2011, Paul Merlin. All Rights Reserved.
+ * Copyright 2011 Paul Merlin.
+ *
+ * Licensed  under the  Apache License,  Version 2.0  (the "License");
+ * you may not use  this file  except in  compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * distributed  under the  License is distributed on an "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+ * implied.
+ *
  * See the License for the specific language governing permissions and
  * limitations under the License.
- *
  */
 package org.qi4j.library.uowfile.singular;
 
@@ -24,9 +28,8 @@ import org.qi4j.library.uowfile.internal.UoWFileFactory;
 // START SNIPPET: contract
 public interface HasUoWFile
 {
-
     /**
-     * IMPORTANT Use this {@link File} only inside read-only {@link UnitOfWork}s
+     * IMPORTANT Use this {@link File} inside read-only {@link UnitOfWork}s only
      */
     File attachedFile();
 
@@ -34,9 +37,8 @@ public interface HasUoWFile
     // END SNIPPET: contract
 
     class Mixin
-            implements HasUoWFile
+        implements HasUoWFile
     {
-
         @Service
         private UoWFileFactory uowFileFactory;
 
@@ -54,8 +56,8 @@ public interface HasUoWFile
         {
             return uowFileFactory.createCurrentUoWFile( locator.locateAttachedFile() ).asFile();
         }
-
     }
     // START SNIPPET: contract
+
 }
 // END SNIPPET: contract

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b049e9b6/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/singular/HasUoWFileLifecycle.java
----------------------------------------------------------------------
diff --git a/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/singular/HasUoWFileLifecycle.java b/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/singular/HasUoWFileLifecycle.java
index 31794b6..83364de 100644
--- a/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/singular/HasUoWFileLifecycle.java
+++ b/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/singular/HasUoWFileLifecycle.java
@@ -1,15 +1,19 @@
 /*
- * Copyright (c) 2011, Paul Merlin. All Rights Reserved.
+ * Copyright 2011 Paul Merlin.
+ *
+ * Licensed  under the  Apache License,  Version 2.0  (the "License");
+ * you may not use  this file  except in  compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * distributed  under the  License is distributed on an "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+ * implied.
+ *
  * See the License for the specific language governing permissions and
  * limitations under the License.
- *
  */
 package org.qi4j.library.uowfile.singular;
 
@@ -21,34 +25,32 @@ import org.qi4j.api.mixin.Mixins;
 
 @Mixins( HasUoWFileLifecycle.Mixin.class )
 public interface HasUoWFileLifecycle
-        extends HasUoWFile, Lifecycle
+    extends HasUoWFile, Lifecycle
 {
-
     class Mixin
-            implements Lifecycle
+        implements Lifecycle
     {
-
         @This
         private HasUoWFile hasUoWFile;
 
         @Override
         public void create()
-                throws LifecycleException
+            throws LifecycleException
         {
             // NOOP
         }
 
         @Override
         public void remove()
-                throws LifecycleException
+            throws LifecycleException
         {
             // We use the managed file so that if the UoW gets discarded the file will be restored
             File file = hasUoWFile.managedFile();
-            if ( file.exists() && !file.delete() ) {
+            if( file.exists() && !file.delete() )
+            {
                 throw new LifecycleException( "Unable to delete existing file: " + file );
             }
         }
-
     }
 
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b049e9b6/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/singular/UoWFileLocator.java
----------------------------------------------------------------------
diff --git a/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/singular/UoWFileLocator.java b/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/singular/UoWFileLocator.java
index 3cabd0f..7555c04 100644
--- a/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/singular/UoWFileLocator.java
+++ b/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/singular/UoWFileLocator.java
@@ -1,15 +1,19 @@
 /*
- * Copyright (c) 2011, Paul Merlin. All Rights Reserved.
+ * Copyright 2011 Paul Merlin.
+ *
+ * Licensed  under the  Apache License,  Version 2.0  (the "License");
+ * you may not use  this file  except in  compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * distributed  under the  License is distributed on an "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+ * implied.
+ *
  * See the License for the specific language governing permissions and
  * limitations under the License.
- *
  */
 package org.qi4j.library.uowfile.singular;
 
@@ -17,7 +21,5 @@ import java.io.File;
 
 public interface UoWFileLocator
 {
-
     File locateAttachedFile();
-
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b049e9b6/libraries/uowfile/src/test/java/org/qi4j/library/uowfile/AbstractUoWFileTest.java
----------------------------------------------------------------------
diff --git a/libraries/uowfile/src/test/java/org/qi4j/library/uowfile/AbstractUoWFileTest.java b/libraries/uowfile/src/test/java/org/qi4j/library/uowfile/AbstractUoWFileTest.java
index f25edf0..8250658 100644
--- a/libraries/uowfile/src/test/java/org/qi4j/library/uowfile/AbstractUoWFileTest.java
+++ b/libraries/uowfile/src/test/java/org/qi4j/library/uowfile/AbstractUoWFileTest.java
@@ -1,15 +1,19 @@
 /*
- * Copyright (c) 2011, Paul Merlin. All Rights Reserved.
+ * Copyright 2011-2014 Paul Merlin.
+ *
+ * Licensed  under the  Apache License,  Version 2.0  (the "License");
+ * you may not use  this file  except in  compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * distributed  under the  License is distributed on an "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+ * implied.
+ *
  * See the License for the specific language governing permissions and
  * limitations under the License.
- *
  */
 package org.qi4j.library.uowfile;
 
@@ -18,27 +22,26 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Stack;
-
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
-
 import org.qi4j.io.Inputs;
 import org.qi4j.io.Outputs;
 import org.qi4j.test.AbstractQi4jTest;
 
 public abstract class AbstractUoWFileTest
-        extends AbstractQi4jTest
+    extends AbstractQi4jTest
 {
-
     protected static File baseTestDir;
 
     @BeforeClass
     public static void beforeClass()
-            throws IOException
+        throws IOException
     {
-        File testDir = new File( "build/uowfiletest");
-        if ( !testDir.exists() ) {
-            if ( !testDir.mkdirs() ) {
+        File testDir = new File( "build/uowfiletest" );
+        if( !testDir.exists() )
+        {
+            if( !testDir.mkdirs() )
+            {
                 throw new IOException( "Unable to create directory: " + testDir );
             }
         }
@@ -49,32 +52,39 @@ public abstract class AbstractUoWFileTest
     public static void afterClass()
     {
         // Delete test data
-        Stack<File> stack = new Stack<File>();
+        Stack<File> stack = new Stack<>();
         stack.push( baseTestDir );
-        while ( !stack.empty() ) {
+        while( !stack.empty() )
+        {
             File each = stack.peek();
-            if ( each.isDirectory() ) {
+            if( each.isDirectory() )
+            {
                 File[] children = each.listFiles();
-                if ( children.length > 0 ) {
-                    for ( File child : children ) {
+                if( children.length > 0 )
+                {
+                    for( File child : children )
+                    {
                         stack.push( child );
                     }
-                } else {
+                }
+                else
+                {
                     stack.pop().delete();
                 }
-            } else {
+            }
+            else
+            {
                 stack.pop().delete();
             }
         }
     }
 
     protected final boolean isFileFirstLineEqualsTo( File file, String start )
-            throws IOException
+        throws IOException
     {
-        List<String> lines = new ArrayList<String>();
+        List<String> lines = new ArrayList<>();
         // This load the full file but used test resources are single line files
         Inputs.text( file ).transferTo( Outputs.collection( lines ) );
         return lines.get( 0 ).trim().startsWith( start );
     }
-
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b049e9b6/libraries/uowfile/src/test/java/org/qi4j/library/uowfile/HasUoWFileTest.java
----------------------------------------------------------------------
diff --git a/libraries/uowfile/src/test/java/org/qi4j/library/uowfile/HasUoWFileTest.java b/libraries/uowfile/src/test/java/org/qi4j/library/uowfile/HasUoWFileTest.java
index 811ed03..c7de8d2 100644
--- a/libraries/uowfile/src/test/java/org/qi4j/library/uowfile/HasUoWFileTest.java
+++ b/libraries/uowfile/src/test/java/org/qi4j/library/uowfile/HasUoWFileTest.java
@@ -1,15 +1,19 @@
 /*
- * Copyright (c) 2011, Paul Merlin. All Rights Reserved.
+ * Copyright 2011-2014 Paul Merlin.
+ *
+ * Licensed  under the  Apache License,  Version 2.0  (the "License");
+ * you may not use  this file  except in  compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * distributed  under the  License is distributed on an "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+ * implied.
+ *
  * See the License for the specific language governing permissions and
  * limitations under the License.
- *
  */
 package org.qi4j.library.uowfile;
 
@@ -18,20 +22,15 @@ import java.io.IOException;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.List;
-
-import static org.junit.Assert.*;
 import org.junit.Before;
 import org.junit.Test;
-
 import org.qi4j.api.concern.Concerns;
 import org.qi4j.api.entity.EntityBuilder;
-import org.qi4j.api.entity.EntityComposite;
 import org.qi4j.api.entity.Identity;
 import org.qi4j.api.injection.scope.Structure;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.property.Property;
-import org.qi4j.api.service.ServiceComposite;
 import org.qi4j.api.structure.Module;
 import org.qi4j.api.unitofwork.UnitOfWork;
 import org.qi4j.api.unitofwork.UnitOfWorkCompletionException;
@@ -47,40 +46,36 @@ import org.qi4j.library.uowfile.internal.ConcurrentUoWFileModificationException;
 import org.qi4j.library.uowfile.singular.HasUoWFileLifecycle;
 import org.qi4j.library.uowfile.singular.UoWFileLocator;
 import org.qi4j.test.EntityTestAssembler;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 public class HasUoWFileTest
-        extends AbstractUoWFileTest
+    extends AbstractUoWFileTest
 {
-
     private static final Logger LOGGER = LoggerFactory.getLogger( HasUoWFileTest.class );
-
     private static final URL CREATION_CONTENT_URL = HasUoWFileTest.class.getResource( "creation.txt" );
-
     private static final URL MODIFICATION_CONTENT_URL = HasUoWFileTest.class.getResource( "modification.txt" );
 
     // START SNIPPET: entity
     // START SNIPPET: uowfile
     public interface TestedEntity
-            extends EntityComposite,
-                    // END SNIPPET: entity
-                    HasUoWFileLifecycle
+        extends HasUoWFileLifecycle // END SNIPPET: entity
+        , Identity
     // START SNIPPET: entity
     {
-
         Property<String> name();
-
     }
     // END SNIPPET: entity
     // END SNIPPET: uowfile
 
     // START SNIPPET: locator
-    public static abstract class TestedFileLocatorMixin
-            implements UoWFileLocator
+    public static class TestedFileLocatorMixin
+        implements UoWFileLocator
     {
-
         @This
         private Identity meAsIdentity;
 
@@ -89,65 +84,68 @@ public class HasUoWFileTest
         {
             return new File( baseTestDir, meAsIdentity.identity().get() );
         }
-
     }
     // END SNIPPET: locator
 
     @Mixins( HasUoWFileTest.TestServiceMixin.class )
     @Concerns( UnitOfWorkConcern.class )
     public interface TestService
-            extends ServiceComposite
     {
-
         void modifyFile( String entityId )
-                throws IOException;
+            throws IOException;
 
         @UnitOfWorkPropagation
         @UnitOfWorkRetry
         void modifyFileWithRetry( String entityId, long sleepBefore, long sleepAfter )
-                throws IOException;
-
+            throws IOException;
     }
 
     public static abstract class TestServiceMixin
-            implements TestService
+        implements TestService
     {
-
         @Structure
         private Module module;
 
         @Override
         public void modifyFile( String entityId )
-                throws IOException
+            throws IOException
         {
             modifyFileImmediatly( entityId );
         }
 
         @Override
         public void modifyFileWithRetry( String entityId, long sleepBefore, long sleepAfter )
-                throws IOException
+            throws IOException
         {
             LOGGER.info( "Waiting " + sleepBefore + "ms before file modification" );
-            if ( sleepBefore > 0 ) {
-                try {
+            if( sleepBefore > 0 )
+            {
+                try
+                {
                     Thread.sleep( sleepBefore );
-                } catch ( InterruptedException ex ) {
+                }
+                catch( InterruptedException ex )
+                {
                     throw new RuntimeException( ex );
                 }
             }
             modifyFileImmediatly( entityId );
             LOGGER.info( "Waiting " + sleepAfter + "ms after file modification" );
-            if ( sleepAfter > 0 ) {
-                try {
+            if( sleepAfter > 0 )
+            {
+                try
+                {
                     Thread.sleep( sleepAfter );
-                } catch ( InterruptedException ex ) {
+                }
+                catch( InterruptedException ex )
+                {
                     throw new RuntimeException( ex );
                 }
             }
         }
 
         private void modifyFileImmediatly( String entityId )
-                throws IOException
+            throws IOException
         {
             TestedEntity entity = module.currentUnitOfWork().get( TestedEntity.class, entityId );
             // START SNIPPET: api
@@ -162,7 +160,7 @@ public class HasUoWFileTest
     @Override
     // START SNIPPET: assembly
     public void assemble( ModuleAssembly module )
-            throws AssemblyException
+        throws AssemblyException
     {
         new UoWFileAssembler().assemble( module );
 
@@ -184,148 +182,183 @@ public class HasUoWFileTest
 
     @Test
     public void testCreation()
-            throws UnitOfWorkCompletionException, IOException
+        throws UnitOfWorkCompletionException, IOException
     {
         LOGGER.info( "# Test Creation ##############################################################################" );
+        File attachedFile;
 
         // Test discarded creation
-        UnitOfWork uow = module.newUnitOfWork();
-        TestedEntity entity = createTestedEntity( uow, "Testing Creation Rollback" );
-        File attachedFile = entity.attachedFile();
-        uow.discard();
+        try( UnitOfWork uow = module.newUnitOfWork() )
+        {
+            TestedEntity entity = createTestedEntity( uow, "Testing Creation Rollback" );
+            attachedFile = entity.attachedFile();
+        }
         assertFalse( "File still exists after discarded creation UoW", attachedFile.exists() );
 
         // Test completed creation
-        uow = module.newUnitOfWork();
-        entity = createTestedEntity( uow, "Testing Creation" );
-        attachedFile = entity.attachedFile();
-        uow.complete();
+        try( UnitOfWork uow = module.newUnitOfWork() )
+        {
+            TestedEntity entity = createTestedEntity( uow, "Testing Creation" );
+            attachedFile = entity.attachedFile();
+            uow.complete();
+        }
         assertTrue( "File content was not the good one", isFileFirstLineEqualsTo( attachedFile, "Creation" ) );
     }
 
     @Test
     public void testModification()
-            throws UnitOfWorkCompletionException, IOException
+        throws UnitOfWorkCompletionException, IOException
     {
         LOGGER.info( "# Test Modification ##########################################################################" );
+        final String entityId;
+        File attachedFile;
 
         // Create new
-        UnitOfWork uow = module.newUnitOfWork();
-        TestedEntity entity = createTestedEntity( uow, "Testing Modification" );
-        String entityId = entity.identity().get();
-        File attachedFile = entity.attachedFile();
-        uow.complete();
+        try( UnitOfWork uow = module.newUnitOfWork() )
+        {
+            TestedEntity entity = createTestedEntity( uow, "Testing Modification" );
+            entityId = entity.identity().get();
+            attachedFile = entity.attachedFile();
+            uow.complete();
+        }
 
         // Testing discarded modification
-        uow = module.newUnitOfWork();
-        testService.modifyFile( entityId );
-        uow.discard();
+        try( UnitOfWork uow = module.newUnitOfWork() )
+        {
+            testService.modifyFile( entityId );
+        }
         assertTrue( "File content after discarded modification was not the good one", isFileFirstLineEqualsTo( attachedFile, "Creation" ) );
 
         // Testing completed modification
-        uow = module.newUnitOfWork();
-        testService.modifyFile( entityId );
-        uow.complete();
+        try( UnitOfWork uow = module.newUnitOfWork() )
+        {
+            testService.modifyFile( entityId );
+            uow.complete();
+        }
         assertTrue( "Modified file content was not the good one", isFileFirstLineEqualsTo( attachedFile, "Modification" ) );
     }
 
     @Test
     public void testDeletion()
-            throws UnitOfWorkCompletionException, IOException
+        throws UnitOfWorkCompletionException, IOException
     {
         LOGGER.info( "# Test Deletion ##############################################################################" );
+        final String entityId;
+        File attachedFile;
 
         // Create new
-        UnitOfWork uow = module.newUnitOfWork();
-        TestedEntity entity = createTestedEntity( uow, "Testing Deletion" );
-        String entityId = entity.identity().get();
-        File attachedFile = entity.attachedFile();
-        uow.complete();
+        try( UnitOfWork uow = module.newUnitOfWork() )
+        {
+            TestedEntity entity = createTestedEntity( uow, "Testing Deletion" );
+            entityId = entity.identity().get();
+            attachedFile = entity.attachedFile();
+            uow.complete();
+        }
 
         // Testing discarded deletion
-        uow = module.newUnitOfWork();
-        entity = uow.get( TestedEntity.class, entityId );
-        uow.remove( entity );
-        uow.discard();
+        try( UnitOfWork uow = module.newUnitOfWork() )
+        {
+            TestedEntity entity = uow.get( TestedEntity.class, entityId );
+            uow.remove( entity );
+        }
         assertTrue( "File do not exists after discarded deletion", attachedFile.exists() );
 
         // Testing completed deletion
-        uow = module.newUnitOfWork();
-        entity = uow.get( TestedEntity.class, entityId );
-        uow.remove( entity );
-        uow.complete();
+        try( UnitOfWork uow = module.newUnitOfWork() )
+        {
+            TestedEntity entity = uow.get( TestedEntity.class, entityId );
+            uow.remove( entity );
+            uow.complete();
+        }
         assertFalse( "File still exists after deletion", attachedFile.exists() );
     }
 
     @Test
     public void testConcurrentModification()
-            throws IOException, UnitOfWorkCompletionException
+        throws IOException, UnitOfWorkCompletionException
     {
         LOGGER.info( "# Test Concurrent Modification ###############################################################" );
+        final String entityId;
 
         // Create new
-        UnitOfWork uow = module.newUnitOfWork();
-        TestedEntity entity = createTestedEntity( uow, "Testing Concurrent Modification" );
-        String entityId = entity.identity().get();
-        uow.complete();
+        try( UnitOfWork uow = module.newUnitOfWork() )
+        {
+            TestedEntity entity = createTestedEntity( uow, "Testing Concurrent Modification" );
+            entityId = entity.identity().get();
+            uow.complete();
+        }
 
         // Testing concurrent modification
+        UnitOfWork uow, uow2;
+        TestedEntity entity;
+
         uow = module.newUnitOfWork();
         entity = uow.get( TestedEntity.class, entityId );
         Inputs.text( MODIFICATION_CONTENT_URL ).transferTo( Outputs.text( entity.managedFile() ) );
-        UnitOfWork uow2 = module.newUnitOfWork();
+
+        uow2 = module.newUnitOfWork();
         entity = uow2.get( TestedEntity.class, entityId );
         Inputs.text( MODIFICATION_CONTENT_URL ).transferTo( Outputs.text( entity.managedFile() ) );
+
         uow.complete();
-        try {
+        try
+        {
             uow2.complete();
             fail( "A ConcurrentUoWFileModificationException should have been raised" );
-        } catch ( ConcurrentUoWFileModificationException expected ) {
+        }
+        catch( ConcurrentUoWFileModificationException expected )
+        {
             uow2.discard();
         }
     }
 
     @Test
     public void testRetry()
-            throws IOException, UnitOfWorkCompletionException, InterruptedException
+        throws IOException, UnitOfWorkCompletionException, InterruptedException
     {
         LOGGER.info( "# Test Retry #################################################################################" );
+        final String entityId;
+        File attachedFile;
 
         // Create new
-        UnitOfWork uow = module.newUnitOfWork();
-        TestedEntity entity = createTestedEntity( uow, "Testing Concurrent Modification" );
-        final String entityId = entity.identity().get();
-        File attachedFile = entity.attachedFile();
-        uow.complete();
+        try( UnitOfWork uow = module.newUnitOfWork() )
+        {
+            TestedEntity entity = createTestedEntity( uow, "Testing Concurrent Modification" );
+            entityId = entity.identity().get();
+            attachedFile = entity.attachedFile();
+            uow.complete();
+        }
 
-        final List<Exception> ex = new ArrayList<Exception>();
+        final List<Exception> ex = new ArrayList<>();
         Thread t1 = new Thread( new Runnable()
         {
-
             @Override
             public void run()
             {
-                try {
+                try
+                {
                     testService.modifyFileWithRetry( entityId, 0, 3000 );
-                } catch ( Exception ex1 ) {
+                }
+                catch( Exception ex1 )
+                {
                     ex.add( ex1 );
                 }
             }
-
         }, "job1" );
         Thread t2 = new Thread( new Runnable()
         {
-
             @Override
             public void run()
             {
-                try {
+                try
+                {
                     testService.modifyFileWithRetry( entityId, 1000, 0 );
-                } catch ( Exception ex1 ) {
+                }
+                catch( Exception ex1 )
+                {
                     ex.add( ex1 );
                 }
             }
-
         }, "job2" );
 
         t1.start();
@@ -334,7 +367,8 @@ public class HasUoWFileTest
         t1.join();
         t2.join();
 
-        for ( Exception eachEx : ex ) {
+        for( Exception eachEx : ex )
+        {
             eachEx.printStackTrace();
         }
 
@@ -343,7 +377,7 @@ public class HasUoWFileTest
     }
 
     private TestedEntity createTestedEntity( UnitOfWork uow, String name )
-            throws IOException
+        throws IOException
     {
         EntityBuilder<TestedEntity> builder = uow.newEntityBuilder( TestedEntity.class );
         TestedEntity entity = builder.instance();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b049e9b6/libraries/uowfile/src/test/java/org/qi4j/library/uowfile/HasUoWFilesTest.java
----------------------------------------------------------------------
diff --git a/libraries/uowfile/src/test/java/org/qi4j/library/uowfile/HasUoWFilesTest.java b/libraries/uowfile/src/test/java/org/qi4j/library/uowfile/HasUoWFilesTest.java
index a358ec7..8ecd1ab 100644
--- a/libraries/uowfile/src/test/java/org/qi4j/library/uowfile/HasUoWFilesTest.java
+++ b/libraries/uowfile/src/test/java/org/qi4j/library/uowfile/HasUoWFilesTest.java
@@ -1,15 +1,19 @@
 /*
- * Copyright (c) 2011, Paul Merlin. All Rights Reserved.
+ * Copyright 2011-2014 Paul Merlin.
+ *
+ * Licensed  under the  Apache License,  Version 2.0  (the "License");
+ * you may not use  this file  except in  compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * distributed  under the  License is distributed on an "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+ * implied.
+ *
  * See the License for the specific language governing permissions and
  * limitations under the License.
- *
  */
 package org.qi4j.library.uowfile;
 
@@ -18,20 +22,15 @@ import java.io.IOException;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.List;
-
-import static org.junit.Assert.*;
 import org.junit.Before;
 import org.junit.Test;
-
 import org.qi4j.api.concern.Concerns;
 import org.qi4j.api.entity.EntityBuilder;
-import org.qi4j.api.entity.EntityComposite;
 import org.qi4j.api.entity.Identity;
 import org.qi4j.api.injection.scope.Structure;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.property.Property;
-import org.qi4j.api.service.ServiceComposite;
 import org.qi4j.api.structure.Module;
 import org.qi4j.api.unitofwork.UnitOfWork;
 import org.qi4j.api.unitofwork.UnitOfWorkCompletionException;
@@ -47,55 +46,50 @@ import org.qi4j.library.uowfile.internal.ConcurrentUoWFileModificationException;
 import org.qi4j.library.uowfile.plural.HasUoWFilesLifecycle;
 import org.qi4j.library.uowfile.plural.UoWFilesLocator;
 import org.qi4j.test.EntityTestAssembler;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 public class HasUoWFilesTest
-        extends AbstractUoWFileTest
+    extends AbstractUoWFileTest
 {
-
     private static final Logger LOGGER = LoggerFactory.getLogger( HasUoWFilesTest.class );
-
     private static final URL CREATION_CONTENT_URL = HasUoWFilesTest.class.getResource( "creation.txt" );
-
     private static final URL MODIFICATION_CONTENT_URL = HasUoWFilesTest.class.getResource( "modification.txt" );
 
     // START SNIPPET: uowfile
     public enum MyEnum
     {
-
         fileOne, fileTwo
-
     }
 
     // START SNIPPET: entity
     public interface TestedEntity
-            extends EntityComposite,
-                    // END SNIPPET: entity
-                    HasUoWFilesLifecycle<MyEnum>
+        extends HasUoWFilesLifecycle<MyEnum> // END SNIPPET: entity
+        , Identity
     // START SNIPPET: entity
     {
-
         Property<String> name();
-
     }
     // END SNIPPET: entity
     // END SNIPPET: uowfile
 
     // START SNIPPET: locator
     public static abstract class TestedFilesLocatorMixin
-            implements UoWFilesLocator<MyEnum>
+        implements UoWFilesLocator<MyEnum>
     {
-
         @This
         private Identity meAsIdentity;
 
         @Override
         public Iterable<File> locateAttachedFiles()
         {
-            List<File> list = new ArrayList<File>();
-            for ( MyEnum eachValue : MyEnum.values() ) {
+            List<File> list = new ArrayList<>();
+            for( MyEnum eachValue : MyEnum.values() )
+            {
                 list.add( new File( baseTestDir, meAsIdentity.identity().get() + "." + eachValue.name() ) );
             }
             return list;
@@ -106,65 +100,68 @@ public class HasUoWFilesTest
         {
             return new File( baseTestDir, meAsIdentity.identity().get() + "." + key.name() );
         }
-
     }
     // END SNIPPET: locator
 
     @Mixins( TestServiceMixin.class )
     @Concerns( UnitOfWorkConcern.class )
     public interface TestService
-            extends ServiceComposite
     {
-
         void modifyFile( String entityId )
-                throws IOException;
+            throws IOException;
 
         @UnitOfWorkPropagation
         @UnitOfWorkRetry
         void modifyFileWithRetry( String entityId, long sleepBefore, long sleepAfter )
-                throws IOException;
-
+            throws IOException;
     }
 
-    public static abstract class TestServiceMixin
-            implements TestService
+    public static class TestServiceMixin
+        implements TestService
     {
-
         @Structure
         private Module module;
 
         @Override
         public void modifyFile( String entityId )
-                throws IOException
+            throws IOException
         {
             modifyFileImmediatly( entityId );
         }
 
         @Override
         public void modifyFileWithRetry( String entityId, long sleepBefore, long sleepAfter )
-                throws IOException
+            throws IOException
         {
             LOGGER.info( "Waiting " + sleepBefore + "ms before file modification" );
-            if ( sleepBefore > 0 ) {
-                try {
+            if( sleepBefore > 0 )
+            {
+                try
+                {
                     Thread.sleep( sleepBefore );
-                } catch ( InterruptedException ex ) {
+                }
+                catch( InterruptedException ex )
+                {
                     throw new RuntimeException( ex );
                 }
             }
             modifyFileImmediatly( entityId );
             LOGGER.info( "Waiting " + sleepAfter + "ms after file modification" );
-            if ( sleepAfter > 0 ) {
-                try {
+            if( sleepAfter > 0 )
+            {
+                try
+                {
                     Thread.sleep( sleepAfter );
-                } catch ( InterruptedException ex ) {
+                }
+                catch( InterruptedException ex )
+                {
                     throw new RuntimeException( ex );
                 }
             }
         }
 
         private void modifyFileImmediatly( String entityId )
-                throws IOException
+            throws IOException
         {
             TestedEntity entity = module.currentUnitOfWork().get( TestedEntity.class, entityId );
             // START SNIPPET: api
@@ -173,13 +170,12 @@ public class HasUoWFilesTest
             // END SNIPPET: api
             Inputs.text( MODIFICATION_CONTENT_URL ).transferTo( Outputs.text( managedFileOne ) );
         }
-
     }
 
     @Override
     // START SNIPPET: assembly
     public void assemble( ModuleAssembly module )
-            throws AssemblyException
+        throws AssemblyException
     {
         new UoWFileAssembler().assemble( module );
 
@@ -201,148 +197,183 @@ public class HasUoWFilesTest
 
     @Test
     public void testCreation()
-            throws UnitOfWorkCompletionException, IOException
+        throws UnitOfWorkCompletionException, IOException
     {
         LOGGER.info( "# Test Creation ##############################################################################" );
+        File attachedFile;
 
         // Test discarded creation
-        UnitOfWork uow = module.newUnitOfWork();
-        TestedEntity entity = createTestedOneEntityTwoFilesEntity( uow, "Testing Creation Rollback" );
-        File attachedFile = entity.attachedFile( MyEnum.fileOne );
-        uow.discard();
+        try( UnitOfWork uow = module.newUnitOfWork() )
+        {
+            TestedEntity entity = createTestedOneEntityTwoFilesEntity( uow, "Testing Creation Rollback" );
+            attachedFile = entity.attachedFile( MyEnum.fileOne );
+        }
         assertFalse( "File still exists after discarded creation UoW", attachedFile.exists() );
 
         // Test completed creation
-        uow = module.newUnitOfWork();
-        entity = createTestedOneEntityTwoFilesEntity( uow, "Testing Creation" );
-        attachedFile = entity.attachedFile( MyEnum.fileOne );
-        uow.complete();
+        try( UnitOfWork uow = module.newUnitOfWork() )
+        {
+            TestedEntity entity = createTestedOneEntityTwoFilesEntity( uow, "Testing Creation" );
+            attachedFile = entity.attachedFile( MyEnum.fileOne );
+            uow.complete();
+        }
         assertTrue( "File content was not the good one", isFileFirstLineEqualsTo( attachedFile, "Creation" ) );
     }
 
     @Test
     public void testModification()
-            throws UnitOfWorkCompletionException, IOException
+        throws UnitOfWorkCompletionException, IOException
     {
         LOGGER.info( "# Test Modification ##########################################################################" );
+        final String entityId;
+        File attachedFile;
 
         // Create new
-        UnitOfWork uow = module.newUnitOfWork();
-        TestedEntity entity = createTestedOneEntityTwoFilesEntity( uow, "Testing Modification" );
-        String entityId = entity.identity().get();
-        File attachedFile = entity.attachedFile( MyEnum.fileOne );
-        uow.complete();
+        try( UnitOfWork uow = module.newUnitOfWork() )
+        {
+            TestedEntity entity = createTestedOneEntityTwoFilesEntity( uow, "Testing Modification" );
+            entityId = entity.identity().get();
+            attachedFile = entity.attachedFile( MyEnum.fileOne );
+            uow.complete();
+        }
 
         // Testing discarded modification
-        uow = module.newUnitOfWork();
-        testService.modifyFile( entityId );
-        uow.discard();
+        try( UnitOfWork uow = module.newUnitOfWork() )
+        {
+            testService.modifyFile( entityId );
+        }
         assertTrue( "File content after discarded modification was not the good one", isFileFirstLineEqualsTo( attachedFile, "Creation" ) );
 
         // Testing completed modification
-        uow = module.newUnitOfWork();
-        testService.modifyFile( entityId );
-        uow.complete();
+        try( UnitOfWork uow = module.newUnitOfWork() )
+        {
+            testService.modifyFile( entityId );
+            uow.complete();
+        }
         assertTrue( "Modified file content was not the good one", isFileFirstLineEqualsTo( attachedFile, "Modification" ) );
     }
 
     @Test
     public void testDeletion()
-            throws UnitOfWorkCompletionException, IOException
+        throws UnitOfWorkCompletionException, IOException
     {
         LOGGER.info( "# Test Deletion ##############################################################################" );
+        final String entityId;
+        File attachedFile;
 
         // Create new
-        UnitOfWork uow = module.newUnitOfWork();
-        TestedEntity entity = createTestedOneEntityTwoFilesEntity( uow, "Testing Deletion" );
-        String entityId = entity.identity().get();
-        File attachedFile = entity.attachedFile( MyEnum.fileOne );
-        uow.complete();
+        try( UnitOfWork uow = module.newUnitOfWork() )
+        {
+            TestedEntity entity = createTestedOneEntityTwoFilesEntity( uow, "Testing Deletion" );
+            entityId = entity.identity().get();
+            attachedFile = entity.attachedFile( MyEnum.fileOne );
+            uow.complete();
+        }
 
         // Testing discarded deletion
-        uow = module.newUnitOfWork();
-        entity = uow.get( TestedEntity.class, entityId );
-        uow.remove( entity );
-        uow.discard();
+        try( UnitOfWork uow = module.newUnitOfWork() )
+        {
+            TestedEntity entity = uow.get( TestedEntity.class, entityId );
+            uow.remove( entity );
+        }
         assertTrue( "File do not exists after discarded deletion", attachedFile.exists() );
 
         // Testing completed deletion
-        uow = module.newUnitOfWork();
-        entity = uow.get( TestedEntity.class, entityId );
-        uow.remove( entity );
-        uow.complete();
+        try( UnitOfWork uow = module.newUnitOfWork() )
+        {
+            TestedEntity entity = uow.get( TestedEntity.class, entityId );
+            uow.remove( entity );
+            uow.complete();
+        }
         assertFalse( "File still exists after deletion", attachedFile.exists() );
     }
 
     @Test
     public void testConcurrentModification()
-            throws IOException, UnitOfWorkCompletionException
+        throws IOException, UnitOfWorkCompletionException
     {
         LOGGER.info( "# Test Concurrent Modification ###############################################################" );
+        final String entityId;
 
         // Create new
-        UnitOfWork uow = module.newUnitOfWork();
-        TestedEntity entity = createTestedOneEntityTwoFilesEntity( uow, "Testing Concurrent Modification" );
-        String entityId = entity.identity().get();
-        uow.complete();
+        try( UnitOfWork uow = module.newUnitOfWork() )
+        {
+            TestedEntity entity = createTestedOneEntityTwoFilesEntity( uow, "Testing Concurrent Modification" );
+            entityId = entity.identity().get();
+            uow.complete();
+        }
 
         // Testing concurrent modification
+        UnitOfWork uow, uow2;
+        TestedEntity entity;
+
         uow = module.newUnitOfWork();
         entity = uow.get( TestedEntity.class, entityId );
         Inputs.text( MODIFICATION_CONTENT_URL ).transferTo( Outputs.text( entity.managedFile( MyEnum.fileOne ) ) );
-        UnitOfWork uow2 = module.newUnitOfWork();
+
+        uow2 = module.newUnitOfWork();
         entity = uow2.get( TestedEntity.class, entityId );
         Inputs.text( MODIFICATION_CONTENT_URL ).transferTo( Outputs.text( entity.managedFile( MyEnum.fileOne ) ) );
+
         uow.complete();
-        try {
+        try
+        {
             uow2.complete();
             fail( "A ConcurrentUoWFileModificationException should have been raised" );
-        } catch ( ConcurrentUoWFileModificationException expected ) {
+        }
+        catch( ConcurrentUoWFileModificationException expected )
+        {
             uow2.discard();
         }
     }
 
     @Test
     public void testRetry()
-            throws IOException, UnitOfWorkCompletionException, InterruptedException
+        throws IOException, UnitOfWorkCompletionException, InterruptedException
     {
         LOGGER.info( "# Test Retry #################################################################################" );
+        final String entityId;
+        File attachedFile;
 
         // Create new
-        UnitOfWork uow = module.newUnitOfWork();
-        TestedEntity entity = createTestedOneEntityTwoFilesEntity( uow, "Testing Concurrent Modification" );
-        final String entityId = entity.identity().get();
-        File attachedFile = entity.attachedFile( MyEnum.fileOne );
-        uow.complete();
+        try( UnitOfWork uow = module.newUnitOfWork() )
+        {
+            TestedEntity entity = createTestedOneEntityTwoFilesEntity( uow, "Testing Concurrent Modification" );
+            entityId = entity.identity().get();
+            attachedFile = entity.attachedFile( MyEnum.fileOne );
+            uow.complete();
+        }
 
-        final List<Exception> ex = new ArrayList<Exception>();
+        final List<Exception> ex = new ArrayList<>();
         Thread t1 = new Thread( new Runnable()
         {
-
             @Override
             public void run()
             {
-                try {
+                try
+                {
                     testService.modifyFileWithRetry( entityId, 0, 10000 );
-                } catch ( Exception ex1 ) {
+                }
+                catch( Exception ex1 )
+                {
                     ex.add( ex1 );
                 }
             }
-
         }, "job1" );
         Thread t2 = new Thread( new Runnable()
         {
-
             @Override
             public void run()
             {
-                try {
+                try
+                {
                     testService.modifyFileWithRetry( entityId, 5000, 0 );
-                } catch ( Exception ex1 ) {
+                }
+                catch( Exception ex1 )
+                {
                     ex.add( ex1 );
                 }
             }
-
         }, "job2" );
 
         t1.start();
@@ -351,7 +382,8 @@ public class HasUoWFilesTest
         t1.join();
         t2.join();
 
-        for ( Exception eachEx : ex ) {
+        for( Exception eachEx : ex )
+        {
             eachEx.printStackTrace();
         }
 
@@ -360,7 +392,7 @@ public class HasUoWFilesTest
     }
 
     private TestedEntity createTestedOneEntityTwoFilesEntity( UnitOfWork uow, String name )
-            throws IOException
+        throws IOException
     {
         EntityBuilder<TestedEntity> builder = uow.newEntityBuilder( TestedEntity.class );
         TestedEntity entity = builder.instance();


[27/50] [abbrv] zest-qi4j git commit: Removed Function, Function2 and Specification and replaced with the equivalents in JDK, Function, BiFunction and Predicate.

Posted by ni...@apache.org.
http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/service/qualifier/ServiceQualifier.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/service/qualifier/ServiceQualifier.java b/core/api/src/main/java/org/qi4j/api/service/qualifier/ServiceQualifier.java
index 75410d6..9f5318e 100644
--- a/core/api/src/main/java/org/qi4j/api/service/qualifier/ServiceQualifier.java
+++ b/core/api/src/main/java/org/qi4j/api/service/qualifier/ServiceQualifier.java
@@ -14,8 +14,8 @@
 
 package org.qi4j.api.service.qualifier;
 
+import java.util.function.Predicate;
 import org.qi4j.api.service.ServiceReference;
-import org.qi4j.functional.Specification;
 
 /**
  * This class helps you select a particular service
@@ -42,13 +42,13 @@ import org.qi4j.functional.Specification;
  */
 public abstract class ServiceQualifier
 {
-    public static <T> T firstService( Specification<ServiceReference<?>> qualifier,
+    public static <T> T firstService( Predicate<ServiceReference<?>> qualifier,
                                       Iterable<ServiceReference<T>> services
     )
     {
         for( ServiceReference<T> service : services )
         {
-            if( qualifier.satisfiedBy( service ) )
+            if( qualifier.test( service ) )
             {
                 return service.get();
             }
@@ -56,24 +56,24 @@ public abstract class ServiceQualifier
         return null;
     }
 
-    public static Specification<ServiceReference<?>> withId( final String anId )
+    public static Predicate<ServiceReference<?>> withId( final String anId )
     {
-        return new Specification<ServiceReference<?>>()
+        return new Predicate<ServiceReference<?>>()
         {
             @Override
-            public boolean satisfiedBy( ServiceReference<?> service )
+            public boolean test( ServiceReference<?> service )
             {
                 return service.identity().equals( anId );
             }
         };
     }
 
-    public static Specification<ServiceReference<?>> whereMetaInfoIs( final Object metaInfo )
+    public static Predicate<ServiceReference<?>> whereMetaInfoIs( final Object metaInfo )
     {
-        return new Specification<ServiceReference<?>>()
+        return new Predicate<ServiceReference<?>>()
         {
             @Override
-            public boolean satisfiedBy( ServiceReference<?> service )
+            public boolean test( ServiceReference<?> service )
             {
                 Object metaObject = service.metaInfo( metaInfo.getClass() );
                 return metaObject != null && metaInfo.equals( metaObject );
@@ -81,36 +81,36 @@ public abstract class ServiceQualifier
         };
     }
 
-    public static Specification<ServiceReference<?>> whereActive()
+    public static Predicate<ServiceReference<?>> whereActive()
     {
-        return new Specification<ServiceReference<?>>()
+        return new Predicate<ServiceReference<?>>()
         {
             @Override
-            public boolean satisfiedBy( ServiceReference<?> service )
+            public boolean test( ServiceReference<?> service )
             {
                 return service.isActive();
             }
         };
     }
 
-    public static Specification<ServiceReference<?>> whereAvailable()
+    public static Predicate<ServiceReference<?>> whereAvailable()
     {
-        return new Specification<ServiceReference<?>>()
+        return new Predicate<ServiceReference<?>>()
         {
             @Override
-            public boolean satisfiedBy( ServiceReference<?> service )
+            public boolean test( ServiceReference<?> service )
             {
                 return service.isAvailable();
             }
         };
     }
 
-    public static Specification<ServiceReference<?>> withTags( final String... tags )
+    public static Predicate<ServiceReference<?>> withTags( final String... tags )
     {
-        return new Specification<ServiceReference<?>>()
+        return new Predicate<ServiceReference<?>>()
         {
             @Override
-            public boolean satisfiedBy( ServiceReference<?> service )
+            public boolean test( ServiceReference<?> service )
             {
                 ServiceTags serviceTags = service.metaInfo( ServiceTags.class );
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/service/qualifier/Tagged.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/service/qualifier/Tagged.java b/core/api/src/main/java/org/qi4j/api/service/qualifier/Tagged.java
index 3c8c0b7..7046bd2 100644
--- a/core/api/src/main/java/org/qi4j/api/service/qualifier/Tagged.java
+++ b/core/api/src/main/java/org/qi4j/api/service/qualifier/Tagged.java
@@ -16,8 +16,8 @@ package org.qi4j.api.service.qualifier;
 
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
+import java.util.function.Predicate;
 import org.qi4j.api.service.ServiceReference;
-import org.qi4j.functional.Specification;
 
 /**
  * Filter services based on tags. Tags can be set using the ServiceTags meta-info, like so:
@@ -46,7 +46,7 @@ public @interface Tagged
         implements AnnotationQualifier<Tagged>
     {
         @Override
-        public Specification<ServiceReference<?>> qualifier( Tagged tagged )
+        public Predicate<ServiceReference<?>> qualifier( Tagged tagged )
         {
             return ServiceQualifier.withTags( tagged.value() );
         }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/type/CollectionType.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/type/CollectionType.java b/core/api/src/main/java/org/qi4j/api/type/CollectionType.java
index 1b85b5f..447c07a 100644
--- a/core/api/src/main/java/org/qi4j/api/type/CollectionType.java
+++ b/core/api/src/main/java/org/qi4j/api/type/CollectionType.java
@@ -29,7 +29,7 @@ public final class CollectionType
 
     public static boolean isCollection( Type type )
     {
-        Class<?> cl = Classes.RAW_CLASS.map( type );
+        Class<?> cl = Classes.RAW_CLASS.apply( type );
         return cl.equals( Collection.class ) || cl.equals( List.class ) || cl.equals( Set.class );
     }
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/type/MapType.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/type/MapType.java b/core/api/src/main/java/org/qi4j/api/type/MapType.java
index ddf03c5..4b67ee7 100644
--- a/core/api/src/main/java/org/qi4j/api/type/MapType.java
+++ b/core/api/src/main/java/org/qi4j/api/type/MapType.java
@@ -30,7 +30,7 @@ public final class MapType
 
     public static boolean isMap( Type type )
     {
-        Class<?> cl = Classes.RAW_CLASS.map( type );
+        Class<?> cl = Classes.RAW_CLASS.apply( type );
         return Map.class.isAssignableFrom( cl );
     }
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/type/MatchTypeSpecification.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/type/MatchTypeSpecification.java b/core/api/src/main/java/org/qi4j/api/type/MatchTypeSpecification.java
index ff7e8e5..ec168df 100644
--- a/core/api/src/main/java/org/qi4j/api/type/MatchTypeSpecification.java
+++ b/core/api/src/main/java/org/qi4j/api/type/MatchTypeSpecification.java
@@ -16,13 +16,13 @@
 
 package org.qi4j.api.type;
 
-import org.qi4j.functional.Specification;
+import java.util.function.Predicate;
 
 /**
  * Match Type Specification for HasTypes.
  */
 public class MatchTypeSpecification
-    implements Specification<HasTypes>
+    implements Predicate<HasTypes>
 {
     private final Class<?> matchType;
 
@@ -32,7 +32,7 @@ public class MatchTypeSpecification
     }
 
     @Override
-    public boolean satisfiedBy( HasTypes item )
+    public boolean test( HasTypes item )
     {
         for( Class<?> type : item.types() )
         {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/type/ValueCompositeType.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/type/ValueCompositeType.java b/core/api/src/main/java/org/qi4j/api/type/ValueCompositeType.java
index c546625..cb74c9d 100644
--- a/core/api/src/main/java/org/qi4j/api/type/ValueCompositeType.java
+++ b/core/api/src/main/java/org/qi4j/api/type/ValueCompositeType.java
@@ -30,7 +30,7 @@ public final class ValueCompositeType
 
     public static boolean isValueComposite( Type type )
     {
-        return ValueComposite.class.isAssignableFrom( Classes.RAW_CLASS.map( type ) );
+        return ValueComposite.class.isAssignableFrom( Classes.RAW_CLASS.apply( type ) );
     }
 
     public ValueCompositeType( ValueDescriptor model )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/type/ValueType.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/type/ValueType.java b/core/api/src/main/java/org/qi4j/api/type/ValueType.java
index ede914c..5cb4db4 100644
--- a/core/api/src/main/java/org/qi4j/api/type/ValueType.java
+++ b/core/api/src/main/java/org/qi4j/api/type/ValueType.java
@@ -15,8 +15,8 @@
 package org.qi4j.api.type;
 
 import java.util.Collections;
+import java.util.function.Function;
 import org.qi4j.api.util.NullArgumentException;
-import org.qi4j.functional.Function;
 import org.qi4j.functional.Iterables;
 
 import static org.qi4j.functional.Iterables.first;
@@ -138,7 +138,7 @@ public class ValueType
             new Function<Class<?>, String>()
             {
                 @Override
-                public String map( Class<?> item )
+                public String apply( Class<?> item )
                 {
                     return item.getName();
                 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/unitofwork/NoSuchEntityException.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/unitofwork/NoSuchEntityException.java b/core/api/src/main/java/org/qi4j/api/unitofwork/NoSuchEntityException.java
index aff3bfa..3a43ade 100644
--- a/core/api/src/main/java/org/qi4j/api/unitofwork/NoSuchEntityException.java
+++ b/core/api/src/main/java/org/qi4j/api/unitofwork/NoSuchEntityException.java
@@ -13,8 +13,8 @@
  */
 package org.qi4j.api.unitofwork;
 
+import java.util.function.Function;
 import org.qi4j.api.entity.EntityReference;
-import org.qi4j.functional.Function;
 import org.qi4j.functional.Iterables;
 
 /**
@@ -67,7 +67,7 @@ public class NoSuchEntityException
         Iterable<String> map = Iterables.map( new Function<Class<?>, String>()
         {
             @Override
-            public String map( Class<?> item )
+            public String apply( Class<?> item )
             {
                 return item.getName();
             }
@@ -83,7 +83,7 @@ public class NoSuchEntityException
             }
 
             @Override
-            public String map( String strings )
+            public String apply( String strings )
             {
                 if( !first )
                 {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/util/Annotations.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/util/Annotations.java b/core/api/src/main/java/org/qi4j/api/util/Annotations.java
index 8adc5ff..a770632 100644
--- a/core/api/src/main/java/org/qi4j/api/util/Annotations.java
+++ b/core/api/src/main/java/org/qi4j/api/util/Annotations.java
@@ -18,9 +18,9 @@ import java.lang.annotation.Annotation;
 import java.lang.reflect.AccessibleObject;
 import java.lang.reflect.AnnotatedElement;
 import java.lang.reflect.Type;
-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;
 
 import static org.qi4j.api.util.Classes.interfacesOf;
 import static org.qi4j.api.util.Classes.typeOf;
@@ -37,18 +37,18 @@ public final class Annotations
     public static Function<Type, Iterable<Annotation>> ANNOTATIONS_OF = Classes.forTypes( new Function<Type, Iterable<Annotation>>()
     {
         @Override
-        public Iterable<Annotation> map( Type type )
+        public Iterable<Annotation> apply( Type type )
         {
-            return Iterables.iterable( Classes.RAW_CLASS.map( type ).getAnnotations() );
+            return Iterables.iterable( Classes.RAW_CLASS.apply( type ).getAnnotations() );
         }
     } );
 
-    public static Specification<AnnotatedElement> hasAnnotation( final Class<? extends Annotation> annotationType )
+    public static Predicate<AnnotatedElement> hasAnnotation( final Class<? extends Annotation> annotationType )
     {
-        return new Specification<AnnotatedElement>()
+        return new Predicate<AnnotatedElement>()
         {
             @Override
-            public boolean satisfiedBy( AnnotatedElement element )
+            public boolean test( AnnotatedElement element )
             {
                 return element.getAnnotation( annotationType ) != null;
             }
@@ -60,19 +60,19 @@ public final class Annotations
         return new Function<Annotation, Class<? extends Annotation>>()
         {
             @Override
-            public Class<? extends Annotation> map( Annotation annotation )
+            public Class<? extends Annotation> apply( Annotation annotation )
             {
                 return annotation.annotationType();
             }
         };
     }
 
-    public static Specification<Annotation> isType( final Class<? extends Annotation> annotationType )
+    public static Predicate<Annotation> isType( final Class<? extends Annotation> annotationType )
     {
-        return new Specification<Annotation>()
+        return new Predicate<Annotation>()
         {
             @Override
-            public boolean satisfiedBy( Annotation annotation )
+            public boolean test( Annotation annotation )
             {
                 return annotation.annotationType().equals( annotationType );
             }
@@ -81,7 +81,7 @@ public final class Annotations
 
     public static <T extends Annotation> T annotationOn( Type type, Class<T> annotationType )
     {
-        return annotationType.cast( Classes.RAW_CLASS.map( type ).getAnnotation( annotationType ) );
+        return annotationType.cast( Classes.RAW_CLASS.apply( type ).getAnnotation( annotationType ) );
     }
 
     public static Iterable<Annotation> findAccessorAndTypeAnnotationsIn( AccessibleObject accessor )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/util/Classes.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/util/Classes.java b/core/api/src/main/java/org/qi4j/api/util/Classes.java
index 9413f9e..807b4be 100644
--- a/core/api/src/main/java/org/qi4j/api/util/Classes.java
+++ b/core/api/src/main/java/org/qi4j/api/util/Classes.java
@@ -30,10 +30,10 @@ import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.function.Function;
+import java.util.function.Predicate;
 import org.qi4j.api.composite.ModelDescriptor;
-import org.qi4j.functional.Function;
 import org.qi4j.functional.Iterables;
-import org.qi4j.functional.Specification;
 
 import static org.qi4j.functional.Iterables.cast;
 import static org.qi4j.functional.Iterables.empty;
@@ -85,7 +85,7 @@ public final class Classes
     private static final Function<Type, Type> WRAPPER_CLASS = new Function<Type, Type>()
     {
         @Override
-        public Type map( Type aClass )
+        public Type apply( Type aClass )
         {
             Type wrapperClass = wrapperClasses.get( aClass );
             return wrapperClass == null ? aClass : wrapperClass;
@@ -100,7 +100,7 @@ public final class Classes
     private static final Function<Type, Type> PRIMITIVE_CLASS = new Function<Type, Type>()
     {
         @Override
-        public Type map( Type aClass )
+        public Type apply( Type aClass )
         {
             Type primitiveClass = primitiveClasses.get( aClass );
             return primitiveClass == null ? aClass : primitiveClass;
@@ -113,7 +113,7 @@ public final class Classes
     public static final Function<Type, Class<?>> RAW_CLASS = new Function<Type, Class<?>>()
     {
         @Override
-        public Class<?> map( Type genericType )
+        public Class<?> apply( Type genericType )
         {
             // Calculate raw type
             if( genericType instanceof Class )
@@ -144,7 +144,7 @@ public final class Classes
     private static final Function<AccessibleObject, Type> TYPE_OF = new Function<AccessibleObject, Type>()
     {
         @Override
-        public Type map( AccessibleObject accessor )
+        public Type apply( AccessibleObject accessor )
         {
             return accessor instanceof Method ? ( (Method) accessor ).getGenericReturnType() : ( (Field) accessor ).getGenericType();
         }
@@ -154,7 +154,7 @@ public final class Classes
     {
         @Override
         @SuppressWarnings( {"raw", "unchecked"} )
-        public Iterable<Class<?>> map( Type type )
+        public Iterable<Class<?>> apply( Type type )
         {
             if( type == null )
             {
@@ -167,9 +167,9 @@ public final class Classes
             }
             else
             {
-                type = RAW_CLASS.map( type );
+                type = RAW_CLASS.apply( type );
                 Class superclass = ( (Class) type ).getSuperclass();
-                return prepend( (Class<?>) type, map( superclass ) );
+                return prepend( (Class<?>) type, apply( superclass ) );
             }
         }
     };
@@ -178,9 +178,9 @@ public final class Classes
     private static final Function<Type, Iterable<Type>> INTERFACES_OF = new Function<Type, Iterable<Type>>()
     {
         @Override
-        public Iterable<Type> map( Type type )
+        public Iterable<Type> apply( Type type )
         {
-            Class clazz = RAW_CLASS.map( type );
+            Class clazz = RAW_CLASS.apply( type );
 
             if( clazz.isInterface() )
             {
@@ -198,7 +198,7 @@ public final class Classes
                 {
                     return flatten( flattenIterables( Iterables.map( INTERFACES_OF,
                                                                      iterable( clazz.getGenericInterfaces() ) ) ),
-                                    INTERFACES_OF.map( RAW_CLASS.map( type ).getSuperclass() ) );
+                                    INTERFACES_OF.apply( RAW_CLASS.apply( type ).getSuperclass() ) );
                 }
             }
         }
@@ -208,9 +208,9 @@ public final class Classes
     private static final Function<Type, Iterable<Type>> TYPES_OF = new Function<Type, Iterable<Type>>()
     {
         @Override
-        public Iterable<Type> map( Type type )
+        public Iterable<Type> apply( Type type )
         {
-            Class clazz = RAW_CLASS.map( type );
+            Class clazz = RAW_CLASS.apply( type );
 
             if( clazz.isInterface() )
             {
@@ -220,15 +220,15 @@ public final class Classes
             }
             else
             {
-                return flatten( CLASS_HIERARCHY.map( type ),
-                                flattenIterables( Iterables.map( INTERFACES_OF, CLASS_HIERARCHY.map( type ) ) ) );
+                return flatten( CLASS_HIERARCHY.apply( type ),
+                                flattenIterables( Iterables.map( INTERFACES_OF, CLASS_HIERARCHY.apply( type ) ) ) );
             }
         }
     };
 
     public static Type typeOf( AccessibleObject from )
     {
-        return TYPE_OF.map( from );
+        return TYPE_OF.apply( from );
     }
 
     public static Iterable<Type> typesOf( Iterable<Type> types )
@@ -243,7 +243,7 @@ public final class Classes
 
     public static Iterable<Type> typesOf( Type type )
     {
-        return TYPES_OF.map( type );
+        return TYPES_OF.apply( type );
     }
 
     public static Iterable<? extends Type> interfacesOf( Iterable<? extends Type> types )
@@ -258,26 +258,26 @@ public final class Classes
 
     public static Iterable<Type> interfacesOf( Type type )
     {
-        return INTERFACES_OF.map( type );
+        return INTERFACES_OF.apply( type );
     }
 
     public static Iterable<Class<?>> classHierarchy( Class<?> type )
     {
-        return CLASS_HIERARCHY.map( type );
+        return CLASS_HIERARCHY.apply( type );
     }
 
     public static Type wrapperClass( Type type )
     {
-        return WRAPPER_CLASS.map( type );
+        return WRAPPER_CLASS.apply( type );
     }
 
-    public static Specification<Class<?>> isAssignableFrom( final Class clazz )
+    public static Predicate<Class<?>> isAssignableFrom( final Class clazz )
     {
-        return new Specification<Class<?>>()
+        return new Predicate<Class<?>>()
         {
             @Override
             @SuppressWarnings( "unchecked" )
-            public boolean satisfiedBy( Class<?> item )
+            public boolean test( Class<?> item )
             {
                 return clazz.isAssignableFrom( item );
             }
@@ -285,24 +285,24 @@ public final class Classes
     }
 
     @SuppressWarnings( "raw" )
-    public static Specification<Object> instanceOf( final Class clazz )
+    public static Predicate<Object> instanceOf( final Class clazz )
     {
-        return new Specification<Object>()
+        return new Predicate<Object>()
         {
             @Override
-            public boolean satisfiedBy( Object item )
+            public boolean test( Object item )
             {
                 return clazz.isInstance( item );
             }
         };
     }
 
-    public static Specification<Class<?>> hasModifier( final int classModifier )
+    public static Predicate<Class<?>> hasModifier( final int classModifier )
     {
-        return new Specification<Class<?>>()
+        return new Predicate<Class<?>>()
         {
             @Override
-            public boolean satisfiedBy( Class<?> item )
+            public boolean test( Class<?> item )
             {
                 return ( item.getModifiers() & classModifier ) != 0;
             }
@@ -314,9 +314,9 @@ public final class Classes
         return new Function<Type, Iterable<T>>()
         {
             @Override
-            public Iterable<T> map( Type type )
+            public Iterable<T> apply( Type type )
             {
-                return flattenIterables( Iterables.map( function, CLASS_HIERARCHY.map( type ) ) );
+                return flattenIterables( Iterables.map( function, CLASS_HIERARCHY.apply( type ) ) );
             }
         };
     }
@@ -326,9 +326,9 @@ public final class Classes
         return new Function<Type, Iterable<T>>()
         {
             @Override
-            public Iterable<T> map( Type type )
+            public Iterable<T> apply( Type type )
             {
-                return flattenIterables( Iterables.map( function, TYPES_OF.map( type ) ) );
+                return flattenIterables( Iterables.map( function, TYPES_OF.apply( type ) ) );
             }
         };
     }
@@ -415,9 +415,9 @@ public final class Classes
         AnnotationType findAnnotationOfTypeOrAnyOfSuperTypes( Class<?> type, Class<AnnotationType> annotationClass )
     {
         AnnotationType result = null;
-        for( Type clazz : Classes.TYPES_OF.map( type ) )
+        for( Type clazz : Classes.TYPES_OF.apply( type ) )
         {
-            result = Classes.RAW_CLASS.map( clazz ).getAnnotation( annotationClass );
+            result = Classes.RAW_CLASS.apply( clazz ).getAnnotation( annotationClass );
             if( result != null )
             {
                 break;
@@ -427,12 +427,12 @@ public final class Classes
         return result;
     }
 
-    public static Specification<Member> memberNamed( final String name )
+    public static Predicate<Member> memberNamed( final String name )
     {
-        return new Specification<Member>()
+        return new Predicate<Member>()
         {
             @Override
-            public boolean satisfiedBy( Member item )
+            public boolean test( Member item )
             {
                 return item.getName().equals( name );
             }
@@ -480,7 +480,7 @@ public final class Classes
         List<Type> types = new ArrayList<>();
         for( Type type : current.getGenericInterfaces() )
         {
-            Iterable<Type> interfaces = Classes.INTERFACES_OF.map( type );
+            Iterable<Type> interfaces = Classes.INTERFACES_OF.apply( type );
             for( Type anInterface : interfaces )
             {
                 if( !types.contains( anInterface ) )
@@ -593,24 +593,24 @@ public final class Classes
         return uriPart.replace( '-', '$' );
     }
 
-    public static Specification<ModelDescriptor> modelTypeSpecification( final String className )
+    public static Predicate<ModelDescriptor> modelTypeSpecification( final String className )
     {
-        return new Specification<ModelDescriptor>()
+        return new Predicate<ModelDescriptor>()
         {
             @Override
-            public boolean satisfiedBy( ModelDescriptor item )
+            public boolean test( ModelDescriptor item )
             {
-                return matchesAny( new Specification<String>()
+                return matchesAny( new Predicate<String>()
                 {
                     @Override
-                    public boolean satisfiedBy( String item )
+                    public boolean test( String item )
                     {
                         return item.equals( className );
                     }
                 }, map( new Function<Class<?>, String>()
                 {
                     @Override
-                    public String map( Class<?> item )
+                    public String apply( Class<?> item )
                     {
                         return item.getName();
                     }
@@ -620,17 +620,17 @@ public final class Classes
     }
 
     @SuppressWarnings( "raw" )
-    public static Specification<ModelDescriptor> exactTypeSpecification( final Class type )
+    public static Predicate<ModelDescriptor> exactTypeSpecification( final Class type )
     {
-        return new Specification<ModelDescriptor>()
+        return new Predicate<ModelDescriptor>()
         {
             @Override
-            public boolean satisfiedBy( ModelDescriptor item )
+            public boolean test( ModelDescriptor item )
             {
-                return matchesAny( new Specification<Class<?>>()
+                return matchesAny( new Predicate<Class<?>>()
                 {
                     @Override
-                    public boolean satisfiedBy( Class<?> item )
+                    public boolean test( Class<?> item )
                     {
                         return item.equals( type );
                     }
@@ -640,18 +640,18 @@ public final class Classes
     }
 
     @SuppressWarnings( "raw" )
-    public static Specification<ModelDescriptor> assignableTypeSpecification( final Class type )
+    public static Predicate<ModelDescriptor> assignableTypeSpecification( final Class type )
     {
-        return new Specification<ModelDescriptor>()
+        return new Predicate<ModelDescriptor>()
         {
             @Override
-            public boolean satisfiedBy( ModelDescriptor item )
+            public boolean test( ModelDescriptor item )
             {
-                return matchesAny( new Specification<Class<?>>()
+                return matchesAny( new Predicate<Class<?>>()
                 {
                     @Override
                     @SuppressWarnings( "unchecked" )
-                    public boolean satisfiedBy( Class<?> itemType )
+                    public boolean test( Class<?> itemType )
                     {
                         return !type.equals( itemType ) && type.isAssignableFrom( itemType );
                     }
@@ -684,9 +684,9 @@ public final class Classes
         return new Function<Type, String>()
         {
             @Override
-            public String map( Type type )
+            public String apply( Type type )
             {
-                return RAW_CLASS.map( type ).getName();
+                return RAW_CLASS.apply( type ).getName();
             }
         };
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/util/Constructors.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/util/Constructors.java b/core/api/src/main/java/org/qi4j/api/util/Constructors.java
index c9a50d6..6e7f0ce 100644
--- a/core/api/src/main/java/org/qi4j/api/util/Constructors.java
+++ b/core/api/src/main/java/org/qi4j/api/util/Constructors.java
@@ -2,7 +2,7 @@ package org.qi4j.api.util;
 
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Type;
-import org.qi4j.functional.Function;
+import java.util.function.Function;
 
 import static org.qi4j.functional.Iterables.iterable;
 
@@ -14,7 +14,7 @@ public final class Constructors
     public static final Function<Type, Iterable<Constructor<?>>> CONSTRUCTORS_OF = Classes.forClassHierarchy( new Function<Class<?>, Iterable<Constructor<?>>>()
     {
         @Override
-        public Iterable<Constructor<?>> map( Class<?> type )
+        public Iterable<Constructor<?>> apply( Class<?> type )
         {
             return iterable( type.getDeclaredConstructors() );
         }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/util/Fields.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/util/Fields.java b/core/api/src/main/java/org/qi4j/api/util/Fields.java
index ea8d6e2..c5c65e3 100644
--- a/core/api/src/main/java/org/qi4j/api/util/Fields.java
+++ b/core/api/src/main/java/org/qi4j/api/util/Fields.java
@@ -2,8 +2,8 @@ package org.qi4j.api.util;
 
 import java.lang.reflect.Field;
 import java.lang.reflect.Type;
-import org.qi4j.functional.Function;
-import org.qi4j.functional.Function2;
+import java.util.function.BiFunction;
+import java.util.function.Function;
 import org.qi4j.functional.Iterables;
 
 import static org.qi4j.functional.Iterables.iterable;
@@ -13,19 +13,19 @@ import static org.qi4j.functional.Iterables.iterable;
  */
 public final class Fields
 {
-    public static final Function2<Class<?>, String, Field> FIELD_NAMED = new Function2<Class<?>, String, Field>()
+    public static final BiFunction<Class<?>, String, Field> FIELD_NAMED = new BiFunction<Class<?>, String, Field>()
     {
         @Override
-        public Field map( Class<?> aClass, String name )
+        public Field apply( Class<?> aClass, String name )
         {
-            return Iterables.first( Iterables.filter( Classes.memberNamed( name ), FIELDS_OF.map( aClass ) ) );
+            return Iterables.first( Iterables.filter( Classes.memberNamed( name ), FIELDS_OF.apply( aClass ) ) );
         }
     };
 
     public static final Function<Type, Iterable<Field>> FIELDS_OF = Classes.forClassHierarchy( new Function<Class<?>, Iterable<Field>>()
     {
         @Override
-        public Iterable<Field> map( Class<?> type )
+        public Iterable<Field> apply( Class<?> type )
         {
             return iterable( type.getDeclaredFields() );
         }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/util/Methods.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/util/Methods.java b/core/api/src/main/java/org/qi4j/api/util/Methods.java
index d59632f..fecb99c 100644
--- a/core/api/src/main/java/org/qi4j/api/util/Methods.java
+++ b/core/api/src/main/java/org/qi4j/api/util/Methods.java
@@ -2,8 +2,8 @@ package org.qi4j.api.util;
 
 import java.lang.reflect.Method;
 import java.lang.reflect.Type;
-import org.qi4j.functional.Function;
-import org.qi4j.functional.Specification;
+import java.util.function.Function;
+import java.util.function.Predicate;
 
 import static org.qi4j.functional.Iterables.iterable;
 
@@ -12,21 +12,21 @@ import static org.qi4j.functional.Iterables.iterable;
  */
 public class Methods
 {
-    public static final Specification<Type> HAS_METHODS = new Specification<Type>()
+    public static final Predicate<Type> HAS_METHODS = new Predicate<Type>()
     {
         @Override
-        public boolean satisfiedBy( Type item )
+        public boolean test( Type item )
         {
-            return Classes.RAW_CLASS.map( item ).getDeclaredMethods().length > 0;
+            return Classes.RAW_CLASS.apply( item ).getDeclaredMethods().length > 0;
         }
     };
 
     public static final Function<Type, Iterable<Method>> METHODS_OF = Classes.forTypes( new Function<Type, Iterable<Method>>()
     {
         @Override
-        public Iterable<Method> map( Type type )
+        public Iterable<Method> apply( Type type )
         {
-            return iterable( Classes.RAW_CLASS.map( type ).getDeclaredMethods() );
+            return iterable( Classes.RAW_CLASS.apply( type ).getDeclaredMethods() );
         }
     } );
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/value/ValueBuilderFactory.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/value/ValueBuilderFactory.java b/core/api/src/main/java/org/qi4j/api/value/ValueBuilderFactory.java
index 57c4e29..b1d0e10 100644
--- a/core/api/src/main/java/org/qi4j/api/value/ValueBuilderFactory.java
+++ b/core/api/src/main/java/org/qi4j/api/value/ValueBuilderFactory.java
@@ -14,11 +14,11 @@
 package org.qi4j.api.value;
 
 import java.util.Map;
+import java.util.function.Function;
 import org.qi4j.api.association.AssociationDescriptor;
 import org.qi4j.api.common.ConstructionException;
 import org.qi4j.api.entity.EntityReference;
 import org.qi4j.api.property.PropertyDescriptor;
-import org.qi4j.functional.Function;
 
 /**
  * Factory for Values and ValueBuilders.

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/value/ValueDeserializer.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/value/ValueDeserializer.java b/core/api/src/main/java/org/qi4j/api/value/ValueDeserializer.java
index 175b176..48e1203 100644
--- a/core/api/src/main/java/org/qi4j/api/value/ValueDeserializer.java
+++ b/core/api/src/main/java/org/qi4j/api/value/ValueDeserializer.java
@@ -16,9 +16,9 @@
 package org.qi4j.api.value;
 
 import java.io.InputStream;
+import java.util.function.BiFunction;
+import java.util.function.Function;
 import org.qi4j.api.type.ValueType;
-import org.qi4j.functional.Function;
-import org.qi4j.functional.Function2;
 
 /**
  * Use a ValueDeserializer to create new values instances from serialized state.
@@ -100,7 +100,7 @@ public interface ValueDeserializer
      * @param <T> the parametrized function return type
      * @return a deserialization function
      */
-    <T> Function2<ValueType, String, T> deserialize();
+    <T> BiFunction<ValueType, String, T> deserialize();
 
     /**
      * Deserialize a value from a state.

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/value/ValueSerializer.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/value/ValueSerializer.java b/core/api/src/main/java/org/qi4j/api/value/ValueSerializer.java
index 13a8831..06e8599 100644
--- a/core/api/src/main/java/org/qi4j/api/value/ValueSerializer.java
+++ b/core/api/src/main/java/org/qi4j/api/value/ValueSerializer.java
@@ -18,8 +18,8 @@ package org.qi4j.api.value;
 import java.io.OutputStream;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.function.Function;
 import org.qi4j.api.composite.AmbiguousTypeException;
-import org.qi4j.functional.Function;
 
 /**
  * Use a ValueSerializer to serialize values state.

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/test/java/org/qi4j/api/OperatorsTest.java
----------------------------------------------------------------------
diff --git a/core/api/src/test/java/org/qi4j/api/OperatorsTest.java b/core/api/src/test/java/org/qi4j/api/OperatorsTest.java
index 1ffaa92..a015ea7 100644
--- a/core/api/src/test/java/org/qi4j/api/OperatorsTest.java
+++ b/core/api/src/test/java/org/qi4j/api/OperatorsTest.java
@@ -1,5 +1,6 @@
 package org.qi4j.api;
 
+import java.util.function.Predicate;
 import org.junit.Assert;
 import org.junit.Test;
 import org.qi4j.api.activation.ActivationException;
@@ -16,7 +17,6 @@ import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ModuleAssembly;
 import org.qi4j.bootstrap.SingletonAssembler;
 import org.qi4j.functional.Iterables;
-import org.qi4j.functional.Specification;
 import org.qi4j.test.EntityTestAssembler;
 
 /**
@@ -59,17 +59,17 @@ public class OperatorsTest
             QueryBuilder<TestEntity> builder = assembler.module().newQueryBuilder( TestEntity.class );
 
             {
-                Specification<Composite> where = QueryExpressions.eq( QueryExpressions.templateFor( TestEntity.class )
+                Predicate<Composite> where = QueryExpressions.eq( QueryExpressions.templateFor( TestEntity.class )
                                                                           .foo(), "Bar" );
-                Assert.assertTrue( where.satisfiedBy( testEntity ) );
+                Assert.assertTrue( where.test( testEntity ) );
                 System.out.println( where );
             }
             {
-                Specification<Composite> where = QueryExpressions.eq( QueryExpressions.templateFor( TestEntity.class )
+                Predicate<Composite> where = QueryExpressions.eq( QueryExpressions.templateFor( TestEntity.class )
                                                                           .value()
                                                                           .get()
                                                                           .bar(), "Xyz" );
-                Assert.assertTrue( where.satisfiedBy( testEntity ) );
+                Assert.assertTrue( where.test( testEntity ) );
                 System.out.println( where );
 
                 Assert.assertTrue( builder.where( where ).newQuery( entities ).find().equals( testEntity ) );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/test/java/org/qi4j/api/common/QualifiedNameTest.java
----------------------------------------------------------------------
diff --git a/core/api/src/test/java/org/qi4j/api/common/QualifiedNameTest.java b/core/api/src/test/java/org/qi4j/api/common/QualifiedNameTest.java
index c9c0583..5c110d0 100644
--- a/core/api/src/test/java/org/qi4j/api/common/QualifiedNameTest.java
+++ b/core/api/src/test/java/org/qi4j/api/common/QualifiedNameTest.java
@@ -11,14 +11,14 @@ public class QualifiedNameTest
     public void testQualifiedNameWithDollar()
     {
         assertEquals( "Name containing dollar is modified", "Test-Test",
-                      new QualifiedName( TypeName.nameOf( "Test$Test" ), "satisfiedBy" ).type() );
+                      new QualifiedName( TypeName.nameOf( "Test$Test" ), "test" ).type() );
     }
 
     @Test
     public void testQualifiedNameFromQNWithDollar()
     {
         assertEquals( "Name containing dollar is cleaned up", "Test-Test",
-                      QualifiedName.fromFQN( "Test$Test:satisfiedBy" ).type() );
+                      QualifiedName.fromFQN( "Test$Test:test" ).type() );
     }
 
     @Test( expected = NullArgumentException.class )
@@ -30,7 +30,7 @@ public class QualifiedNameTest
     @Test( expected = NullArgumentException.class )
     public void nonNullArguments2()
     {
-        new QualifiedName( null, "satisfiedBy" );
+        new QualifiedName( null, "test" );
     }
 
     @Test( expected = NullArgumentException.class )
@@ -54,7 +54,7 @@ public class QualifiedNameTest
     @Test( expected = NullArgumentException.class )
     public void nonNullArguments6()
     {
-        QualifiedName.fromClass( null, "satisfiedBy" );
+        QualifiedName.fromClass( null, "test" );
     }
 
     @Test( expected = NullArgumentException.class )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/test/java/org/qi4j/api/specification/IntegerRangeSpecificationTest.java
----------------------------------------------------------------------
diff --git a/core/api/src/test/java/org/qi4j/api/specification/IntegerRangeSpecificationTest.java b/core/api/src/test/java/org/qi4j/api/specification/IntegerRangeSpecificationTest.java
new file mode 100644
index 0000000..52ee670
--- /dev/null
+++ b/core/api/src/test/java/org/qi4j/api/specification/IntegerRangeSpecificationTest.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2012, Niclas Hedhman. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ *
+ *     You may obtain a copy of the License at
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.qi4j.api.specification;
+
+import java.util.function.Predicate;
+import org.junit.Test;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+// This test exist primarily for the documentation. Don't remove.
+public class IntegerRangeSpecificationTest
+{
+    @Test
+    public void test1()
+    {
+        Predicate<Integer> spec = new IntegerRangeSpecification( 10, 12 );
+        assertTrue( spec.test( 10 ) );
+        assertTrue( spec.test( 11 ) );
+        assertTrue( spec.test( 12 ) );
+        assertFalse( spec.test( 9 ) );
+        assertFalse( spec.test( 13 ) );
+    }
+
+    // START SNIPPET: specification
+    public static class IntegerRangeSpecification
+        implements Predicate<Integer>
+    {
+
+        private int lower;
+        private int higher;
+
+        public IntegerRangeSpecification( int lower, int higher )
+        {
+            this.lower = lower;
+            this.higher = higher;
+        }
+
+        @Override
+        public boolean test( Integer item )
+        {
+            return item >= lower && item <= higher;
+        }
+    }
+    // END SNIPPET: specification
+}

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/test/java/org/qi4j/api/specification/SpecificationsTest.java
----------------------------------------------------------------------
diff --git a/core/api/src/test/java/org/qi4j/api/specification/SpecificationsTest.java b/core/api/src/test/java/org/qi4j/api/specification/SpecificationsTest.java
new file mode 100644
index 0000000..ca295bf
--- /dev/null
+++ b/core/api/src/test/java/org/qi4j/api/specification/SpecificationsTest.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2010, Rickard Öberg. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.qi4j.api.specification;
+
+import java.util.function.Function;
+import java.util.function.Predicate;
+import org.junit.Assert;
+import org.junit.Test;
+import org.qi4j.functional.Specifications;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+
+/**
+ * JAVADOC
+ */
+public class SpecificationsTest
+{
+    @Test
+    public void testTRUE()
+    {
+        Assert.assertThat( Specifications.<Object>TRUE().test( new Object() ), equalTo( true ) );
+    }
+
+    @Test
+    public void testNot()
+    {
+        Assert.assertThat( Specifications.not( Specifications.<Object>TRUE() )
+                               .test( new Object() ), equalTo( false ) );
+    }
+
+    @Test
+    public void testAnd()
+    {
+        Predicate<Object> trueSpec = Specifications.<Object>TRUE();
+        Predicate<Object> falseSpec = Specifications.not( Specifications.<Object>TRUE() );
+
+        Assert.assertThat( Specifications.and( falseSpec, falseSpec ).test( new Object() ), equalTo( false ) );
+        Assert.assertThat( Specifications.and( trueSpec, falseSpec ).test( new Object() ), equalTo( false ) );
+        Assert.assertThat( Specifications.and( falseSpec, trueSpec ).test( new Object() ), equalTo( false ) );
+        Assert.assertThat( Specifications.and( trueSpec, trueSpec ).test( new Object() ), equalTo( true ) );
+    }
+
+    @Test
+    public void testOr()
+    {
+        Predicate<Object> trueSpec = Specifications.<Object>TRUE();
+        Predicate<Object> falseSpec = Specifications.not( Specifications.<Object>TRUE() );
+
+        Assert.assertThat( Specifications.or( falseSpec, falseSpec ).test( new Object() ), equalTo( false ) );
+        Assert.assertThat( Specifications.or( trueSpec, falseSpec ).test( new Object() ), equalTo( true ) );
+        Assert.assertThat( Specifications.or( falseSpec, trueSpec ).test( new Object() ), equalTo( true ) );
+        Assert.assertThat( Specifications.or( trueSpec, trueSpec ).test( new Object() ), equalTo( true ) );
+    }
+
+    @Test
+    public void testIn()
+    {
+        Assert.assertThat( Specifications.in( "1", "2", "3" ).test( "2" ), equalTo( true ) );
+        Assert.assertThat( Specifications.in( "1", "2", "3" ).test( "4" ), equalTo( false ) );
+    }
+
+    @Test
+    public void testTranslate()
+    {
+        Function<Object, String> stringifier = new Function<Object, String>()
+        {
+            @Override
+            public String apply( Object s )
+            {
+                return s.toString();
+            }
+        };
+
+        Assert.assertTrue( Specifications.translate( stringifier, Specifications.in( "3" ) ).test( 3L ) );
+    }
+}

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/test/java/org/qi4j/api/util/ClassesTest.java
----------------------------------------------------------------------
diff --git a/core/api/src/test/java/org/qi4j/api/util/ClassesTest.java b/core/api/src/test/java/org/qi4j/api/util/ClassesTest.java
index 85be327..3478f2d 100644
--- a/core/api/src/test/java/org/qi4j/api/util/ClassesTest.java
+++ b/core/api/src/test/java/org/qi4j/api/util/ClassesTest.java
@@ -20,9 +20,9 @@ import java.lang.reflect.Type;
 import java.lang.reflect.TypeVariable;
 import java.util.HashSet;
 import java.util.Set;
+import java.util.function.Predicate;
 import org.junit.Test;
 import org.qi4j.functional.Iterables;
-import org.qi4j.functional.Specification;
 import org.qi4j.functional.Specifications;
 
 import static org.hamcrest.CoreMatchers.equalTo;
@@ -61,7 +61,7 @@ public class ClassesTest
     {
         Iterable<Type> types = Iterables.filter( Methods.HAS_METHODS, interfacesOf( C.class ) );
         assertThat( "one interface returned", count( types ), equalTo( 1L ) );
-        assertThat( "correct interface returned", Iterables.matchesAny( (Specification) Specifications.in( B.class ), Iterables
+        assertThat( "correct interface returned", Iterables.matchesAny( (Predicate) Specifications.in( B.class ), Iterables
             .<Class<?>>cast( types ) ), is( true ) );
     }
 
@@ -83,7 +83,7 @@ public class ClassesTest
     {
         Type returnType = Generics.class.getMethod( "wildcard" ).getGenericReturnType();
         Type wildcardType = ( (ParameterizedType) returnType ).getActualTypeArguments()[ 0];
-        assertThat( "Return type is A", Classes.RAW_CLASS.map( wildcardType ), equalTo( (Class) A.class ) );
+        assertThat( "Return type is A", Classes.RAW_CLASS.apply( wildcardType ), equalTo( (Class) A.class ) );
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/test/java/org/qi4j/api/value/DocumentationSupport.java
----------------------------------------------------------------------
diff --git a/core/api/src/test/java/org/qi4j/api/value/DocumentationSupport.java b/core/api/src/test/java/org/qi4j/api/value/DocumentationSupport.java
index 32595b2..14b7b05 100644
--- a/core/api/src/test/java/org/qi4j/api/value/DocumentationSupport.java
+++ b/core/api/src/test/java/org/qi4j/api/value/DocumentationSupport.java
@@ -27,6 +27,7 @@ import java.io.Writer;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
+import java.util.function.Function;
 import org.junit.Before;
 import org.junit.Test;
 import org.qi4j.api.injection.scope.Service;
@@ -41,7 +42,6 @@ import org.qi4j.bootstrap.Assembler;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.Energy4Java;
 import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.functional.Function;
 import org.qi4j.io.Inputs;
 import org.qi4j.io.Outputs;
 import org.qi4j.io.Transforms;
@@ -252,7 +252,7 @@ public class DocumentationSupport
                                     Function<Application, Module> valuesModuleFinder = new Function<Application, Module>()
                                     {
                                         @Override
-                                        public Module map( Application app )
+                                        public Module apply( Application app )
                                         {
                                             return app.findModule( "SINGLE-Layer", "VALUES-Module" );
                                         }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/bootstrap/src/main/java/org/qi4j/bootstrap/ApplicationAssembly.java
----------------------------------------------------------------------
diff --git a/core/bootstrap/src/main/java/org/qi4j/bootstrap/ApplicationAssembly.java b/core/bootstrap/src/main/java/org/qi4j/bootstrap/ApplicationAssembly.java
index b14d554..ca5be95 100644
--- a/core/bootstrap/src/main/java/org/qi4j/bootstrap/ApplicationAssembly.java
+++ b/core/bootstrap/src/main/java/org/qi4j/bootstrap/ApplicationAssembly.java
@@ -82,7 +82,7 @@ public interface ApplicationAssembly
 
     /**
      * Set the application mode. This will be set to "production" by default. You can
-     * set the system property "mode" to either "development", "satisfiedBy" or "production"
+     * set the system property "mode" to either "test", "development", "staging" or "production"
      * to explicitly set the mode. If that is not an option, then call this method
      * during assembly to set the mode. The mode may then be queried by assemblers,
      * and they may assemble the application differentlly depending on this setting.

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/bootstrap/src/main/java/org/qi4j/bootstrap/AssemblySpecifications.java
----------------------------------------------------------------------
diff --git a/core/bootstrap/src/main/java/org/qi4j/bootstrap/AssemblySpecifications.java b/core/bootstrap/src/main/java/org/qi4j/bootstrap/AssemblySpecifications.java
index a8294d8..cd44933 100644
--- a/core/bootstrap/src/main/java/org/qi4j/bootstrap/AssemblySpecifications.java
+++ b/core/bootstrap/src/main/java/org/qi4j/bootstrap/AssemblySpecifications.java
@@ -1,7 +1,7 @@
 package org.qi4j.bootstrap;
 
+import java.util.function.Predicate;
 import org.qi4j.api.type.HasTypes;
-import org.qi4j.functional.Specification;
 import org.qi4j.functional.Specifications;
 
 /**
@@ -9,17 +9,17 @@ import org.qi4j.functional.Specifications;
  */
 public class AssemblySpecifications
 {
-    public static Specification<HasTypes> types( final Class... types )
+    public static Predicate<HasTypes> types( final Class... types )
     {
-        return new Specification<HasTypes>()
+        return new Predicate<HasTypes>()
         {
             @Override
-            public boolean satisfiedBy( HasTypes item )
+            public boolean test( HasTypes item )
             {
 
                 for( Class<?> type : item.types() )
                 {
-                    if( Specifications.in( types ).satisfiedBy( type ) )
+                    if( Specifications.in( types ).test( type ) )
                     {
                         return true;
                     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/bootstrap/src/main/java/org/qi4j/bootstrap/ClassScanner.java
----------------------------------------------------------------------
diff --git a/core/bootstrap/src/main/java/org/qi4j/bootstrap/ClassScanner.java b/core/bootstrap/src/main/java/org/qi4j/bootstrap/ClassScanner.java
index 70c2946..2895f20 100644
--- a/core/bootstrap/src/main/java/org/qi4j/bootstrap/ClassScanner.java
+++ b/core/bootstrap/src/main/java/org/qi4j/bootstrap/ClassScanner.java
@@ -23,12 +23,12 @@ import java.lang.reflect.Modifier;
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.security.CodeSource;
+import java.util.function.Function;
+import java.util.function.Predicate;
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
 import java.util.regex.Pattern;
-import org.qi4j.functional.Function;
 import org.qi4j.functional.Iterables;
-import org.qi4j.functional.Specification;
 
 import static org.qi4j.functional.Iterables.filter;
 import static org.qi4j.functional.Iterables.flatten;
@@ -90,7 +90,7 @@ public class ClassScanner
                                                      map( new Function<JarEntry, Class<?>>()
                                                      {
                                                          @Override
-                                                         public Class map( JarEntry jarEntry )
+                                                         public Class apply( JarEntry jarEntry )
                                                          {
                                                              String name = jarEntry.getName();
                                                              name = name.substring( 0, name.length() - 6 );
@@ -105,10 +105,10 @@ public class ClassScanner
                                                              }
                                                          }
                                                      }
-                                                         , filter( new Specification<JarEntry>()
+                                                         , filter( new Predicate<JarEntry>()
                                                      {
                                                          @Override
-                                                         public boolean satisfiedBy( JarEntry jarEntry )
+                                                         public boolean test( JarEntry jarEntry )
                                                          {
                                                              return jarEntry.getName()
                                                                         .startsWith( packageName ) && jarEntry.getName()
@@ -129,10 +129,10 @@ public class ClassScanner
         else
         {
             final File path = new File( file, seedClass.getPackage().getName().replace( '.', File.separatorChar ) );
-            Iterable<File> files = findFiles( path, new Specification<File>()
+            Iterable<File> files = findFiles( path, new Predicate<File>()
             {
                 @Override
-                public boolean satisfiedBy( File file )
+                public boolean test( File file )
                 {
                     return file.getName().endsWith( ".class" );
                 }
@@ -142,7 +142,7 @@ public class ClassScanner
                            map( new Function<File, Class<?>>()
                            {
                                @Override
-                               public Class<?> map( File f )
+                               public Class<?> apply( File f )
                                {
                                    String fileName = f.getAbsolutePath().substring( file.toString().length() + 1 );
                                    fileName = fileName.replace( File.separatorChar, '.' )
@@ -170,34 +170,34 @@ public class ClassScanner
      *
      * @return regex class name specification
      */
-    public static Specification<Class<?>> matches( String regex )
+    public static Predicate<Class<?>> matches( String regex )
     {
         final Pattern pattern = Pattern.compile( regex );
 
-        return new Specification<Class<?>>()
+        return new Predicate<Class<?>>()
         {
             @Override
-            public boolean satisfiedBy( Class<?> aClass )
+            public boolean test( Class<?> aClass )
             {
                 return pattern.matcher( aClass.getName() ).matches();
             }
         };
     }
 
-    private static Iterable<File> findFiles( File directory, final Specification<File> filter )
+    private static Iterable<File> findFiles( File directory, final Predicate<File> filter )
     {
         return flatten( filter( filter, iterable( directory.listFiles() ) ),
                         flattenIterables( map( new Function<File, Iterable<File>>()
                         {
                             @Override
-                            public Iterable<File> map( File file )
+                            public Iterable<File> apply( File file )
                             {
                                 return findFiles( file, filter );
                             }
-                        }, filter( new Specification<File>()
+                        }, filter( new Predicate<File>()
                         {
                             @Override
-                            public boolean satisfiedBy( File file )
+                            public boolean test( File file )
                             {
                                 return file.isDirectory();
                             }
@@ -205,10 +205,10 @@ public class ClassScanner
     }
 
     private static class ValidClass
-        implements Specification<Class<?>>
+        implements Predicate<Class<?>>
     {
         @Override
-        public boolean satisfiedBy( Class<?> item )
+        public boolean test( Class<?> item )
         {
             return ( item.isInterface() || !Modifier.isAbstract( item.getModifiers() ) ) && ( !item.isEnum() && !item.isAnonymousClass() );
         }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/bootstrap/src/main/java/org/qi4j/bootstrap/LayerAssembly.java
----------------------------------------------------------------------
diff --git a/core/bootstrap/src/main/java/org/qi4j/bootstrap/LayerAssembly.java b/core/bootstrap/src/main/java/org/qi4j/bootstrap/LayerAssembly.java
index 5880b3e..7b52467 100644
--- a/core/bootstrap/src/main/java/org/qi4j/bootstrap/LayerAssembly.java
+++ b/core/bootstrap/src/main/java/org/qi4j/bootstrap/LayerAssembly.java
@@ -19,9 +19,9 @@
 
 package org.qi4j.bootstrap;
 
+import java.util.function.Predicate;
 import org.qi4j.api.activation.Activator;
 import org.qi4j.api.structure.Layer;
-import org.qi4j.functional.Specification;
 
 /**
  * Fluid API for declaring a layer in an application. This is obtained by calling {@link ApplicationAssembly#layer(String)}.
@@ -69,7 +69,7 @@ public interface LayerAssembly
      *
      * @return An EntityDeclaration for the specified EntityComposite types.
      */
-    EntityDeclaration entities( Specification<? super EntityAssembly> specification );
+    EntityDeclaration entities( Predicate<? super EntityAssembly> specification );
 
     /**
      * Given a Specification for ServiceAssembly's, returns a ServiceDeclaration that can
@@ -79,7 +79,7 @@ public interface LayerAssembly
      *
      * @return An ServiceDeclaration for the specified ServiceComposite types.
      */
-    ServiceDeclaration services( Specification<? super ServiceAssembly> specification );
+    ServiceDeclaration services( Predicate<? super ServiceAssembly> specification );
 
     /**
      * Given a Specification for TransientAssembly's, returns a TransientDeclaration that can
@@ -89,7 +89,7 @@ public interface LayerAssembly
      *
      * @return An TransientDeclaration for the specified TransientComposite types.
      */
-    TransientDeclaration transients( Specification<? super TransientAssembly> specification );
+    TransientDeclaration transients( Predicate<? super TransientAssembly> specification );
 
     /**
      * Given a Specification for ValueAssembly's, returns a ValueDeclaration that can
@@ -99,7 +99,7 @@ public interface LayerAssembly
      *
      * @return An ValueDeclaration for the specified ValueComposite types.
      */
-    ValueDeclaration values( Specification<? super ValueAssembly> specification );
+    ValueDeclaration values( Predicate<? super ValueAssembly> specification );
 
     /**
      * Given a Specification for ObjectAssembly's, returns a ObjectDeclaration that can
@@ -109,7 +109,7 @@ public interface LayerAssembly
      *
      * @return An ObjectDeclaration for the specified Object types.
      */
-    ObjectDeclaration objects( Specification<? super ObjectAssembly> specification );
+    ObjectDeclaration objects( Predicate<? super ObjectAssembly> specification );
 
     /**
      * Given a Specification for ImportedServiceAssembly's, returns a ImportedServiceDeclaration that can
@@ -119,5 +119,5 @@ public interface LayerAssembly
      *
      * @return An ImportedServiceDeclaration for the specified Imported Service types.
      */
-    ImportedServiceDeclaration importedServices( Specification<? super ImportedServiceAssembly> specification );
+    ImportedServiceDeclaration importedServices( Predicate<? super ImportedServiceAssembly> specification );
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/bootstrap/src/main/java/org/qi4j/bootstrap/ModuleAssembly.java
----------------------------------------------------------------------
diff --git a/core/bootstrap/src/main/java/org/qi4j/bootstrap/ModuleAssembly.java b/core/bootstrap/src/main/java/org/qi4j/bootstrap/ModuleAssembly.java
index 805b232..39cce32 100644
--- a/core/bootstrap/src/main/java/org/qi4j/bootstrap/ModuleAssembly.java
+++ b/core/bootstrap/src/main/java/org/qi4j/bootstrap/ModuleAssembly.java
@@ -19,9 +19,9 @@
 
 package org.qi4j.bootstrap;
 
+import java.util.function.Predicate;
 import org.qi4j.api.activation.Activator;
 import org.qi4j.api.structure.Module;
-import org.qi4j.functional.Specification;
 
 /**
  * The ModuleAssembly is used to register any information about * what the module should contain, such as composites,
@@ -95,7 +95,7 @@ public interface ModuleAssembly
      *
      * @return An TransientDeclaration for the specified TransientComposite types.
      */
-    TransientDeclaration transients( Specification<? super TransientAssembly> specification );
+    TransientDeclaration transients( Predicate<? super TransientAssembly> specification );
 
     /**
      * Declare a list of ValueComposites for this Module. Use the ValueDeclaration that is returned to
@@ -115,7 +115,7 @@ public interface ModuleAssembly
      *
      * @return An ValueDeclaration for the specified ValueComposite types.
      */
-    ValueDeclaration values( Specification<? super ValueAssembly> specification );
+    ValueDeclaration values( Predicate<? super ValueAssembly> specification );
 
     /**
      * Declare a list of EntityComposites for this Module. Use the EntityDeclaration that is returned to
@@ -135,7 +135,7 @@ public interface ModuleAssembly
      *
      * @return An EntityDeclaration for the specified EntityComposite types.
      */
-    EntityDeclaration entities( Specification<? super EntityAssembly> specification );
+    EntityDeclaration entities( Predicate<? super EntityAssembly> specification );
 
     /**
      * Declare a list of object classes for this Module. Use the ObjectDeclaration that is returned to
@@ -156,7 +156,7 @@ public interface ModuleAssembly
      *
      * @return An ObjectDeclaration for the specified Object types.
      */
-    ObjectDeclaration objects( Specification<? super ObjectAssembly> specification );
+    ObjectDeclaration objects( Predicate<? super ObjectAssembly> specification );
 
     /**
      * Create a list of ServiceComposites for this Module. Use the ServiceDeclaration that is returned to
@@ -187,7 +187,7 @@ public interface ModuleAssembly
      *
      * @return An ServiceDeclaration for the specified ServiceComposite types.
      */
-    ServiceDeclaration services( Specification<? super ServiceAssembly> specification );
+    ServiceDeclaration services( Predicate<? super ServiceAssembly> specification );
 
     /**
      * Declare a list of imported services for this Module. Use the ImportedServiceDeclaration that is returned to
@@ -207,7 +207,7 @@ public interface ModuleAssembly
      *
      * @return An ImportedServiceDeclaration for the specified Imported Service types.
      */
-    ImportedServiceDeclaration importedServices( Specification<? super ImportedServiceAssembly> specification );
+    ImportedServiceDeclaration importedServices( Predicate<? super ImportedServiceAssembly> specification );
 
     <T> MixinDeclaration<T> forMixin( Class<T> mixinType );
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/bootstrap/src/test/java/org/qi4j/bootstrap/DocumentationSupport.java
----------------------------------------------------------------------
diff --git a/core/bootstrap/src/test/java/org/qi4j/bootstrap/DocumentationSupport.java b/core/bootstrap/src/test/java/org/qi4j/bootstrap/DocumentationSupport.java
index 547cf87..4ec7f6a 100644
--- a/core/bootstrap/src/test/java/org/qi4j/bootstrap/DocumentationSupport.java
+++ b/core/bootstrap/src/test/java/org/qi4j/bootstrap/DocumentationSupport.java
@@ -1,5 +1,6 @@
 package org.qi4j.bootstrap;
 
+import java.util.function.Predicate;
 import org.qi4j.api.activation.ActivationException;
 import org.qi4j.api.common.Visibility;
 import org.qi4j.api.property.Property;
@@ -9,15 +10,14 @@ import org.qi4j.api.structure.Application;
 import org.qi4j.api.structure.ApplicationDescriptor;
 import org.qi4j.api.structure.Module;
 import org.qi4j.functional.Iterables;
-import org.qi4j.functional.Specification;
 
 public class DocumentationSupport
 {
 
-    public static Specification<ObjectAssembly> hasMyTypeSpecification = new Specification<ObjectAssembly>()
+    public static Predicate<ObjectAssembly> hasMyTypeSpecification = new Predicate<ObjectAssembly>()
     {
 
-        public boolean satisfiedBy( ObjectAssembly item )
+        public boolean test( ObjectAssembly item )
         {
             return Iterables.toList( item.types() ).contains( String.class );
         }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/functional/src/main/java/org/qi4j/functional/ForEach.java
----------------------------------------------------------------------
diff --git a/core/functional/src/main/java/org/qi4j/functional/ForEach.java b/core/functional/src/main/java/org/qi4j/functional/ForEach.java
index c2bbe3e..a87dcb9 100644
--- a/core/functional/src/main/java/org/qi4j/functional/ForEach.java
+++ b/core/functional/src/main/java/org/qi4j/functional/ForEach.java
@@ -14,6 +14,8 @@
 package org.qi4j.functional;
 
 import java.util.Iterator;
+import java.util.function.Function;
+import java.util.function.Predicate;
 
 /**
  * When using Iterables with map() and filter() the code often reads "in reverse", with the first item last in the code.
@@ -46,7 +48,7 @@ public final class ForEach<T>
         return iterable.iterator();
     }
 
-    public ForEach<T> filter( Specification<? super T> specification )
+    public ForEach<T> filter( Predicate<? super T> specification )
     {
         return new ForEach<>( Iterables.filter( specification, iterable ) );
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/functional/src/main/java/org/qi4j/functional/Function.java
----------------------------------------------------------------------
diff --git a/core/functional/src/main/java/org/qi4j/functional/Function.java b/core/functional/src/main/java/org/qi4j/functional/Function.java
deleted file mode 100644
index 3edd3f1..0000000
--- a/core/functional/src/main/java/org/qi4j/functional/Function.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2010, Rickard Öberg. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.qi4j.functional;
-
-/**
- * Generic function interface to map from one type to another.
- *
- * This can be used with the Iterables methods to transform lists of objects.
- *
- * @param <From>
- * @param <To>
- */
-public interface Function<From, To>
-{
-    /**
-     * Map a single item from one type to another
-     *
-     * @param from the input item
-     *
-     * @return the mapped item
-     */
-    To map( From from );
-}

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/functional/src/main/java/org/qi4j/functional/Function2.java
----------------------------------------------------------------------
diff --git a/core/functional/src/main/java/org/qi4j/functional/Function2.java b/core/functional/src/main/java/org/qi4j/functional/Function2.java
deleted file mode 100644
index 7803965..0000000
--- a/core/functional/src/main/java/org/qi4j/functional/Function2.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2010, Rickard Öberg. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.qi4j.functional;
-
-/**
- * Generic function interface to map from two parameters to a third.
- *
- * This can be used with the Iterables methods to transform lists of objects.
- */
-public interface Function2<First, Second, To>
-{
-    /**
-     * Map a single item from one type to another
-     *
-     * @param first
-     * @param second
-     *
-     * @return the mapped item
-     */
-    To map( First first, Second second );
-}

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/functional/src/main/java/org/qi4j/functional/Functions.java
----------------------------------------------------------------------
diff --git a/core/functional/src/main/java/org/qi4j/functional/Functions.java b/core/functional/src/main/java/org/qi4j/functional/Functions.java
deleted file mode 100644
index 0b50b35..0000000
--- a/core/functional/src/main/java/org/qi4j/functional/Functions.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * Copyright (c) 2010, Rickard Öberg. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.qi4j.functional;
-
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Utility functions. Combine these with methods in Iterables, for example. See FunctionsTest for usages.
- */
-public final class Functions
-{
-    public static <A, B, C> Function2<Function<? super B, C>, Function<A, B>, Function<A, C>> compose()
-    {
-        return new Function2<Function<? super B, C>, Function<A, B>, Function<A, C>>()
-        {
-            @Override
-            public Function<A, C> map( Function<? super B, C> bcFunction, Function<A, B> abFunction )
-            {
-                return compose( bcFunction, abFunction );
-            }
-        };
-    }
-
-    /**
-     * compose(F1(M,T),F2(F,M)) = F1(F2(F)) -&gt; T
-     *
-     * @param outer
-     * @param inner
-     *
-     * @return
-     */
-    public static <FROM, MIDDLE, TO> Function<FROM, TO> compose( final Function<? super MIDDLE, TO> outer,
-                                                                 final Function<FROM, MIDDLE> inner
-    )
-    {
-        return new Function<FROM, TO>()
-        {
-            @Override
-            public TO map( FROM from )
-            {
-                return outer.map( inner.map( from ) );
-            }
-        };
-    }
-
-    public static <TO, FROM extends TO> Function<FROM, TO> identity()
-    {
-        return new Function<FROM, TO>()
-        {
-            @Override
-            public TO map( FROM from )
-            {
-                return from;
-            }
-        };
-    }
-
-    public static <FROM, TO> Function<FROM, TO> fromMap( final Map<FROM, TO> map )
-    {
-        return new Function<FROM, TO>()
-        {
-            @Override
-            public TO map( FROM from )
-            {
-                return map.get( from );
-            }
-        };
-    }
-
-    public static <T> Function<T, T> withDefault( final T defaultValue )
-    {
-        return new Function<T, T>()
-        {
-            @Override
-            public T map( T from )
-            {
-                if( from == null )
-                {
-                    return defaultValue;
-                }
-                else
-                {
-                    return from;
-                }
-            }
-        };
-    }
-
-    public static Function<Number, Long> longSum()
-    {
-        return new Function<Number, Long>()
-        {
-            long sum;
-
-            @Override
-            public Long map( Number number )
-            {
-                sum += number.longValue();
-                return sum;
-            }
-        };
-    }
-
-    public static Function<Number, Integer> intSum()
-    {
-        return new Function<Number, Integer>()
-        {
-            int sum;
-
-            @Override
-            public Integer map( Number number )
-            {
-                sum += number.intValue();
-                return sum;
-            }
-        };
-    }
-
-    /**
-     * Count the number of items in an iterable that matches a given specification.
-     *
-     * Sample usage: last( map( count( in( "X" ) ), iterable( "X","Y","X","X","Y" ) ) )
-     * Returns: 3
-     *
-     * @param specification
-     * @param <T>
-     *
-     * @return
-     */
-    public static <T> Function<T, Integer> count( final Specification<T> specification )
-    {
-        return new Function<T, Integer>()
-        {
-            int count;
-
-            @Override
-            public Integer map( T item )
-            {
-                if( specification.satisfiedBy( item ) )
-                {
-                    count++;
-                }
-
-                return count;
-            }
-        };
-    }
-
-    /**
-     * Find out the index of an item matching a given specification in an iterable.
-     * Returns -1 if it is not found.
-     *
-     * @param specification
-     * @param <T>
-     *
-     * @return
-     */
-    public static <T> Function<T, Integer> indexOf( final Specification<T> specification )
-    {
-        return new Function<T, Integer>()
-        {
-            int index = -1;
-            int current = 0;
-
-            @Override
-            public Integer map( T item )
-            {
-                if( index == -1 && specification.satisfiedBy( item ) )
-                {
-                    index = current;
-                }
-
-                current++;
-
-                return index;
-            }
-        };
-    }
-
-    /**
-     * Find out the index of an item in an iterable.
-     *
-     * @param item
-     * @param iterable
-     * @param <T>
-     *
-     * @return
-     */
-    @SuppressWarnings( "unchecked" )
-    public static <T> int indexOf( T item, Iterable<T> iterable )
-    {
-        return Iterables.first( Iterables.filter( Specifications.not( Specifications.in( -1 ) ),
-                                                  Iterables.map( indexOf( Specifications.in( item ) ), iterable ) ) );
-    }
-
-    /**
-     * Only apply given function on objects that satisfies the given specification.
-     *
-     * @param specification
-     * @param function
-     * @param <T>
-     *
-     * @return
-     */
-    public static <T> Function<T, T> filteredMap( final Specification<T> specification, final Function<T, T> function )
-    {
-        return new Function<T, T>()
-        {
-            @Override
-            public T map( T from )
-            {
-                return specification.satisfiedBy( from ) ? function.map( from ) : from;
-            }
-        };
-    }
-
-    /**
-     * Creates a comparator that takes a function as input. The returned comparator will use the
-     * function once for each item in the list to be sorted by Collections.sort.
-     *
-     * This should be used if the function to generate the sort key from an object is expensive, so
-     * that it is not done many times for each item in a list.
-     *
-     * @param comparableFunction
-     * @param <T>
-     *
-     * @return
-     */
-    @SuppressWarnings( "raw" )
-    public static <T> Comparator<T> comparator( final Function<T, Comparable> comparableFunction )
-    {
-        return new Comparator<T>()
-        {
-            Map<T, Comparable> compareKeys = new HashMap<>();
-
-            @Override
-            @SuppressWarnings( "unchecked" )
-            public int compare( T o1, T o2 )
-            {
-                Comparable key1 = compareKeys.get( o1 );
-                if( key1 == null )
-                {
-                    key1 = comparableFunction.map( o1 );
-                    compareKeys.put( o1, key1 );
-                }
-
-                Comparable key2 = compareKeys.get( o2 );
-                if( key2 == null )
-                {
-                    key2 = comparableFunction.map( o2 );
-                    compareKeys.put( o2, key2 );
-                }
-
-                return key1.compareTo( key2 );
-            }
-        };
-    }
-
-    private Functions()
-    {
-    }
-}

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/functional/src/main/java/org/qi4j/functional/Iterables.java
----------------------------------------------------------------------
diff --git a/core/functional/src/main/java/org/qi4j/functional/Iterables.java b/core/functional/src/main/java/org/qi4j/functional/Iterables.java
index a3daf56..bdedbbd 100644
--- a/core/functional/src/main/java/org/qi4j/functional/Iterables.java
+++ b/core/functional/src/main/java/org/qi4j/functional/Iterables.java
@@ -26,6 +26,8 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.NoSuchElementException;
 import java.util.Set;
+import java.util.function.Function;
+import java.util.function.Predicate;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -72,36 +74,6 @@ public final class Iterables
         return EMPTY;
     }
 
-    public static <T> Iterable<T> constant( final T item )
-    {
-        return new Iterable<T>()
-        {
-            @Override
-            public Iterator<T> iterator()
-            {
-                return new Iterator<T>()
-                {
-                    @Override
-                    public boolean hasNext()
-                    {
-                        return true;
-                    }
-
-                    @Override
-                    public T next()
-                    {
-                        return item;
-                    }
-
-                    @Override
-                    public void remove()
-                    {
-                    }
-                };
-            }
-        };
-    }
-
     public static <T> Iterable<T> limit( final int limitItems, final Iterable<T> iterable )
     {
         return new Iterable<T>()
@@ -207,9 +179,9 @@ public final class Iterables
     }
 
     @SuppressWarnings( "unchecked" )
-    public static <X> Iterable<X> filter( Specification<? /* super X*/> specification, Iterable<X> i )
+    public static <X> Iterable<X> filter( Predicate<? /* super X*/> specification, Iterable<X> i )
     {
-        return new FilterIterable<>( i, (Specification<? super X>) specification );
+        return new FilterIterable<>( i, (Predicate<? super X>) specification );
     }
 
     public static <X> X first( Iterable<X> i )
@@ -290,13 +262,13 @@ public final class Iterables
         return list;
     }
 
-    public static <T> boolean matchesAny( Specification<? super T> specification, Iterable<T> iterable )
+    public static <T> boolean matchesAny( Predicate<? super T> specification, Iterable<T> iterable )
     {
         boolean result = false;
 
         for( T item : iterable )
         {
-            if( ( (Specification<? super T>) specification ).satisfiedBy( item ) )
+            if( specification.test( item ) )
             {
                 result = true;
                 break;
@@ -306,12 +278,12 @@ public final class Iterables
         return result;
     }
 
-    public static <T> boolean matchesAll( Specification<? super T> specification, Iterable<T> iterable )
+    public static <T> boolean matchesAll( Predicate<? super T> specification, Iterable<T> iterable )
     {
         boolean result = true;
         for( T item : iterable )
         {
-            if( !specification.satisfiedBy( item ) )
+            if( !specification.test( item ) )
             {
                 result = false;
             }
@@ -342,7 +314,7 @@ public final class Iterables
                 final Iterable<Iterator<T>> iterators = toList( map( new Function<Iterable<T>, Iterator<T>>()
                 {
                     @Override
-                    public Iterator<T> map( Iterable<T> iterable )
+                    public Iterator<T> apply( Iterable<T> iterable )
                     {
                         return iterable.iterator();
                     }
@@ -441,7 +413,7 @@ public final class Iterables
         {
             @Override
             @SuppressWarnings( "unchecked" )
-            public TO map( FROM from )
+            public TO apply( FROM from )
             {
                 return (TO) from;
             }
@@ -578,7 +550,7 @@ public final class Iterables
         return map( new Function<T, T>()
         {
             @Override
-            public T map( T t )
+            public T apply( T t )
             {
                 if( functions.length == 0 )
                 {
@@ -590,7 +562,7 @@ public final class Iterables
                     for( int i = 0; i < functions.length; i++ )
                     {
                         Function<T, String> function = functions[i];
-                        mapped[i] = function.map( t );
+                        mapped[i] = function.apply( t );
                         debugLogger.info( msgFormat.format( mapped ) );
                     }
                 }
@@ -610,7 +582,7 @@ public final class Iterables
         return toString( iterable, new Function<T, String>()
         {
             @Override
-            public String map( T t )
+            public String apply( T t )
             {
                 return t == null ? "[null]" : t.toString();
             }
@@ -627,7 +599,7 @@ public final class Iterables
             {
                 builder.append( separator );
             }
-            builder.append( toStringFunction.map( item ) );
+            builder.append( toStringFunction.apply( item ) );
             first = false;
         }
         return builder.toString();
@@ -709,7 +681,7 @@ public final class Iterables
             public TO next()
             {
                 FROM from = fromIterator.next();
-                return function.map( from );
+                return function.apply( from );
             }
 
             @Override
@@ -726,9 +698,9 @@ public final class Iterables
     {
         private final Iterable<T> iterable;
 
-        private final Specification<? super T> specification;
+        private final Predicate<? super T> specification;
 
-        private FilterIterable( Iterable<T> iterable, Specification<? super T> specification )
+        private FilterIterable( Iterable<T> iterable, Predicate<? super T> specification )
         {
             this.iterable = iterable;
             this.specification = specification;
@@ -745,13 +717,13 @@ public final class Iterables
         {
             private final Iterator<T> iterator;
 
-            private final Specification<? super T> specification;
+            private final Predicate<? super T> specification;
 
             private T currentValue;
             boolean finished = false;
             boolean nextConsumed = true;
 
-            private FilterIterator( Iterator<T> iterator, Specification<? super T> specification )
+            private FilterIterator( Iterator<T> iterator, Predicate<? super T> specification )
             {
                 this.specification = specification;
                 this.iterator = iterator;
@@ -763,7 +735,7 @@ public final class Iterables
                 while( !found && iterator.hasNext() )
                 {
                     T currentValue = iterator.next();
-                    boolean satisfies = specification.satisfiedBy( currentValue );
+                    boolean satisfies = specification.test( currentValue );
 
                     if( satisfies )
                     {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/functional/src/main/java/org/qi4j/functional/Specification.java
----------------------------------------------------------------------
diff --git a/core/functional/src/main/java/org/qi4j/functional/Specification.java b/core/functional/src/main/java/org/qi4j/functional/Specification.java
deleted file mode 100644
index 93c61a9..0000000
--- a/core/functional/src/main/java/org/qi4j/functional/Specification.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2010, Rickard Öberg. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.qi4j.functional;
-
-/**
- * Generic specification interface.
- *
- * @param <T>
- */
-// START SNIPPET: specification
-public interface Specification<T>
-{
-// END SNIPPET: specification
-
-    /**
-     * Test whether an item matches the given specification
-     *
-     * @param item the item to be tested
-     *
-     * @return true if the item matches, false otherwise
-     */
-// START SNIPPET: specification
-    boolean satisfiedBy( T item );
-}
-// END SNIPPET: specification


[38/50] [abbrv] zest-qi4j git commit: Changing a loop into the Stream API filter instead.

Posted by ni...@apache.org.
Changing a loop into the Stream API filter instead.


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/0a50ebd5
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/0a50ebd5
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/0a50ebd5

Branch: refs/heads/3.0
Commit: 0a50ebd5293476471eac62d4ad9b614753277478
Parents: b71c878
Author: Niclas Hedhman <ni...@hedhman.org>
Authored: Sat Oct 4 14:07:30 2014 +0800
Committer: Niclas Hedhman <ni...@hedhman.org>
Committed: Sat Oct 4 14:07:30 2014 +0800

----------------------------------------------------------------------
 .../java/org/qi4j/api/activation/ActivationEvent.java    |  2 --
 .../org/qi4j/api/association/GenericAssociationInfo.java | 11 ++---------
 2 files changed, 2 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/0a50ebd5/core/api/src/main/java/org/qi4j/api/activation/ActivationEvent.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/activation/ActivationEvent.java b/core/api/src/main/java/org/qi4j/api/activation/ActivationEvent.java
index e3fdf70..c5f889c 100644
--- a/core/api/src/main/java/org/qi4j/api/activation/ActivationEvent.java
+++ b/core/api/src/main/java/org/qi4j/api/activation/ActivationEvent.java
@@ -24,13 +24,11 @@ public final class ActivationEvent
         ACTIVATING, ACTIVATED, PASSIVATING, PASSIVATED
     }
 
-    private final long timestamp;
     private final Object source;
     private final EventType type;
 
     public ActivationEvent( Object source, EventType type )
     {
-        this.timestamp = System.currentTimeMillis();
         this.source = source;
         this.type = type;
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/0a50ebd5/core/api/src/main/java/org/qi4j/api/association/GenericAssociationInfo.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/association/GenericAssociationInfo.java b/core/api/src/main/java/org/qi4j/api/association/GenericAssociationInfo.java
index 7173547..96e466d 100644
--- a/core/api/src/main/java/org/qi4j/api/association/GenericAssociationInfo.java
+++ b/core/api/src/main/java/org/qi4j/api/association/GenericAssociationInfo.java
@@ -20,6 +20,7 @@ package org.qi4j.api.association;
 import java.lang.reflect.AccessibleObject;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
+import java.util.Arrays;
 
 import static org.qi4j.api.util.Classes.typeOf;
 
@@ -45,14 +46,6 @@ public final class GenericAssociationInfo
         }
 
         Type[] interfaces = ( (Class<?>) methodReturnType ).getGenericInterfaces();
-        for( Type anInterface : interfaces )
-        {
-            Type associationType = toAssociationType( anInterface );
-            if( associationType != null )
-            {
-                return associationType;
-            }
-        }
-        return null;
+        return Arrays.stream( interfaces ).findFirst().filter( intFace -> toAssociationType( intFace ) != null ).get();
     }
 }


[15/50] [abbrv] zest-qi4j git commit: Bootstrap: minor fixes in javadoc

Posted by ni...@apache.org.
Bootstrap: minor fixes in javadoc


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/cca75ebd
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/cca75ebd
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/cca75ebd

Branch: refs/heads/3.0
Commit: cca75ebdd853da593f50c8d49676b17337cee5e2
Parents: 510550f
Author: Paul Merlin <pa...@nosphere.org>
Authored: Thu Jun 12 15:06:33 2014 +0200
Committer: Paul Merlin <pa...@nosphere.org>
Committed: Thu Jun 12 15:06:33 2014 +0200

----------------------------------------------------------------------
 .../main/java/org/qi4j/bootstrap/builder/ApplicationBuilder.java    | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/cca75ebd/core/bootstrap/src/main/java/org/qi4j/bootstrap/builder/ApplicationBuilder.java
----------------------------------------------------------------------
diff --git a/core/bootstrap/src/main/java/org/qi4j/bootstrap/builder/ApplicationBuilder.java b/core/bootstrap/src/main/java/org/qi4j/bootstrap/builder/ApplicationBuilder.java
index 98412aa..c008e5f 100644
--- a/core/bootstrap/src/main/java/org/qi4j/bootstrap/builder/ApplicationBuilder.java
+++ b/core/bootstrap/src/main/java/org/qi4j/bootstrap/builder/ApplicationBuilder.java
@@ -221,6 +221,7 @@ public class ApplicationBuilder
 
     /**
      * {@literal main} method that read JSON from STDIN.
+     * <p>Passivation exceptions are written to STDERR if any.</p>
      * @param args Unused
      * @throws JSONException if unable to read JSON
      * @throws AssemblyException if the assembly failed


[25/50] [abbrv] zest-qi4j git commit: Removed Function, Function2 and Specification and replaced with the equivalents in JDK, Function, BiFunction and Predicate.

Posted by ni...@apache.org.
http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/injection/provider/ServiceInjectionProviderFactory.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/injection/provider/ServiceInjectionProviderFactory.java b/core/runtime/src/main/java/org/qi4j/runtime/injection/provider/ServiceInjectionProviderFactory.java
index 30c16f5..8884cf0 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/injection/provider/ServiceInjectionProviderFactory.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/injection/provider/ServiceInjectionProviderFactory.java
@@ -17,15 +17,15 @@ package org.qi4j.runtime.injection.provider;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
+import java.util.function.Function;
+import java.util.function.Predicate;
 import org.qi4j.api.service.NoSuchServiceException;
 import org.qi4j.api.service.ServiceReference;
 import org.qi4j.api.service.qualifier.Qualifier;
 import org.qi4j.api.util.Annotations;
 import org.qi4j.api.util.Classes;
 import org.qi4j.bootstrap.InvalidInjectionException;
-import org.qi4j.functional.Function;
 import org.qi4j.functional.Iterables;
-import org.qi4j.functional.Specification;
 import org.qi4j.functional.Specifications;
 import org.qi4j.runtime.injection.DependencyModel;
 import org.qi4j.runtime.injection.InjectionContext;
@@ -49,7 +49,7 @@ public final class ServiceInjectionProviderFactory
         // TODO This could be changed to allow multiple @Qualifier annotations
         Annotation qualifierAnnotation = first( filter( Specifications.translate( Annotations.type(), hasAnnotation( Qualifier.class ) ), iterable( dependencyModel
                                                                                                                                                         .annotations() ) ) );
-        Specification<ServiceReference<?>> serviceQualifier = null;
+        Predicate<ServiceReference<?>> serviceQualifier = null;
         if( qualifierAnnotation != null )
         {
             Qualifier qualifier = qualifierAnnotation.annotationType().getAnnotation( Qualifier.class );
@@ -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 ];
@@ -96,7 +96,7 @@ public final class ServiceInjectionProviderFactory
         extends ServiceInjectionProvider
     {
         private IterableServiceReferenceProvider( Type serviceType,
-                                                  Specification<ServiceReference<?>> serviceQualifier
+                                                  Predicate<ServiceReference<?>> serviceQualifier
         )
         {
             super( serviceType, serviceQualifier );
@@ -115,7 +115,7 @@ public final class ServiceInjectionProviderFactory
         implements Function<ServiceReference<?>, Object>
     {
         private IterableServiceProvider( Type serviceType,
-                                         Specification<ServiceReference<?>> serviceQualifier
+                                         Predicate<ServiceReference<?>> serviceQualifier
         )
         {
             super( serviceType, serviceQualifier );
@@ -129,7 +129,7 @@ public final class ServiceInjectionProviderFactory
         }
 
         @Override
-        public Object map( ServiceReference<?> objectServiceReference )
+        public Object apply( ServiceReference<?> objectServiceReference )
         {
             return objectServiceReference.get();
         }
@@ -138,7 +138,7 @@ public final class ServiceInjectionProviderFactory
     private static class ServiceReferenceProvider
         extends ServiceInjectionProvider
     {
-        ServiceReferenceProvider( Type serviceType, Specification<ServiceReference<?>> qualifier )
+        ServiceReferenceProvider( Type serviceType, Predicate<ServiceReference<?>> qualifier )
         {
             super( serviceType, qualifier );
         }
@@ -154,7 +154,7 @@ public final class ServiceInjectionProviderFactory
     private static class ServiceProvider
         extends ServiceInjectionProvider
     {
-        ServiceProvider( Type serviceType, Specification<ServiceReference<?>> qualifier )
+        ServiceProvider( Type serviceType, Predicate<ServiceReference<?>> qualifier )
         {
             super( serviceType, qualifier );
         }
@@ -180,10 +180,10 @@ public final class ServiceInjectionProviderFactory
         implements InjectionProvider
     {
         private final Type serviceType;
-        private final Specification<ServiceReference<?>> serviceQualifier;
+        private final Predicate<ServiceReference<?>> serviceQualifier;
 
         private ServiceInjectionProvider( Type serviceType,
-                                            Specification<ServiceReference<?>> serviceQualifier
+                                          Predicate<ServiceReference<?>> serviceQualifier
         )
         {
             this.serviceType = serviceType;

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/injection/provider/ThisInjectionProviderFactory.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/injection/provider/ThisInjectionProviderFactory.java b/core/runtime/src/main/java/org/qi4j/runtime/injection/provider/ThisInjectionProviderFactory.java
index ac648d8..c927b65 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/injection/provider/ThisInjectionProviderFactory.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/injection/provider/ThisInjectionProviderFactory.java
@@ -34,7 +34,7 @@ public final class ThisInjectionProviderFactory
             final Class<?> thisType = dependencyModel.rawInjectionType();
 
             Iterable<Class<?>> injectionTypes = null;
-            if( Classes.assignableTypeSpecification( thisType ).satisfiedBy( bindingContext.model() ) )
+            if( Classes.assignableTypeSpecification( thisType ).test( bindingContext.model() ) )
             {
                 injectionTypes = bindingContext.model().types();
             }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/query/IterableQuerySource.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/query/IterableQuerySource.java b/core/runtime/src/main/java/org/qi4j/runtime/query/IterableQuerySource.java
index 09490a5..c1cecf4 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/query/IterableQuerySource.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/query/IterableQuerySource.java
@@ -19,12 +19,12 @@ import java.util.Comparator;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.function.Predicate;
 import org.qi4j.api.composite.Composite;
 import org.qi4j.api.property.Property;
 import org.qi4j.api.query.grammar.OrderBy;
 import org.qi4j.api.util.Classes;
 import org.qi4j.functional.Iterables;
-import org.qi4j.functional.Specification;
 import org.qi4j.functional.Specifications;
 import org.qi4j.spi.query.QuerySource;
 
@@ -49,7 +49,7 @@ public class IterableQuerySource
 
     @Override
     public <T> T find( Class<T> resultType,
-                       Specification<Composite> whereClause,
+                       Predicate<Composite> whereClause,
                        Iterable<OrderBy> orderBySegments,
                        Integer firstResult,
                        Integer maxResults,
@@ -66,7 +66,7 @@ public class IterableQuerySource
 
     @Override
     public <T> long count( Class<T> resultType,
-                           Specification<Composite> whereClause,
+                           Predicate<Composite> whereClause,
                            Iterable<OrderBy> orderBySegments,
                            Integer firstResult,
                            Integer maxResults,
@@ -78,7 +78,7 @@ public class IterableQuerySource
 
     @Override
     public <T> Iterator<T> iterator( Class<T> resultType,
-                                     Specification<Composite> whereClause,
+                                     Predicate<Composite> whereClause,
                                      Iterable<OrderBy> orderBySegments,
                                      Integer firstResult,
                                      Integer maxResults,
@@ -90,7 +90,7 @@ public class IterableQuerySource
 
     @SuppressWarnings( {"raw", "unchecked"} )
     private <T> List<T> list( Class<T> resultType,
-                              Specification<Composite> whereClause,
+                              Predicate<Composite> whereClause,
                               Iterable<OrderBy> orderBySegments,
                               Integer firstResult,
                               Integer maxResults,
@@ -146,7 +146,7 @@ public class IterableQuerySource
     }
 
     @SuppressWarnings( {"raw", "unchecked"} )
-    private <T> List<T> filter( Class<T> resultType, Specification whereClause )
+    private <T> List<T> filter( Class<T> resultType, Predicate whereClause )
     {
         if( whereClause == null )
         {
@@ -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-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/query/QueryBuilderImpl.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/query/QueryBuilderImpl.java b/core/runtime/src/main/java/org/qi4j/runtime/query/QueryBuilderImpl.java
index bef28c5..2374609 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/query/QueryBuilderImpl.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/query/QueryBuilderImpl.java
@@ -18,11 +18,11 @@
  */
 package org.qi4j.runtime.query;
 
+import java.util.function.Predicate;
 import org.qi4j.api.composite.Composite;
 import org.qi4j.api.query.Query;
 import org.qi4j.api.query.QueryBuilder;
 import org.qi4j.api.query.QueryExpressions;
-import org.qi4j.functional.Specification;
 import org.qi4j.spi.query.EntityFinder;
 import org.qi4j.spi.query.QueryBuilderSPI;
 import org.qi4j.spi.query.QuerySource;
@@ -46,7 +46,7 @@ final class QueryBuilderImpl<T>
     /**
      * Where clause.
      */
-    private final Specification<Composite> whereClause;
+    private final Predicate<Composite> whereClause;
 
     /**
      * Constructor.
@@ -57,7 +57,7 @@ final class QueryBuilderImpl<T>
      */
     QueryBuilderImpl( final EntityFinder entityFinder,
                       final Class<T> resultType,
-                      final Specification<Composite> whereClause
+                      final Predicate<Composite> whereClause
     )
     {
         this.entityFinder = entityFinder;
@@ -67,7 +67,7 @@ final class QueryBuilderImpl<T>
 
     @Override
     @SuppressWarnings( "unchecked" )
-    public QueryBuilder<T> where( Specification<Composite> specification )
+    public QueryBuilder<T> where( Predicate<Composite> specification )
     {
         if( specification == null )
         {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/query/QueryImpl.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/query/QueryImpl.java b/core/runtime/src/main/java/org/qi4j/runtime/query/QueryImpl.java
index 7048990..e944d73 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/query/QueryImpl.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/query/QueryImpl.java
@@ -21,6 +21,7 @@ package org.qi4j.runtime.query;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.function.Predicate;
 import org.qi4j.api.composite.Composite;
 import org.qi4j.api.property.Property;
 import org.qi4j.api.query.Query;
@@ -28,7 +29,6 @@ import org.qi4j.api.query.QueryExecutionException;
 import org.qi4j.api.query.QueryExpressions;
 import org.qi4j.api.query.grammar.OrderBy;
 import org.qi4j.functional.Iterables;
-import org.qi4j.functional.Specification;
 import org.qi4j.spi.query.QuerySource;
 
 /**
@@ -46,7 +46,7 @@ import org.qi4j.spi.query.QuerySource;
     /**
      * Where clause.
      */
-    private final Specification<Composite> whereClause;
+    private final Predicate<Composite> whereClause;
     private QuerySource querySource;
     /**
      * Order by clause segments.
@@ -72,7 +72,7 @@ import org.qi4j.spi.query.QuerySource;
      * @param whereClause where clause
      */
     /* package */ QueryImpl( final Class<T> resultType,
-               final Specification<Composite> whereClause,
+               final Predicate<Composite> whereClause,
                final QuerySource querySource
     )
     {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/service/ImportedServicesInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/service/ImportedServicesInstance.java b/core/runtime/src/main/java/org/qi4j/runtime/service/ImportedServicesInstance.java
index 211dfad..dd7a412 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/service/ImportedServicesInstance.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/service/ImportedServicesInstance.java
@@ -15,6 +15,7 @@
 package org.qi4j.runtime.service;
 
 import java.util.List;
+import java.util.function.Predicate;
 import org.qi4j.api.activation.Activation;
 import org.qi4j.api.activation.ActivationEventListener;
 import org.qi4j.api.activation.ActivationEventListenerRegistration;
@@ -23,7 +24,6 @@ import org.qi4j.api.activation.PassivationException;
 import org.qi4j.api.common.Visibility;
 import org.qi4j.api.service.ServiceReference;
 import org.qi4j.functional.Iterables;
-import org.qi4j.functional.Specification;
 import org.qi4j.runtime.activation.ActivationDelegate;
 import org.qi4j.runtime.activation.ActivatorsInstance;
 
@@ -69,10 +69,10 @@ public class ImportedServicesInstance
 
     public Iterable<ServiceReference> visibleServices( final Visibility visibility )
     {
-        return Iterables.filter( new Specification<ServiceReference>()
+        return Iterables.filter( new Predicate<ServiceReference>()
         {
             @Override
-            public boolean satisfiedBy( ServiceReference item )
+            public boolean test( ServiceReference item )
             {
                 return ( (ImportedServiceReferenceInstance) item ).serviceDescriptor()
                     .visibility()

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/service/ServiceInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/service/ServiceInstance.java b/core/runtime/src/main/java/org/qi4j/runtime/service/ServiceInstance.java
index 2bbb462..ee0e7af 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/service/ServiceInstance.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/service/ServiceInstance.java
@@ -51,7 +51,7 @@ public class ServiceInstance
         super( compositeModel, moduleInstance, mixins, state );
 
         implementsServiceAvailable =
-            Classes.assignableTypeSpecification( Availability.class ).satisfiedBy( descriptor() );
+            Classes.assignableTypeSpecification( Availability.class ).test( descriptor() );
         hasEnabledConfiguration = compositeModel.configurationType() != null
                                   && Enabled.class.isAssignableFrom( compositeModel.configurationType() );
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/service/ServiceModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/service/ServiceModel.java b/core/runtime/src/main/java/org/qi4j/runtime/service/ServiceModel.java
index ec029d1..f13ba07 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/service/ServiceModel.java
+++ b/core/runtime/src/main/java/org/qi4j/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-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/service/ServicesInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/service/ServicesInstance.java b/core/runtime/src/main/java/org/qi4j/runtime/service/ServicesInstance.java
index 3920855..4020ff3 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/service/ServicesInstance.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/service/ServicesInstance.java
@@ -15,6 +15,7 @@
 package org.qi4j.runtime.service;
 
 import java.util.List;
+import java.util.function.Predicate;
 import org.qi4j.api.activation.Activation;
 import org.qi4j.api.activation.ActivationEventListener;
 import org.qi4j.api.activation.ActivationEventListenerRegistration;
@@ -23,7 +24,6 @@ import org.qi4j.api.activation.PassivationException;
 import org.qi4j.api.common.Visibility;
 import org.qi4j.api.service.ServiceReference;
 import org.qi4j.functional.Iterables;
-import org.qi4j.functional.Specification;
 import org.qi4j.runtime.activation.ActivationDelegate;
 import org.qi4j.runtime.activation.ActivatorsInstance;
 
@@ -67,10 +67,10 @@ public class ServicesInstance
 
     public Iterable<ServiceReference> visibleServices( final Visibility visibility )
     {
-        return Iterables.filter( new Specification<ServiceReference>()
+        return Iterables.filter( new Predicate<ServiceReference>()
         {
             @Override
-            public boolean satisfiedBy( ServiceReference item )
+            public boolean test( ServiceReference item )
             {
                 return ( (ServiceReferenceInstance) item ).serviceDescriptor()
                            .visibility()

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/structure/LayerInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/structure/LayerInstance.java b/core/runtime/src/main/java/org/qi4j/runtime/structure/LayerInstance.java
index 9ed77bb..0b408e4 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/structure/LayerInstance.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/structure/LayerInstance.java
@@ -16,13 +16,13 @@ package org.qi4j.runtime.structure;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.function.Function;
 import org.qi4j.api.activation.ActivationEventListener;
 import org.qi4j.api.activation.ActivationException;
 import org.qi4j.api.activation.PassivationException;
 import org.qi4j.api.common.Visibility;
 import org.qi4j.api.service.ServiceReference;
 import org.qi4j.api.structure.Layer;
-import org.qi4j.functional.Function;
 import org.qi4j.runtime.activation.ActivationDelegate;
 import org.qi4j.runtime.composite.TransientModel;
 import org.qi4j.runtime.entity.EntityModel;
@@ -136,7 +136,7 @@ public class LayerInstance
         {
 
             @Override
-            public Iterable<ModelModule<ObjectModel>> map( ModuleInstance moduleInstance )
+            public Iterable<ModelModule<ObjectModel>> apply( ModuleInstance moduleInstance )
             {
                 return moduleInstance.visibleObjects( visibility );
             }
@@ -150,7 +150,7 @@ public class LayerInstance
         {
 
             @Override
-            public Iterable<ModelModule<TransientModel>> map( ModuleInstance moduleInstance )
+            public Iterable<ModelModule<TransientModel>> apply( ModuleInstance moduleInstance )
             {
                 return moduleInstance.visibleTransients( visibility );
             }
@@ -164,7 +164,7 @@ public class LayerInstance
         {
 
             @Override
-            public Iterable<ModelModule<EntityModel>> map( ModuleInstance moduleInstance )
+            public Iterable<ModelModule<EntityModel>> apply( ModuleInstance moduleInstance )
             {
                 return moduleInstance.visibleEntities( visibility );
             }
@@ -178,7 +178,7 @@ public class LayerInstance
         {
 
             @Override
-            public Iterable<ModelModule<ValueModel>> map( ModuleInstance moduleInstance )
+            public Iterable<ModelModule<ValueModel>> apply( ModuleInstance moduleInstance )
             {
                 return moduleInstance.visibleValues( visibility );
             }
@@ -192,7 +192,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-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/structure/ModelModule.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/structure/ModelModule.java b/core/runtime/src/main/java/org/qi4j/runtime/structure/ModelModule.java
index fe787a0..e68eda2 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/structure/ModelModule.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/structure/ModelModule.java
@@ -1,7 +1,7 @@
 package org.qi4j.runtime.structure;
 
+import java.util.function.Function;
 import org.qi4j.api.composite.ModelDescriptor;
-import org.qi4j.functional.Function;
 
 /**
  * TODO
@@ -13,7 +13,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 );
             }
@@ -25,7 +25,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();
             }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/structure/ModuleInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/structure/ModuleInstance.java b/core/runtime/src/main/java/org/qi4j/runtime/structure/ModuleInstance.java
index 551999e..cfbbb41 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/structure/ModuleInstance.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/structure/ModuleInstance.java
@@ -24,6 +24,9 @@ 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 java.util.function.Predicate;
 import org.qi4j.api.activation.Activation;
 import org.qi4j.api.activation.ActivationEventListener;
 import org.qi4j.api.activation.ActivationException;
@@ -62,9 +65,6 @@ import org.qi4j.api.value.ValueComposite;
 import org.qi4j.api.value.ValueDescriptor;
 import org.qi4j.api.value.ValueSerialization;
 import org.qi4j.api.value.ValueSerializationException;
-import org.qi4j.functional.Function;
-import org.qi4j.functional.Function2;
-import org.qi4j.functional.Specification;
 import org.qi4j.functional.Specifications;
 import org.qi4j.runtime.activation.ActivationDelegate;
 import org.qi4j.runtime.composite.TransientBuilderInstance;
@@ -320,7 +320,7 @@ public class ModuleInstance
 
         TransientStateInstance state = new TransientStateInstance( properties );
 
-        return new TransientBuilderInstance<>( modelModule, state, UsesInstance.EMPTY_USES );
+        return new TransientBuilderInstance<T>( modelModule, state, UsesInstance.EMPTY_USES );
     }
 
     @Override
@@ -437,25 +437,25 @@ public class ModuleInstance
         @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 toList( manyAssociationFunction.map( associationDescriptor ) );
+            return toList( manyAssociationFunction.apply( associationDescriptor ) );
         }
 
         @Override
         public Map<String, EntityReference> getNamedAssociationState( AssociationDescriptor associationDescriptor )
         {
-            return namedAssociationFunction.map( associationDescriptor );
+            return namedAssociationFunction.apply( associationDescriptor );
         }
 
     }
@@ -629,13 +629,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;
@@ -646,9 +646,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() );
         }
     }
 
@@ -773,8 +773,8 @@ public class ModuleInstance
             Class<?> clazz = classes.get( name );
             if( clazz == null )
             {
-                Specification<ModelDescriptor> modelTypeSpecification = modelTypeSpecification( name );
-                Specification<ModelModule<ModelDescriptor>> translate = Specifications.translate( ModelModule.modelFunction(), modelTypeSpecification );
+                Predicate<ModelDescriptor> modelTypeSpecification = modelTypeSpecification( name );
+                Predicate<ModelModule<ModelDescriptor>> translate = Specifications.translate( ModelModule.modelFunction(), modelTypeSpecification );
                 // Check module
                 {
                     Iterable<ModelModule<ModelDescriptor>> i = cast( flatten(

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/structure/ModuleUnitOfWork.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/structure/ModuleUnitOfWork.java b/core/runtime/src/main/java/org/qi4j/runtime/structure/ModuleUnitOfWork.java
index bdadb75..2a333c7 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/structure/ModuleUnitOfWork.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/structure/ModuleUnitOfWork.java
@@ -18,6 +18,7 @@ package org.qi4j.runtime.structure;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.function.Predicate;
 import org.qi4j.api.composite.Composite;
 import org.qi4j.api.entity.EntityBuilder;
 import org.qi4j.api.entity.EntityComposite;
@@ -38,7 +39,6 @@ import org.qi4j.api.unitofwork.UnitOfWorkCompletionException;
 import org.qi4j.api.unitofwork.UnitOfWorkFactory;
 import org.qi4j.api.usecase.Usecase;
 import org.qi4j.functional.Iterables;
-import org.qi4j.functional.Specification;
 import org.qi4j.runtime.entity.EntityInstance;
 import org.qi4j.runtime.entity.EntityModel;
 import org.qi4j.runtime.unitofwork.EntityBuilderInstance;
@@ -335,7 +335,7 @@ public class ModuleUnitOfWork
 
         @Override
         public <T> T find( Class<T> resultType,
-                           Specification<Composite> whereClause,
+                           Predicate<Composite> whereClause,
                            Iterable<OrderBy> orderBySegments,
                            Integer firstResult,
                            Integer maxResults,
@@ -370,7 +370,7 @@ public class ModuleUnitOfWork
 
         @Override
         public <T> long count( Class<T> resultType,
-                               Specification<Composite> whereClause,
+                               Predicate<Composite> whereClause,
                                Iterable<OrderBy> orderBySegments,
                                Integer firstResult,
                                Integer maxResults,
@@ -392,7 +392,7 @@ public class ModuleUnitOfWork
 
         @Override
         public <T> Iterator<T> iterator( final Class<T> resultType,
-                                         Specification<Composite> whereClause,
+                                         Predicate<Composite> whereClause,
                                          Iterable<OrderBy> orderBySegments,
                                          Integer firstResult,
                                          Integer maxResults,

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/structure/TypeLookup.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/structure/TypeLookup.java b/core/runtime/src/main/java/org/qi4j/runtime/structure/TypeLookup.java
index 1383ce8..ae796cf 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/structure/TypeLookup.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/structure/TypeLookup.java
@@ -27,13 +27,13 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
+import java.util.function.Function;
+import java.util.function.Predicate;
 import org.qi4j.api.common.Visibility;
 import org.qi4j.api.composite.AmbiguousTypeException;
 import org.qi4j.api.composite.ModelDescriptor;
 import org.qi4j.api.service.NoSuchServiceException;
 import org.qi4j.api.service.ServiceReference;
-import org.qi4j.functional.Function;
-import org.qi4j.functional.Specification;
 import org.qi4j.functional.Specifications;
 import org.qi4j.runtime.composite.TransientModel;
 import org.qi4j.runtime.entity.EntityModel;
@@ -356,7 +356,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;
@@ -411,19 +411,19 @@ public class TypeLookup
     }
 
     @SuppressWarnings( { "raw", "unchecked" } )
-    private static <T extends ModelDescriptor> Iterable<ModelModule<T>> findModels( Specification<Iterable<Class<?>>> specification,
+    private static <T extends ModelDescriptor> Iterable<ModelModule<T>> findModels( Predicate<Iterable<Class<?>>> specification,
                                                                                     Iterable<ModelModule<T>>... models )
     {
-        Specification<ModelModule<T>> spec = Specifications.translate( new ModelModuleTypesFunction(), specification );
+        Predicate<ModelModule<T>> spec = Specifications.translate( new ModelModuleTypesFunction(), specification );
         Iterable<ModelModule<T>> flattened = flattenIterables( iterable( models ) );
         return filter( spec, flattened );
     }
 
     @SuppressWarnings( { "raw", "unchecked" } )
-    private static Iterable<ServiceReference<?>> findServiceReferences( Specification<Iterable<Class<?>>> specification,
+    private static Iterable<ServiceReference<?>> findServiceReferences( Predicate<Iterable<Class<?>>> specification,
                                                                         Iterable<ServiceReference<?>>... references )
     {
-        Specification<ServiceReference<?>> spec = Specifications.translate( new ServiceReferenceTypesFunction(), specification );
+        Predicate<ServiceReference<?>> spec = Specifications.translate( new ServiceReferenceTypesFunction(), specification );
         Iterable<ServiceReference<?>> flattened = flattenIterables( iterable( references ) );
         return filter( spec, flattened );
     }
@@ -482,7 +482,7 @@ public class TypeLookup
     {
 
         @Override
-        public Iterable<Class<?>> map( ModelModule<T> modelModule )
+        public Iterable<Class<?>> apply( ModelModule<T> modelModule )
         {
             return modelModule.model().types();
         }
@@ -494,7 +494,7 @@ public class TypeLookup
     {
 
         @Override
-        public Iterable<Class<?>> map( ServiceReference<?> serviceReference )
+        public Iterable<Class<?>> apply( ServiceReference<?> serviceReference )
         {
             return serviceReference.types();
         }
@@ -502,7 +502,7 @@ public class TypeLookup
     }
 
     private static abstract class AbstractTypeLookupSpecification
-        implements Specification<Iterable<Class<?>>>
+        implements Predicate<Iterable<Class<?>>>
     {
 
         protected final Type lookedUpType;
@@ -513,7 +513,7 @@ public class TypeLookup
         }
 
         @Override
-        public final boolean satisfiedBy( Iterable<Class<?>> types )
+        public final boolean test( Iterable<Class<?>> types )
         {
             if( lookedUpType instanceof Class )
             {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/structure/UsedLayersInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/structure/UsedLayersInstance.java b/core/runtime/src/main/java/org/qi4j/runtime/structure/UsedLayersInstance.java
index 1c0f650..7db6f39 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/structure/UsedLayersInstance.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/structure/UsedLayersInstance.java
@@ -15,9 +15,9 @@
 package org.qi4j.runtime.structure;
 
 import java.util.List;
+import java.util.function.Function;
 import org.qi4j.api.common.Visibility;
 import org.qi4j.api.service.ServiceReference;
-import org.qi4j.functional.Function;
 import org.qi4j.runtime.composite.TransientModel;
 import org.qi4j.runtime.entity.EntityModel;
 import org.qi4j.runtime.object.ObjectModel;
@@ -42,7 +42,7 @@ public final class UsedLayersInstance
         return flattenIterables( map( new Function<LayerInstance, Iterable<ModelModule<ObjectModel>>>()
         {
             @Override
-            public Iterable<ModelModule<ObjectModel>> map( LayerInstance layerInstance )
+            public Iterable<ModelModule<ObjectModel>> apply( LayerInstance layerInstance )
             {
                 return layerInstance.visibleObjects( Visibility.application );
             }
@@ -54,7 +54,7 @@ public final class UsedLayersInstance
         return flattenIterables( map( new Function<LayerInstance, Iterable<ModelModule<TransientModel>>>()
         {
             @Override
-            public Iterable<ModelModule<TransientModel>> map( LayerInstance layerInstance )
+            public Iterable<ModelModule<TransientModel>> apply( LayerInstance layerInstance )
             {
                 return layerInstance.visibleTransients( Visibility.application );
             }
@@ -66,7 +66,7 @@ public final class UsedLayersInstance
         return flattenIterables( map( new Function<LayerInstance, Iterable<ModelModule<EntityModel>>>()
         {
             @Override
-            public Iterable<ModelModule<EntityModel>> map( LayerInstance layerInstance )
+            public Iterable<ModelModule<EntityModel>> apply( LayerInstance layerInstance )
             {
                 return layerInstance.visibleEntities( Visibility.application );
             }
@@ -78,7 +78,7 @@ public final class UsedLayersInstance
         return flattenIterables( map( new Function<LayerInstance, Iterable<ModelModule<ValueModel>>>()
         {
             @Override
-            public Iterable<ModelModule<ValueModel>> map( LayerInstance layerInstance )
+            public Iterable<ModelModule<ValueModel>> apply( LayerInstance layerInstance )
             {
                 return layerInstance.visibleValues( Visibility.application );
             }
@@ -90,7 +90,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-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/structure/VisibilitySpecification.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/structure/VisibilitySpecification.java b/core/runtime/src/main/java/org/qi4j/runtime/structure/VisibilitySpecification.java
index 37862b2..ce1f285 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/structure/VisibilitySpecification.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/structure/VisibilitySpecification.java
@@ -1,18 +1,18 @@
 package org.qi4j.runtime.structure;
 
+import java.util.function.Predicate;
 import org.qi4j.api.common.Visibility;
 import org.qi4j.api.composite.ModelDescriptor;
-import org.qi4j.functional.Specification;
 
 /**
  * TODO
  */
 public class VisibilitySpecification
-    implements Specification<ModelDescriptor>
+    implements Predicate<ModelDescriptor>
 {
-    public static final Specification<ModelDescriptor> MODULE = new VisibilitySpecification( Visibility.module );
-    public static final Specification<ModelDescriptor> LAYER = new VisibilitySpecification( Visibility.layer );
-    public static final Specification<ModelDescriptor> APPLICATION = new VisibilitySpecification( Visibility.application );
+    public static final Predicate<ModelDescriptor> MODULE = new VisibilitySpecification( Visibility.module );
+    public static final Predicate<ModelDescriptor> LAYER = new VisibilitySpecification( Visibility.layer );
+    public static final Predicate<ModelDescriptor> APPLICATION = new VisibilitySpecification( Visibility.application );
 
     private final Visibility visibility;
 
@@ -22,7 +22,7 @@ public class VisibilitySpecification
     }
 
     @Override
-    public boolean satisfiedBy( ModelDescriptor item )
+    public boolean test( ModelDescriptor item )
     {
         return item.visibility().ordinal() >= visibility.ordinal();
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/types/ValueTypeFactory.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/types/ValueTypeFactory.java b/core/runtime/src/main/java/org/qi4j/runtime/types/ValueTypeFactory.java
index 0910293..cd74487 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/types/ValueTypeFactory.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/types/ValueTypeFactory.java
@@ -77,12 +77,12 @@ public class ValueTypeFactory
                     collectionType = Classes.resolveTypeVariable( collectionTypeVariable, declaringClass, compositeType );
                 }
                 ValueType collectedType = newValueType( collectionType, declaringClass, compositeType, layer, module );
-                valueType = new CollectionType( Classes.RAW_CLASS.map( type ), collectedType );
+                valueType = new CollectionType( Classes.RAW_CLASS.apply( type ), collectedType );
             }
             else
             {
-                valueType = new CollectionType( Classes.RAW_CLASS
-                                                    .map( type ), newValueType( Object.class, declaringClass, compositeType, layer, module ) );
+                valueType = new CollectionType(
+                    Classes.RAW_CLASS.apply( type ), newValueType( Object.class, declaringClass, compositeType, layer, module ) );
             }
         }
         else if( MapType.isMap( type ) )
@@ -106,18 +106,18 @@ public class ValueTypeFactory
                 }
                 ValueType valuedType = newValueType( valType, declaringClass, compositeType, layer, module );
 
-                valueType = new MapType( Classes.RAW_CLASS.map( type ), keyedType, valuedType );
+                valueType = new MapType( Classes.RAW_CLASS.apply( type ), keyedType, valuedType );
             }
             else
             {
-                valueType = new MapType( Classes.RAW_CLASS
-                                             .map( type ), newValueType( Object.class, declaringClass, compositeType, layer, module ), newValueType( Object.class, declaringClass, compositeType, layer, module ) );
+                valueType = new MapType(
+                    Classes.RAW_CLASS.apply( type ), newValueType( Object.class, declaringClass, compositeType, layer, module ), newValueType( Object.class, declaringClass, compositeType, layer, module ) );
             }
         }
         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 )
             {
@@ -143,11 +143,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;
@@ -209,7 +209,7 @@ public class ValueTypeFactory
             else if( visited instanceof ValueModel )
             {
                 ValueModel valueModel = (ValueModel) visited;
-                boolean typeEquality = Specifications.in( valueModel.types() ).satisfiedBy( type );
+                boolean typeEquality = Specifications.in( valueModel.types() ).test( type );
                 if( typeEquality && valueModel.visibility().ordinal() >= visibility.ordinal() )
                 {
                     foundModel = valueModel;

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/unitofwork/BuilderEntityState.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/unitofwork/BuilderEntityState.java b/core/runtime/src/main/java/org/qi4j/runtime/unitofwork/BuilderEntityState.java
index 7c1388c..fc2302d 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/unitofwork/BuilderEntityState.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/unitofwork/BuilderEntityState.java
@@ -81,7 +81,7 @@ public final class BuilderEntityState
     @Override
     public boolean isAssignableTo( Class<?> type )
     {
-        return Classes.exactTypeSpecification( type ).satisfiedBy( entityType );
+        return Classes.exactTypeSpecification( type ).test( entityType );
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/runtime/src/test/java/org/qi4j/runtime/composite/CompositeFactoryImplTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/runtime/composite/CompositeFactoryImplTest.java b/core/runtime/src/test/java/org/qi4j/runtime/composite/CompositeFactoryImplTest.java
index 40666e0..564f28a 100644
--- a/core/runtime/src/test/java/org/qi4j/runtime/composite/CompositeFactoryImplTest.java
+++ b/core/runtime/src/test/java/org/qi4j/runtime/composite/CompositeFactoryImplTest.java
@@ -57,7 +57,7 @@ public class CompositeFactoryImplTest
             TransientBuilder<SecondComposite> builder = module.newTransientBuilder(
                 SecondComposite.class );
             SecondComposite composition9 = builder.newInstance();
-            composition9.setValue( "satisfiedBy value" );
+            composition9.setValue( "test value" );
         }
         catch( Exception e )
         {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/runtime/src/test/java/org/qi4j/runtime/composite/FunctionalListTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/runtime/composite/FunctionalListTest.java b/core/runtime/src/test/java/org/qi4j/runtime/composite/FunctionalListTest.java
index da0c71f..3e61416 100644
--- a/core/runtime/src/test/java/org/qi4j/runtime/composite/FunctionalListTest.java
+++ b/core/runtime/src/test/java/org/qi4j/runtime/composite/FunctionalListTest.java
@@ -2,6 +2,7 @@ package org.qi4j.runtime.composite;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.function.Function;
 import org.junit.Test;
 import org.qi4j.api.injection.scope.Structure;
 import org.qi4j.api.injection.scope.This;
@@ -9,7 +10,6 @@ import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.structure.Module;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.functional.Function;
 import org.qi4j.test.AbstractQi4jTest;
 
 import static org.hamcrest.CoreMatchers.hasItems;
@@ -38,7 +38,7 @@ public class FunctionalListTest extends AbstractQi4jTest
         List<String> strings = list.translate( new Function<Integer, String>()
         {
             @Override
-            public String map( Integer x )
+            public String apply( Integer x )
             {
                 return x.toString();
             }
@@ -72,7 +72,7 @@ public class FunctionalListTest extends AbstractQi4jTest
             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-qi4j/blob/9479a63e/core/runtime/src/test/java/org/qi4j/runtime/injection/ServiceInjectionTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/runtime/injection/ServiceInjectionTest.java b/core/runtime/src/test/java/org/qi4j/runtime/injection/ServiceInjectionTest.java
index 1038b79..fcd1943 100644
--- a/core/runtime/src/test/java/org/qi4j/runtime/injection/ServiceInjectionTest.java
+++ b/core/runtime/src/test/java/org/qi4j/runtime/injection/ServiceInjectionTest.java
@@ -17,6 +17,7 @@ package org.qi4j.runtime.injection;
 import java.io.Serializable;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
+import java.util.function.Predicate;
 import org.junit.Test;
 import org.qi4j.api.activation.ActivationException;
 import org.qi4j.api.common.ConstructionException;
@@ -36,7 +37,6 @@ import org.qi4j.bootstrap.LayerAssembly;
 import org.qi4j.bootstrap.ModuleAssembly;
 import org.qi4j.bootstrap.ServiceDeclaration;
 import org.qi4j.bootstrap.SingletonAssembler;
-import org.qi4j.functional.Specification;
 
 import static org.junit.Assert.assertEquals;
 import static org.qi4j.api.common.Visibility.application;
@@ -294,11 +294,11 @@ public class ServiceInjectionTest
     public static final class NamedSelector
         implements AnnotationQualifier<Named>
     {
-        public <T> Specification<ServiceReference<?>> qualifier( final Named named )
+        public <T> Predicate<ServiceReference<?>> qualifier( final Named named )
         {
-            return new Specification<ServiceReference<?>>()
+            return new Predicate<ServiceReference<?>>()
             {
-                public boolean satisfiedBy( ServiceReference<?> service )
+                public boolean test( ServiceReference<?> service )
                 {
                     ServiceName serviceName = service.metaInfo( ServiceName.class );
                     return ( serviceName != null && serviceName.getName().equals( named.value() ) );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/runtime/src/test/java/org/qi4j/runtime/mixin/JDKMixinTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/runtime/mixin/JDKMixinTest.java b/core/runtime/src/test/java/org/qi4j/runtime/mixin/JDKMixinTest.java
index f52a6c6..31679d5 100644
--- a/core/runtime/src/test/java/org/qi4j/runtime/mixin/JDKMixinTest.java
+++ b/core/runtime/src/test/java/org/qi4j/runtime/mixin/JDKMixinTest.java
@@ -20,6 +20,7 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.function.Predicate;
 import org.json.JSONObject;
 import org.junit.Before;
 import org.junit.Test;
@@ -30,7 +31,6 @@ import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.service.ServiceReference;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.functional.Specification;
 import org.qi4j.test.AbstractQi4jTest;
 
 import static org.hamcrest.core.IsEqual.*;
@@ -103,8 +103,8 @@ public class JDKMixinTest
 
     private static final String EXTENDS_IDENTITY = ExtendsJDKMixin.class.getName();
     private static final String COMPOSE_IDENTITY = ComposeWithJDKMixin.class.getName();
-    private static final Specification<ServiceReference<?>> EXTENDS_IDENTITY_SPEC = new ServiceIdentitySpec( EXTENDS_IDENTITY );
-    private static final Specification<ServiceReference<?>> COMPOSE_IDENTITY_SPEC = new ServiceIdentitySpec( COMPOSE_IDENTITY );
+    private static final Predicate<ServiceReference<?>> EXTENDS_IDENTITY_SPEC = new ServiceIdentitySpec( EXTENDS_IDENTITY );
+    private static final Predicate<ServiceReference<?>> COMPOSE_IDENTITY_SPEC = new ServiceIdentitySpec( COMPOSE_IDENTITY );
     private static final List<String> CONCERN_RECORDS = new ArrayList<String>();
 
     @Before
@@ -170,7 +170,7 @@ public class JDKMixinTest
     }
 
     private static class ServiceIdentitySpec
-        implements Specification<ServiceReference<?>>
+        implements Predicate<ServiceReference<?>>
     {
 
         private final String identity;
@@ -181,7 +181,7 @@ public class JDKMixinTest
         }
 
         @Override
-        public boolean satisfiedBy( ServiceReference<?> item )
+        public boolean test( ServiceReference<?> item )
         {
             return item.identity().equals( identity );
         }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/runtime/src/test/java/org/qi4j/runtime/mixin/MixinPrecedenceTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/runtime/mixin/MixinPrecedenceTest.java b/core/runtime/src/test/java/org/qi4j/runtime/mixin/MixinPrecedenceTest.java
index 3fdb1f5..eca8245 100644
--- a/core/runtime/src/test/java/org/qi4j/runtime/mixin/MixinPrecedenceTest.java
+++ b/core/runtime/src/test/java/org/qi4j/runtime/mixin/MixinPrecedenceTest.java
@@ -28,7 +28,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertThat;
 
 /**
- * Test mixin declaration precedence satisfiedBy
+ * Test mixin declaration precedence test
  */
 public class MixinPrecedenceTest
     extends AbstractQi4jTest

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/runtime/src/test/java/org/qi4j/runtime/property/PropertyTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/runtime/property/PropertyTest.java b/core/runtime/src/test/java/org/qi4j/runtime/property/PropertyTest.java
index ea2a319..3f2eba4 100644
--- a/core/runtime/src/test/java/org/qi4j/runtime/property/PropertyTest.java
+++ b/core/runtime/src/test/java/org/qi4j/runtime/property/PropertyTest.java
@@ -35,7 +35,7 @@ import static org.junit.Assert.assertEquals;
  * Tests for properties
  */
 //@Ignore(
-//    "This is an incorrect satisfiedBy case. The Property fragment support is not well defined at the moment, so until" +
+//    "This is an incorrect test case. The Property fragment support is not well defined at the moment, so until" +
 //    "more work is finalized on exactly what should be supported, this is ignored not to be forgotten." )
 public class PropertyTest
     extends AbstractQi4jTest

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/runtime/src/test/java/org/qi4j/runtime/structure/ModuleTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/runtime/structure/ModuleTest.java b/core/runtime/src/test/java/org/qi4j/runtime/structure/ModuleTest.java
index d9e14f2..ef7e4ed 100644
--- a/core/runtime/src/test/java/org/qi4j/runtime/structure/ModuleTest.java
+++ b/core/runtime/src/test/java/org/qi4j/runtime/structure/ModuleTest.java
@@ -33,7 +33,7 @@ import static org.hamcrest.CoreMatchers.equalTo;
 import static org.junit.Assert.assertThat;
 
 /**
- * Test of the Module interface. This should satisfiedBy both the general interface and all possible visibility
+ * Test of the Module interface. This should test both the general interface and all possible visibility
  * rules.
  */
 public class ModuleTest

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/runtime/src/test/java/org/qi4j/test/ASMTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/test/ASMTest.java b/core/runtime/src/test/java/org/qi4j/test/ASMTest.java
index 797fc0a..9bda4cb 100644
--- a/core/runtime/src/test/java/org/qi4j/test/ASMTest.java
+++ b/core/runtime/src/test/java/org/qi4j/test/ASMTest.java
@@ -165,8 +165,8 @@ public class ASMTest
         MethodVisitor mv;
         AnnotationVisitor av0;
 
-        cw.visit( V1_6, ACC_PUBLIC + ACC_SUPER, "org/qi4j/satisfiedBy/SomeMixin_Stub", null,
-                  "org/qi4j/satisfiedBy/SomeMixin", null );
+        cw.visit( V1_6, ACC_PUBLIC + ACC_SUPER, "org/qi4j/test/SomeMixin_Stub", null,
+                  "org/qi4j/test/SomeMixin", null );
 
         {
             fv = cw.visitField( ACC_PUBLIC, "_instance", "Lorg/qi4j/spi/composite/CompositeInvoker;", null, null );
@@ -196,7 +196,7 @@ public class ASMTest
             mv = cw.visitMethod( ACC_PUBLIC, "<init>", "()V", null, null );
             mv.visitCode();
             mv.visitVarInsn( ALOAD, 0 );
-            mv.visitMethodInsn( INVOKESPECIAL, "org/qi4j/satisfiedBy/SomeMixin", "<init>", "()V" );
+            mv.visitMethodInsn( INVOKESPECIAL, "org/qi4j/test/SomeMixin", "<init>", "()V" );
             mv.visitInsn( RETURN );
             mv.visitMaxs( 1, 1 );
             mv.visitEnd();
@@ -206,7 +206,7 @@ public class ASMTest
             mv.visitCode();
             mv.visitVarInsn( ALOAD, 0 );
             mv.visitVarInsn( ALOAD, 1 );
-            mv.visitMethodInsn( INVOKESPECIAL, "org/qi4j/satisfiedBy/SomeMixin", "<init>", "(Ljava/lang/String;)V" );
+            mv.visitMethodInsn( INVOKESPECIAL, "org/qi4j/test/SomeMixin", "<init>", "(Ljava/lang/String;)V" );
             mv.visitInsn( RETURN );
             mv.visitMaxs( 2, 2 );
             mv.visitEnd();
@@ -220,9 +220,9 @@ public class ASMTest
             mv.visitTryCatchBlock( l0, l1, l2, "java/lang/Throwable" );
             mv.visitLabel( l0 );
             mv.visitVarInsn( ALOAD, 0 );
-            mv.visitFieldInsn( GETFIELD, "org/qi4j/satisfiedBy/SomeMixin_Stub", "_instance",
+            mv.visitFieldInsn( GETFIELD, "org/qi4j/test/SomeMixin_Stub", "_instance",
                                "Lorg/qi4j/spi/composite/CompositeInvoker;" );
-            mv.visitFieldInsn( GETSTATIC, "org/qi4j/satisfiedBy/SomeMixin_Stub", "m1", "Ljava/lang/reflect/Method;" );
+            mv.visitFieldInsn( GETSTATIC, "org/qi4j/test/SomeMixin_Stub", "m1", "Ljava/lang/reflect/Method;" );
             mv.visitInsn( ACONST_NULL );
             mv.visitMethodInsn( INVOKEINTERFACE, "org/qi4j/spi/composite/CompositeInvoker", "invokeComposite",
                                 "(Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;" );
@@ -253,9 +253,9 @@ public class ASMTest
             mv.visitTryCatchBlock( l0, l1, l3, "java/lang/Throwable" );
             mv.visitLabel( l0 );
             mv.visitVarInsn( ALOAD, 0 );
-            mv.visitFieldInsn( GETFIELD, "org/qi4j/satisfiedBy/SomeMixin_Stub", "_instance",
+            mv.visitFieldInsn( GETFIELD, "org/qi4j/test/SomeMixin_Stub", "_instance",
                                "Lorg/qi4j/spi/composite/CompositeInvoker;" );
-            mv.visitFieldInsn( GETSTATIC, "org/qi4j/satisfiedBy/SomeMixin_Stub", "m2", "Ljava/lang/reflect/Method;" );
+            mv.visitFieldInsn( GETSTATIC, "org/qi4j/test/SomeMixin_Stub", "m2", "Ljava/lang/reflect/Method;" );
             mv.visitInsn( ICONST_2 );
             mv.visitTypeInsn( ANEWARRAY, "java/lang/Object" );
             mv.visitInsn( DUP );
@@ -298,9 +298,9 @@ public class ASMTest
             mv.visitTryCatchBlock( l0, l1, l2, "java/lang/Throwable" );
             mv.visitLabel( l0 );
             mv.visitVarInsn( ALOAD, 0 );
-            mv.visitFieldInsn( GETFIELD, "org/qi4j/satisfiedBy/SomeMixin_Stub", "_instance",
+            mv.visitFieldInsn( GETFIELD, "org/qi4j/test/SomeMixin_Stub", "_instance",
                                "Lorg/qi4j/spi/composite/CompositeInvoker;" );
-            mv.visitFieldInsn( GETSTATIC, "org/qi4j/satisfiedBy/SomeMixin_Stub", "m3", "Ljava/lang/reflect/Method;" );
+            mv.visitFieldInsn( GETSTATIC, "org/qi4j/test/SomeMixin_Stub", "m3", "Ljava/lang/reflect/Method;" );
             mv.visitIntInsn( BIPUSH, 11 );
             mv.visitTypeInsn( ANEWARRAY, "java/lang/Object" );
             mv.visitInsn( DUP );
@@ -378,21 +378,21 @@ public class ASMTest
         }
         {
             mv = cw.visitMethod( ACC_PUBLIC, "multiEx", "(Ljava/lang/String;)V", null,
-                                 new String[]{ "org/qi4j/satisfiedBy/Exception1", "org/qi4j/satisfiedBy/Exception2" } );
+                                 new String[]{ "org/qi4j/test/Exception1", "org/qi4j/test/Exception2" } );
             mv.visitCode();
             Label l0 = new Label();
             Label l1 = new Label();
             Label l2 = new Label();
-            mv.visitTryCatchBlock( l0, l1, l2, "org/qi4j/satisfiedBy/Exception1" );
+            mv.visitTryCatchBlock( l0, l1, l2, "org/qi4j/test/Exception1" );
             Label l3 = new Label();
-            mv.visitTryCatchBlock( l0, l1, l3, "org/qi4j/satisfiedBy/Exception2" );
+            mv.visitTryCatchBlock( l0, l1, l3, "org/qi4j/test/Exception2" );
             Label l4 = new Label();
             mv.visitTryCatchBlock( l0, l1, l4, "java/lang/Throwable" );
             mv.visitLabel( l0 );
             mv.visitVarInsn( ALOAD, 0 );
-            mv.visitFieldInsn( GETFIELD, "org/qi4j/satisfiedBy/SomeMixin_Stub", "_instance",
+            mv.visitFieldInsn( GETFIELD, "org/qi4j/test/SomeMixin_Stub", "_instance",
                                "Lorg/qi4j/spi/composite/CompositeInvoker;" );
-            mv.visitFieldInsn( GETSTATIC, "org/qi4j/satisfiedBy/SomeMixin_Stub", "m4", "Ljava/lang/reflect/Method;" );
+            mv.visitFieldInsn( GETSTATIC, "org/qi4j/test/SomeMixin_Stub", "m4", "Ljava/lang/reflect/Method;" );
             mv.visitInsn( ICONST_1 );
             mv.visitTypeInsn( ANEWARRAY, "java/lang/Object" );
             mv.visitInsn( DUP );
@@ -406,12 +406,12 @@ public class ASMTest
             Label l5 = new Label();
             mv.visitJumpInsn( GOTO, l5 );
             mv.visitLabel( l2 );
-            mv.visitFrame( Opcodes.F_SAME1, 0, null, 1, new Object[]{ "org/qi4j/satisfiedBy/Exception1" } );
+            mv.visitFrame( Opcodes.F_SAME1, 0, null, 1, new Object[]{ "org/qi4j/test/Exception1" } );
             mv.visitVarInsn( ASTORE, 2 );
             mv.visitVarInsn( ALOAD, 2 );
             mv.visitInsn( ATHROW );
             mv.visitLabel( l3 );
-            mv.visitFrame( Opcodes.F_SAME1, 0, null, 1, new Object[]{ "org/qi4j/satisfiedBy/Exception2" } );
+            mv.visitFrame( Opcodes.F_SAME1, 0, null, 1, new Object[]{ "org/qi4j/test/Exception2" } );
             mv.visitVarInsn( ASTORE, 2 );
             mv.visitVarInsn( ALOAD, 2 );
             mv.visitInsn( ATHROW );
@@ -439,9 +439,9 @@ public class ASMTest
             mv.visitTryCatchBlock( l0, l1, l2, "java/lang/Throwable" );
             mv.visitLabel( l0 );
             mv.visitVarInsn( ALOAD, 0 );
-            mv.visitFieldInsn( GETFIELD, "org/qi4j/satisfiedBy/SomeMixin_Stub", "_instance",
+            mv.visitFieldInsn( GETFIELD, "org/qi4j/test/SomeMixin_Stub", "_instance",
                                "Lorg/qi4j/spi/composite/CompositeInvoker;" );
-            mv.visitFieldInsn( GETSTATIC, "org/qi4j/satisfiedBy/SomeMixin_Stub", "m5", "Ljava/lang/reflect/Method;" );
+            mv.visitFieldInsn( GETSTATIC, "org/qi4j/test/SomeMixin_Stub", "m5", "Ljava/lang/reflect/Method;" );
             mv.visitInsn( ACONST_NULL );
             mv.visitMethodInsn( INVOKEINTERFACE, "org/qi4j/spi/composite/CompositeInvoker", "invokeComposite",
                                 "(Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;" );
@@ -469,14 +469,14 @@ public class ASMTest
             Label l2 = new Label();
             mv.visitTryCatchBlock( l0, l1, l2, "java/lang/NoSuchMethodException" );
             mv.visitLabel( l0 );
-            mv.visitLdcInsn( Type.getType( "Lorg/qi4j/satisfiedBy/Other;" ) );
+            mv.visitLdcInsn( Type.getType( "Lorg/qi4j/test/Other;" ) );
             mv.visitLdcInsn( "other" );
             mv.visitInsn( ICONST_0 );
             mv.visitTypeInsn( ANEWARRAY, "java/lang/Class" );
             mv.visitMethodInsn( INVOKEVIRTUAL, "java/lang/Class", "getMethod",
                                 "(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;" );
-            mv.visitFieldInsn( PUTSTATIC, "org/qi4j/satisfiedBy/SomeMixin_Stub", "m1", "Ljava/lang/reflect/Method;" );
-            mv.visitLdcInsn( Type.getType( "Lorg/qi4j/satisfiedBy/Other;" ) );
+            mv.visitFieldInsn( PUTSTATIC, "org/qi4j/test/SomeMixin_Stub", "m1", "Ljava/lang/reflect/Method;" );
+            mv.visitLdcInsn( Type.getType( "Lorg/qi4j/test/Other;" ) );
             mv.visitLdcInsn( "foo" );
             mv.visitInsn( ICONST_2 );
             mv.visitTypeInsn( ANEWARRAY, "java/lang/Class" );
@@ -490,8 +490,8 @@ public class ASMTest
             mv.visitInsn( AASTORE );
             mv.visitMethodInsn( INVOKEVIRTUAL, "java/lang/Class", "getMethod",
                                 "(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;" );
-            mv.visitFieldInsn( PUTSTATIC, "org/qi4j/satisfiedBy/SomeMixin_Stub", "m2", "Ljava/lang/reflect/Method;" );
-            mv.visitLdcInsn( Type.getType( "Lorg/qi4j/satisfiedBy/Other;" ) );
+            mv.visitFieldInsn( PUTSTATIC, "org/qi4j/test/SomeMixin_Stub", "m2", "Ljava/lang/reflect/Method;" );
+            mv.visitLdcInsn( Type.getType( "Lorg/qi4j/test/Other;" ) );
             mv.visitLdcInsn( "bar" );
             mv.visitIntInsn( BIPUSH, 11 );
             mv.visitTypeInsn( ANEWARRAY, "java/lang/Class" );
@@ -541,8 +541,8 @@ public class ASMTest
             mv.visitInsn( AASTORE );
             mv.visitMethodInsn( INVOKEVIRTUAL, "java/lang/Class", "getMethod",
                                 "(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;" );
-            mv.visitFieldInsn( PUTSTATIC, "org/qi4j/satisfiedBy/SomeMixin_Stub", "m3", "Ljava/lang/reflect/Method;" );
-            mv.visitLdcInsn( Type.getType( "Lorg/qi4j/satisfiedBy/Other;" ) );
+            mv.visitFieldInsn( PUTSTATIC, "org/qi4j/test/SomeMixin_Stub", "m3", "Ljava/lang/reflect/Method;" );
+            mv.visitLdcInsn( Type.getType( "Lorg/qi4j/test/Other;" ) );
             mv.visitLdcInsn( "multiEx" );
             mv.visitInsn( ICONST_1 );
             mv.visitTypeInsn( ANEWARRAY, "java/lang/Class" );
@@ -552,14 +552,14 @@ public class ASMTest
             mv.visitInsn( AASTORE );
             mv.visitMethodInsn( INVOKEVIRTUAL, "java/lang/Class", "getMethod",
                                 "(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;" );
-            mv.visitFieldInsn( PUTSTATIC, "org/qi4j/satisfiedBy/SomeMixin_Stub", "m4", "Ljava/lang/reflect/Method;" );
-            mv.visitLdcInsn( Type.getType( "Lorg/qi4j/satisfiedBy/Other;" ) );
+            mv.visitFieldInsn( PUTSTATIC, "org/qi4j/test/SomeMixin_Stub", "m4", "Ljava/lang/reflect/Method;" );
+            mv.visitLdcInsn( Type.getType( "Lorg/qi4j/test/Other;" ) );
             mv.visitLdcInsn( "unwrapResult" );
             mv.visitInsn( ICONST_0 );
             mv.visitTypeInsn( ANEWARRAY, "java/lang/Class" );
             mv.visitMethodInsn( INVOKEVIRTUAL, "java/lang/Class", "getMethod",
                                 "(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;" );
-            mv.visitFieldInsn( PUTSTATIC, "org/qi4j/satisfiedBy/SomeMixin_Stub", "m5", "Ljava/lang/reflect/Method;" );
+            mv.visitFieldInsn( PUTSTATIC, "org/qi4j/test/SomeMixin_Stub", "m5", "Ljava/lang/reflect/Method;" );
             mv.visitLabel( l1 );
             Label l3 = new Label();
             mv.visitJumpInsn( GOTO, l3 );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/runtime/src/test/java/org/qi4j/test/composite/CleanStackTraceTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/test/composite/CleanStackTraceTest.java b/core/runtime/src/test/java/org/qi4j/test/composite/CleanStackTraceTest.java
index 7d0d322..1c01597 100644
--- a/core/runtime/src/test/java/org/qi4j/test/composite/CleanStackTraceTest.java
+++ b/core/runtime/src/test/java/org/qi4j/test/composite/CleanStackTraceTest.java
@@ -35,7 +35,7 @@ import static org.junit.Assume.assumeTrue;
 /**
  * Test if the stacktrace is cleaned up properly.
  * <p>
- * NOTE: This satisfiedBy MUST NOT be inside package org.qi4j.runtime, or it will fail.
+ * NOTE: This test MUST NOT be inside package org.qi4j.runtime, or it will fail.
  * </p>
  */
 public class CleanStackTraceTest
@@ -61,7 +61,7 @@ public class CleanStackTraceTest
     @Test
     public void cleanStackTraceOnApplicationException()
     {
-        // Don't run the satisfiedBy if compacttrace is set to anything else but proxy
+        // Don't run the test if compacttrace is set to anything else but proxy
         String compactTracePropertyValue = System.getProperty( "qi4j.compacttrace" );
         if( compactTracePropertyValue != null && !"proxy".equals( compactTracePropertyValue ) )
         {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/spi/src/main/java/org/qi4j/spi/entity/QualifiedIdentity.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/qi4j/spi/entity/QualifiedIdentity.java b/core/spi/src/main/java/org/qi4j/spi/entity/QualifiedIdentity.java
index 71defc5..0d846a9 100644
--- a/core/spi/src/main/java/org/qi4j/spi/entity/QualifiedIdentity.java
+++ b/core/spi/src/main/java/org/qi4j/spi/entity/QualifiedIdentity.java
@@ -61,9 +61,8 @@ public final class QualifiedIdentity
 
     public QualifiedIdentity( EntityComposite entityComposite )
     {
-        this( entityComposite.identity().get(), first( Qi4j.FUNCTION_DESCRIPTOR_FOR
-                                                           .map( entityComposite )
-                                                           .types() ).getName() );
+        this( entityComposite.identity().get(),
+              first( Qi4j.FUNCTION_DESCRIPTOR_FOR.apply( entityComposite ).types() ).getName() );
     }
 
     public QualifiedIdentity( String identity, Class<?> clazz )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/spi/src/main/java/org/qi4j/spi/entitystore/helpers/DefaultEntityState.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/qi4j/spi/entitystore/helpers/DefaultEntityState.java b/core/spi/src/main/java/org/qi4j/spi/entitystore/helpers/DefaultEntityState.java
index e7938c3..178ecc6 100644
--- a/core/spi/src/main/java/org/qi4j/spi/entitystore/helpers/DefaultEntityState.java
+++ b/core/spi/src/main/java/org/qi4j/spi/entitystore/helpers/DefaultEntityState.java
@@ -213,7 +213,7 @@ public final class DefaultEntityState
     @Override
     public boolean isAssignableTo( Class<?> type )
     {
-        return Classes.exactTypeSpecification( type ).satisfiedBy( entityDescriptor );
+        return Classes.exactTypeSpecification( type ).test( entityDescriptor );
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/spi/src/main/java/org/qi4j/spi/query/EntityFinder.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/qi4j/spi/query/EntityFinder.java b/core/spi/src/main/java/org/qi4j/spi/query/EntityFinder.java
index d00a99d..8a53a1b 100644
--- a/core/spi/src/main/java/org/qi4j/spi/query/EntityFinder.java
+++ b/core/spi/src/main/java/org/qi4j/spi/query/EntityFinder.java
@@ -19,11 +19,11 @@
 package org.qi4j.spi.query;
 
 import java.util.Map;
+import java.util.function.Predicate;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.composite.Composite;
 import org.qi4j.api.entity.EntityReference;
 import org.qi4j.api.query.grammar.OrderBy;
-import org.qi4j.functional.Specification;
 
 /**
  * Entity Finder.
@@ -42,7 +42,7 @@ public interface EntityFinder
      * @return Single entity matching the query criterion.
      */
     Iterable<EntityReference> findEntities( Class<?> resultType,
-                                            @Optional Specification<Composite> whereClause,
+                                            @Optional Predicate<Composite> whereClause,
                                             @Optional OrderBy[] orderBySegments,
                                             @Optional Integer firstResult,
                                             @Optional Integer maxResults,
@@ -59,7 +59,7 @@ public interface EntityFinder
      * @return Single entity matching the query criterion.
      */
     EntityReference findEntity( Class<?> resultType,
-                                @Optional Specification<Composite> whereClause,
+                                @Optional Predicate<Composite> whereClause,
                                 Map<String, Object> variables
     )
         throws EntityFinderException;
@@ -73,7 +73,7 @@ public interface EntityFinder
      * @return Count entities matching the query criterion.
      */
     long countEntities( Class<?> resultType,
-                        @Optional Specification<Composite> whereClause,
+                        @Optional Predicate<Composite> whereClause,
                         Map<String, Object> variables
     )
         throws EntityFinderException;

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/spi/src/main/java/org/qi4j/spi/query/QuerySource.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/qi4j/spi/query/QuerySource.java b/core/spi/src/main/java/org/qi4j/spi/query/QuerySource.java
index 35a3661..15894b7 100644
--- a/core/spi/src/main/java/org/qi4j/spi/query/QuerySource.java
+++ b/core/spi/src/main/java/org/qi4j/spi/query/QuerySource.java
@@ -2,9 +2,9 @@ package org.qi4j.spi.query;
 
 import java.util.Iterator;
 import java.util.Map;
+import java.util.function.Predicate;
 import org.qi4j.api.composite.Composite;
 import org.qi4j.api.query.grammar.OrderBy;
-import org.qi4j.functional.Specification;
 
 /**
  * Query Source, used in QueryBuilder SPI.
@@ -12,7 +12,7 @@ import org.qi4j.functional.Specification;
 public interface QuerySource
 {
     <T> T find( Class<T> resultType,
-                Specification<Composite> whereClause,
+                Predicate<Composite> whereClause,
                 Iterable<OrderBy> orderBySegments,
                 Integer firstResult,
                 Integer maxResults,
@@ -20,7 +20,7 @@ public interface QuerySource
     );
 
     <T> long count( Class<T> resultType,
-                    Specification<Composite> whereClause,
+                    Predicate<Composite> whereClause,
                     Iterable<OrderBy> orderBySegments,
                     Integer firstResult,
                     Integer maxResults,
@@ -28,7 +28,7 @@ public interface QuerySource
     );
 
     <T> Iterator<T> iterator( Class<T> resultType,
-                              Specification<Composite> whereClause,
+                              Predicate<Composite> whereClause,
                               Iterable<OrderBy> orderBySegments,
                               Integer firstResult,
                               Integer maxResults,

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/spi/src/main/java/org/qi4j/spi/value/ValueDeserializerAdapter.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/qi4j/spi/value/ValueDeserializerAdapter.java b/core/spi/src/main/java/org/qi4j/spi/value/ValueDeserializerAdapter.java
index 73056fe..ce01787 100644
--- a/core/spi/src/main/java/org/qi4j/spi/value/ValueDeserializerAdapter.java
+++ b/core/spi/src/main/java/org/qi4j/spi/value/ValueDeserializerAdapter.java
@@ -32,6 +32,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.Scanner;
 import java.util.Set;
+import java.util.function.BiFunction;
+import java.util.function.Function;
 import org.joda.time.DateTime;
 import org.joda.time.LocalDate;
 import org.joda.time.LocalDateTime;
@@ -54,8 +56,6 @@ import org.qi4j.api.value.ValueBuilder;
 import org.qi4j.api.value.ValueDescriptor;
 import org.qi4j.api.value.ValueDeserializer;
 import org.qi4j.api.value.ValueSerializationException;
-import org.qi4j.functional.Function;
-import org.qi4j.functional.Function2;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -158,7 +158,7 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
         registerDeserializer( String.class, new Function<Object, String>()
         {
             @Override
-            public String map( Object input )
+            public String apply( Object input )
             {
                 return input.toString();
             }
@@ -166,7 +166,7 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
         registerDeserializer( Character.class, new Function<Object, Character>()
         {
             @Override
-            public Character map( Object input )
+            public Character apply( Object input )
             {
                 return input.toString().charAt( 0 );
             }
@@ -174,7 +174,7 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
         registerDeserializer( Boolean.class, new Function<Object, Boolean>()
         {
             @Override
-            public Boolean map( Object input )
+            public Boolean apply( Object input )
             {
                 return ( input instanceof String )
                        ? Boolean.parseBoolean( (String) input )
@@ -184,7 +184,7 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
         registerDeserializer( Integer.class, new Function<Object, Integer>()
         {
             @Override
-            public Integer map( Object input )
+            public Integer apply( Object input )
             {
                 return ( input instanceof String )
                        ? Integer.parseInt( (String) input )
@@ -194,7 +194,7 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
         registerDeserializer( Long.class, new Function<Object, Long>()
         {
             @Override
-            public Long map( Object input )
+            public Long apply( Object input )
             {
                 return ( input instanceof String )
                        ? Long.parseLong( (String) input )
@@ -204,7 +204,7 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
         registerDeserializer( Short.class, new Function<Object, Short>()
         {
             @Override
-            public Short map( Object input )
+            public Short apply( Object input )
             {
                 return ( input instanceof String )
                        ? Short.parseShort( (String) input )
@@ -214,7 +214,7 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
         registerDeserializer( Byte.class, new Function<Object, Byte>()
         {
             @Override
-            public Byte map( Object input )
+            public Byte apply( Object input )
             {
                 return ( input instanceof String )
                        ? Byte.parseByte( (String) input )
@@ -224,7 +224,7 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
         registerDeserializer( Float.class, new Function<Object, Float>()
         {
             @Override
-            public Float map( Object input )
+            public Float apply( Object input )
             {
                 return ( input instanceof String )
                        ? Float.parseFloat( (String) input )
@@ -234,7 +234,7 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
         registerDeserializer( Double.class, new Function<Object, Double>()
         {
             @Override
-            public Double map( Object input )
+            public Double apply( Object input )
             {
                 return ( input instanceof String )
                        ? Double.parseDouble( (String) input )
@@ -246,7 +246,7 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
         registerDeserializer( BigDecimal.class, new Function<Object, BigDecimal>()
         {
             @Override
-            public BigDecimal map( Object input )
+            public BigDecimal apply( Object input )
             {
                 return new BigDecimal( input.toString() );
             }
@@ -254,7 +254,7 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
         registerDeserializer( BigInteger.class, new Function<Object, BigInteger>()
         {
             @Override
-            public BigInteger map( Object input )
+            public BigInteger apply( Object input )
             {
                 return new BigInteger( input.toString() );
             }
@@ -264,7 +264,7 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
         registerDeserializer( Date.class, new Function<Object, Date>()
         {
             @Override
-            public Date map( Object input )
+            public Date apply( Object input )
             {
                 return Dates.fromString( input.toString() );
             }
@@ -272,7 +272,7 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
         registerDeserializer( DateTime.class, new Function<Object, DateTime>()
         {
             @Override
-            public DateTime map( Object input )
+            public DateTime apply( Object input )
             {
                 return DateTime.parse( input.toString() );
             }
@@ -280,7 +280,7 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
         registerDeserializer( LocalDateTime.class, new Function<Object, LocalDateTime>()
         {
             @Override
-            public LocalDateTime map( Object input )
+            public LocalDateTime apply( Object input )
             {
                 return new LocalDateTime( input );
             }
@@ -288,7 +288,7 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
         registerDeserializer( LocalDate.class, new Function<Object, LocalDate>()
         {
             @Override
-            public LocalDate map( Object input )
+            public LocalDate apply( Object input )
             {
                 return new LocalDate( input );
             }
@@ -298,7 +298,7 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
         registerDeserializer( EntityReference.class, new Function<Object, EntityReference>()
         {
             @Override
-            public EntityReference map( Object input )
+            public EntityReference apply( Object input )
             {
                 return EntityReference.parseEntityReference( input.toString() );
             }
@@ -326,7 +326,7 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
             }
             else
             {
-                valuesModule = valuesModuleFinder.map( application );
+                valuesModule = valuesModuleFinder.apply( application );
                 if( valuesModule == null )
                 {
                     throw new ValueSerializationException( "Values Module provided by the finder Function was null." );
@@ -356,23 +356,16 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
     @Override
     public final <T> Function<String, T> deserialize( final ValueType valueType )
     {
-        return new Function<String, T>()
-        {
-            @Override
-            public T map( String input )
-            {
-                return deserialize( valueType, input );
-            }
-        };
+        return input -> deserialize( valueType, input );
     }
 
     @Override
-    public final <T> Function2<ValueType, String, T> deserialize()
+    public final <T> BiFunction<ValueType, String, T> deserialize()
     {
-        return new Function2<ValueType, String, T>()
+        return new BiFunction<ValueType, String, T>()
         {
             @Override
-            public T map( ValueType valueType, String input )
+            public T apply( ValueType valueType, String input )
             {
                 return deserialize( valueType, input );
             }
@@ -463,7 +456,7 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
                 return String.class.equals( type ) ? (T) "" : null;
             }
             String string = scanner.next();
-            return (T) deserializers.get( type ).map( string );
+            return (T) deserializers.get( type ).apply( string );
         }
         else // Array ValueType
         if( type.isArray() )
@@ -499,7 +492,7 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
             {
                 return null;
             }
-            return (T) deserializers.get( type ).map( value );
+            return (T) deserializers.get( type ).apply( value );
         }
         else if( complexDeserializers.get( type ) != null )
         {
@@ -544,7 +537,7 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
         return new Function<InputType, T>()
         {
             @Override
-            public T map( InputType input )
+            public T apply( InputType input )
             {
                 try
                 {
@@ -739,7 +732,7 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
         return new Function<InputNodeType, T>()
         {
             @Override
-            public T map( InputNodeType inputNode )
+            public T apply( InputNodeType inputNode )
             {
                 try
                 {
@@ -777,7 +770,7 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
             {
                 return null;
             }
-            return (T) deserializers.get( type ).map( value );
+            return (T) deserializers.get( type ).apply( value );
         }
         else if( complexDeserializers.get( type ) != null )
         {
@@ -822,7 +815,7 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
             new Function<PropertyDescriptor, Object>()
         {
             @Override
-            public Object map( PropertyDescriptor property )
+            public Object apply( PropertyDescriptor property )
             {
                 return stateMap.get( property.qualifiedName().name() );
             }
@@ -830,7 +823,7 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
             new Function<AssociationDescriptor, EntityReference>()
             {
                 @Override
-                public EntityReference map( AssociationDescriptor association )
+                public EntityReference apply( AssociationDescriptor association )
                 {
                     Object entityRef = stateMap.get( association.qualifiedName().name() );
                     if( entityRef == null )
@@ -844,7 +837,7 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
             {
                 @Override
                 @SuppressWarnings( "unchecked" )
-                public Iterable<EntityReference> map( AssociationDescriptor manyAssociation )
+                public Iterable<EntityReference> apply( AssociationDescriptor manyAssociation )
                 {
                     Object entityRefs = stateMap.get( manyAssociation.qualifiedName().name() );
                     if( entityRefs == null )
@@ -858,7 +851,7 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
             {
                 @Override
                 @SuppressWarnings( "unchecked" )
-                public Map<String, EntityReference> map( AssociationDescriptor namedAssociation )
+                public Map<String, EntityReference> apply( AssociationDescriptor namedAssociation )
                 {
                     Object entityRefs = stateMap.get( namedAssociation.qualifiedName().name() );
                     if( entityRefs == null )


[43/50] [abbrv] zest-qi4j git commit: Compile bug fixed.

Posted by ni...@apache.org.
Compile bug fixed.


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/7f04a7c1
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/7f04a7c1
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/7f04a7c1

Branch: refs/heads/3.0
Commit: 7f04a7c175d25b6c214473f7bd9d806b824d34da
Parents: dc69fba
Author: Niclas Hedhman <ni...@hedhman.org>
Authored: Sat Oct 4 14:37:08 2014 +0800
Committer: Niclas Hedhman <ni...@hedhman.org>
Committed: Sat Oct 4 14:37:08 2014 +0800

----------------------------------------------------------------------
 core/api/src/main/java/org/qi4j/api/composite/DecoratorMixin.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/7f04a7c1/core/api/src/main/java/org/qi4j/api/composite/DecoratorMixin.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/composite/DecoratorMixin.java b/core/api/src/main/java/org/qi4j/api/composite/DecoratorMixin.java
index 045f5e7..d44d7c6 100644
--- a/core/api/src/main/java/org/qi4j/api/composite/DecoratorMixin.java
+++ b/core/api/src/main/java/org/qi4j/api/composite/DecoratorMixin.java
@@ -86,7 +86,7 @@ public class DecoratorMixin
         builder.append( "\ndelegateType: " );
         builder.append( delegate == null ? "n/a" : delegate.getClass().getName() );
         builder.append( "\narguments: \n" );
-        Arrays.stream(args).map( arg -> {
+        Arrays.stream(args).forEach( arg -> {
             builder.append( "    " );
             Class argClass = arg.getClass();
             if( Proxy.isProxyClass( argClass ) )


[46/50] [abbrv] zest-qi4j git commit: Start experiment with Sream and Function on our own classes.

Posted by ni...@apache.org.
Start experiment with Sream and Function on our own classes.


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/caa62018
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/caa62018
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/caa62018

Branch: refs/heads/3.0
Commit: caa62018a19bee3673d2607c3f49664ac99e5316
Parents: 1dfbffc
Author: Niclas Hedhman <ni...@hedhman.org>
Authored: Sat Oct 4 17:15:27 2014 +0800
Committer: Niclas Hedhman <ni...@hedhman.org>
Committed: Sat Oct 4 17:15:27 2014 +0800

----------------------------------------------------------------------
 .../qi4j/api/association/ManyAssociation.java   |  3 ++
 .../api/association/ManyAssociationWrapper.java |  7 +++
 .../qi4j/api/association/NamedAssociation.java  |  2 +
 .../association/NamedAssociationWrapper.java    |  7 +++
 .../property/InvalidPropertyTypeException.java  |  6 ++-
 .../java/org/qi4j/api/property/Numbers.java     | 21 +++++++-
 .../java/org/qi4j/api/property/Property.java    | 13 +++++
 .../runtime/association/GenericSpliterator.java | 40 ++++++++++++++
 .../association/ManyAssociationInstance.java    | 14 +++++
 .../association/NamedAssociationInstance.java   | 56 ++++++++++++++++++--
 .../qi4j/spi/entity/NamedAssociationState.java  |  1 +
 .../samples/forum/context/view/ViewBoard.java   |  3 +-
 .../samples/forum/context/view/ViewPost.java    |  3 +-
 .../binding/internal/BoundManyAssociation.java  |  9 +++-
 .../binding/internal/BoundNamedAssociation.java |  8 +++
 15 files changed, 182 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/caa62018/core/api/src/main/java/org/qi4j/api/association/ManyAssociation.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/association/ManyAssociation.java b/core/api/src/main/java/org/qi4j/api/association/ManyAssociation.java
index 707d53a..0e1134d 100644
--- a/core/api/src/main/java/org/qi4j/api/association/ManyAssociation.java
+++ b/core/api/src/main/java/org/qi4j/api/association/ManyAssociation.java
@@ -16,6 +16,7 @@ package org.qi4j.api.association;
 
 import java.util.List;
 import java.util.Set;
+import java.util.stream.Stream;
 
 /**
  * Association to a collection of entities.
@@ -37,4 +38,6 @@ public interface ManyAssociation<T> extends Iterable<T>, AbstractAssociation
     List<T> toList();
 
     Set<T> toSet();
+
+    Stream<T> stream();
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/caa62018/core/api/src/main/java/org/qi4j/api/association/ManyAssociationWrapper.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/association/ManyAssociationWrapper.java b/core/api/src/main/java/org/qi4j/api/association/ManyAssociationWrapper.java
index 748af83..85e7bce 100644
--- a/core/api/src/main/java/org/qi4j/api/association/ManyAssociationWrapper.java
+++ b/core/api/src/main/java/org/qi4j/api/association/ManyAssociationWrapper.java
@@ -3,6 +3,7 @@ package org.qi4j.api.association;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
+import java.util.stream.Stream;
 
 /**
  * If you want to catch calls to ManyAssociations, then create a GenericConcern
@@ -73,6 +74,12 @@ public class ManyAssociationWrapper
     }
 
     @Override
+    public Stream<Object> stream()
+    {
+        return next.stream();
+    }
+
+    @Override
     public Iterator<Object> iterator()
     {
         return next.iterator();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/caa62018/core/api/src/main/java/org/qi4j/api/association/NamedAssociation.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/association/NamedAssociation.java b/core/api/src/main/java/org/qi4j/api/association/NamedAssociation.java
index e8abe32..86a61a6 100644
--- a/core/api/src/main/java/org/qi4j/api/association/NamedAssociation.java
+++ b/core/api/src/main/java/org/qi4j/api/association/NamedAssociation.java
@@ -19,6 +19,7 @@
 package org.qi4j.api.association;
 
 import java.util.Map;
+import java.util.stream.Stream;
 
 /**
  * Association to named Entities.
@@ -75,4 +76,5 @@ public interface NamedAssociation<T>
      */
     Map<String, T> toMap();
 
+    Stream<Map.Entry<String,T>> stream();
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/caa62018/core/api/src/main/java/org/qi4j/api/association/NamedAssociationWrapper.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/association/NamedAssociationWrapper.java b/core/api/src/main/java/org/qi4j/api/association/NamedAssociationWrapper.java
index 581948e..a033cae 100644
--- a/core/api/src/main/java/org/qi4j/api/association/NamedAssociationWrapper.java
+++ b/core/api/src/main/java/org/qi4j/api/association/NamedAssociationWrapper.java
@@ -20,6 +20,7 @@ package org.qi4j.api.association;
 
 import java.util.Iterator;
 import java.util.Map;
+import java.util.stream.Stream;
 
 /**
  * If you want to catch calls to NamedAssociations, then create a GenericConcern
@@ -90,6 +91,12 @@ public class NamedAssociationWrapper
     }
 
     @Override
+    public Stream<Map.Entry<String, Object>> stream()
+    {
+        return next.stream();
+    }
+
+    @Override
     public int hashCode()
     {
         return next.hashCode();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/caa62018/core/api/src/main/java/org/qi4j/api/property/InvalidPropertyTypeException.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/property/InvalidPropertyTypeException.java b/core/api/src/main/java/org/qi4j/api/property/InvalidPropertyTypeException.java
index c98007e..6c81509 100644
--- a/core/api/src/main/java/org/qi4j/api/property/InvalidPropertyTypeException.java
+++ b/core/api/src/main/java/org/qi4j/api/property/InvalidPropertyTypeException.java
@@ -16,7 +16,11 @@ public class InvalidPropertyTypeException extends ConstructionException
     private static String createMessage( AccessibleObject accessor )
     {
         StringBuilder builder = new StringBuilder();
-        builder.append( "Not allowed to subclass " + Property.class.getName() + ". Property accessor " + accessor + " is returning a Property subclass." );
+        builder.append( "Not allowed to subclass " )
+            .append( Property.class.getName() )
+            .append( ". Property accessor " )
+            .append( accessor )
+            .append( " is returning a Property subclass." );
         return builder.toString();
     }
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/caa62018/core/api/src/main/java/org/qi4j/api/property/Numbers.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/property/Numbers.java b/core/api/src/main/java/org/qi4j/api/property/Numbers.java
index 00c0e5f..070dff0 100644
--- a/core/api/src/main/java/org/qi4j/api/property/Numbers.java
+++ b/core/api/src/main/java/org/qi4j/api/property/Numbers.java
@@ -15,6 +15,7 @@
 package org.qi4j.api.property;
 
 import java.math.BigDecimal;
+import java.util.function.Function;
 
 /**
  * Convenience class for mathematical operations on numerical properties.
@@ -24,8 +25,14 @@ import java.math.BigDecimal;
  */
 public final class Numbers
 {
-    // Integer operations
 
+    public static <T> Property<T> f( Property<T> property, Function<T,T> function )
+    {
+        property.set( function.apply( property.get() ));
+        return property;
+    }
+
+    // Integer operations
     public static Property<Integer> add( Property<Integer> property, int amount )
     {
         property.set( property.get() + amount );
@@ -50,6 +57,18 @@ public final class Numbers
         return property;
     }
 
+    public static Property<Integer> inc( Property<Integer> property )
+    {
+        property.set( property.get() + 1 );
+        return property;
+    }
+
+    public static Property<Integer> dec( Property<Integer> property )
+    {
+        property.set( property.get() - 1 );
+        return property;
+    }
+
     // Long operations
 
     public static Property<Long> add( Property<Long> property, long amount )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/caa62018/core/api/src/main/java/org/qi4j/api/property/Property.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/property/Property.java b/core/api/src/main/java/org/qi4j/api/property/Property.java
index 9c9cfa8..a40a126 100644
--- a/core/api/src/main/java/org/qi4j/api/property/Property.java
+++ b/core/api/src/main/java/org/qi4j/api/property/Property.java
@@ -17,6 +17,8 @@
  */
 package org.qi4j.api.property;
 
+import java.util.function.UnaryOperator;
+
 /**
  * Properties are declared in Composite interfaces by using this interface.
  * <p>
@@ -58,4 +60,15 @@ public interface Property<T>
      */
     void set( T newValue )
         throws IllegalArgumentException, IllegalStateException;
+
+    /**
+     * Applies the function to the property.
+     *
+     * @param function The input to the function is the current value, and the return value is the value to be set
+     *                 to the property.
+     */
+    default void f( UnaryOperator<T> function )
+    {
+        set( function.apply( get() ) );
+    }
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/caa62018/core/runtime/src/main/java/org/qi4j/runtime/association/GenericSpliterator.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/association/GenericSpliterator.java b/core/runtime/src/main/java/org/qi4j/runtime/association/GenericSpliterator.java
new file mode 100644
index 0000000..c51ee57
--- /dev/null
+++ b/core/runtime/src/main/java/org/qi4j/runtime/association/GenericSpliterator.java
@@ -0,0 +1,40 @@
+package org.qi4j.runtime.association;
+
+import java.util.Iterator;
+import java.util.Spliterator;
+import java.util.Spliterators;
+import java.util.function.Consumer;
+import java.util.function.Function;
+
+public class GenericSpliterator<T, R> extends Spliterators.AbstractSpliterator<R>
+{
+    private final Iterator<T> it;
+    private final Function<T, R> mapping;
+
+    public GenericSpliterator( Iterator<T> it, Function<T, R> mapping )
+    {
+        super( 0L, Spliterator.IMMUTABLE );
+        this.it = it;
+        if( mapping == null )
+        {
+            //noinspection unchecked
+            this.mapping = t -> (R) t;
+        }
+        else
+        {
+            this.mapping = mapping;
+        }
+    }
+
+    @Override
+    public boolean tryAdvance( Consumer<? super R> action )
+    {
+        if( it.hasNext() )
+        {
+            T value = it.next();
+            action.accept( mapping.apply( value ) );
+            return true;
+        }
+        return false;
+    }
+}

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/caa62018/core/runtime/src/main/java/org/qi4j/runtime/association/ManyAssociationInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/association/ManyAssociationInstance.java b/core/runtime/src/main/java/org/qi4j/runtime/association/ManyAssociationInstance.java
index b28b7cb..09eac1a 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/association/ManyAssociationInstance.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/association/ManyAssociationInstance.java
@@ -5,8 +5,14 @@ import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
+import java.util.Spliterator;
+import java.util.Spliterators;
 import java.util.function.BiFunction;
+import java.util.function.Consumer;
+import java.util.stream.Stream;
+import java.util.stream.StreamSupport;
 import org.qi4j.api.association.AssociationDescriptor;
 import org.qi4j.api.association.ManyAssociation;
 import org.qi4j.api.association.ManyAssociationWrapper;
@@ -111,6 +117,14 @@ public class ManyAssociationInstance<T>
     }
 
     @Override
+    public Stream<T> stream()
+    {
+        final Iterator<T> it = iterator();
+        Spliterator<T> entrySpliterator = new GenericSpliterator<>( it, null );
+        return StreamSupport.stream( entrySpliterator, false );
+    }
+
+    @Override
     public boolean equals( Object o )
     {
         if( this == o )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/caa62018/core/runtime/src/main/java/org/qi4j/runtime/association/NamedAssociationInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/association/NamedAssociationInstance.java b/core/runtime/src/main/java/org/qi4j/runtime/association/NamedAssociationInstance.java
index f606f79..d22be74 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/association/NamedAssociationInstance.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/association/NamedAssociationInstance.java
@@ -23,9 +23,10 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.function.BiFunction;
+import java.util.stream.Stream;
+import java.util.stream.StreamSupport;
 import org.qi4j.api.association.NamedAssociation;
 import org.qi4j.api.entity.EntityReference;
-import org.qi4j.runtime.composite.ConstraintsCheck;
 import org.qi4j.spi.entity.NamedAssociationState;
 
 public class NamedAssociationInstance<T>
@@ -37,7 +38,8 @@ public class NamedAssociationInstance<T>
 
     public NamedAssociationInstance( AssociationInfo associationInfo,
                                      BiFunction<EntityReference, Type, Object> associationFunction,
-                                     NamedAssociationState namedAssociationState )
+                                     NamedAssociationState namedAssociationState
+    )
     {
         super( associationInfo, associationFunction );
         this.namedAssociationState = namedAssociationState;
@@ -66,7 +68,7 @@ public class NamedAssociationInstance<T>
     {
         checkImmutable();
         checkType( entity );
-        ( (ConstraintsCheck) associationInfo ).checkConstraints( entity );
+        associationInfo.checkConstraints( entity );
         return namedAssociationState.put( name, getEntityReference( entity ) );
     }
 
@@ -80,7 +82,7 @@ public class NamedAssociationInstance<T>
     @Override
     public T get( String name )
     {
-        return getEntity( namedAssociationState.get( name ) );
+        return getEntityByName( name );
     }
 
     @Override
@@ -95,9 +97,53 @@ public class NamedAssociationInstance<T>
         Map<String, T> map = new HashMap<>();
         for( String name : namedAssociationState )
         {
-            map.put( name, getEntity( namedAssociationState.get( name ) ) );
+            map.put( name, getEntityByName( name ) );
         }
         return map;
     }
 
+    @Override
+    public Stream<Map.Entry<String, T>> stream()
+    {
+        final Iterator<String> it = namedAssociationState.iterator();
+        return StreamSupport.stream( new GenericSpliterator<>( it, key -> new Entry<>( key, getEntityByName( key ) ) ),
+                                     false );
+    }
+
+    private T getEntityByName( String name )
+    {
+        return getEntity( namedAssociationState.get( name ) );
+    }
+
+    private static final class Entry<K, V>
+        implements Map.Entry<K, V>
+    {
+
+        private final K key;
+        private final V value;
+
+        private Entry( K key, V value )
+        {
+            this.key = key;
+            this.value = value;
+        }
+
+        @Override
+        public K getKey()
+        {
+            return key;
+        }
+
+        @Override
+        public V getValue()
+        {
+            return value;
+        }
+
+        @Override
+        public V setValue( V value )
+        {
+            throw new UnsupportedOperationException();
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/caa62018/core/spi/src/main/java/org/qi4j/spi/entity/NamedAssociationState.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/qi4j/spi/entity/NamedAssociationState.java b/core/spi/src/main/java/org/qi4j/spi/entity/NamedAssociationState.java
index 5cf3257..90790a2 100644
--- a/core/spi/src/main/java/org/qi4j/spi/entity/NamedAssociationState.java
+++ b/core/spi/src/main/java/org/qi4j/spi/entity/NamedAssociationState.java
@@ -18,6 +18,7 @@
  */
 package org.qi4j.spi.entity;
 
+import java.util.Spliterators;
 import org.qi4j.api.entity.EntityReference;
 
 /**

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/caa62018/samples/forum/src/main/java/org/qi4j/samples/forum/context/view/ViewBoard.java
----------------------------------------------------------------------
diff --git a/samples/forum/src/main/java/org/qi4j/samples/forum/context/view/ViewBoard.java b/samples/forum/src/main/java/org/qi4j/samples/forum/context/view/ViewBoard.java
index 120dcea..cc8829a 100644
--- a/samples/forum/src/main/java/org/qi4j/samples/forum/context/view/ViewBoard.java
+++ b/samples/forum/src/main/java/org/qi4j/samples/forum/context/view/ViewBoard.java
@@ -13,6 +13,7 @@ import org.qi4j.samples.forum.data.entity.Topic;
 import org.qi4j.samples.forum.data.entity.User;
 
 import static org.qi4j.api.property.Numbers.add;
+import static org.qi4j.api.property.Numbers.f;
 
 /**
  * TODO
@@ -94,7 +95,7 @@ public class ViewBoard
 
                 self.lastPost().set( post );
                 add( self.topicCount(), 1 );
-                add( self.postCount(), 1 );
+                f( self.postCount(), c -> c + 1 );
 
                 return topic;
             }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/caa62018/samples/forum/src/main/java/org/qi4j/samples/forum/context/view/ViewPost.java
----------------------------------------------------------------------
diff --git a/samples/forum/src/main/java/org/qi4j/samples/forum/context/view/ViewPost.java b/samples/forum/src/main/java/org/qi4j/samples/forum/context/view/ViewPost.java
index 45d4802..b060b29 100644
--- a/samples/forum/src/main/java/org/qi4j/samples/forum/context/view/ViewPost.java
+++ b/samples/forum/src/main/java/org/qi4j/samples/forum/context/view/ViewPost.java
@@ -3,7 +3,6 @@ package org.qi4j.samples.forum.context.view;
 import java.time.ZoneId;
 import org.qi4j.api.injection.scope.Structure;
 import org.qi4j.api.injection.scope.Uses;
-import org.qi4j.api.property.Numbers;
 import org.qi4j.api.structure.Module;
 import org.qi4j.library.rest.server.api.ResourceIndex;
 import org.qi4j.library.rest.server.api.dci.Role;
@@ -55,7 +54,7 @@ public class ViewPost
             post.replyTo().set( viewPost.self() );
 
             self().lastPost().set( post );
-            Numbers.add( self().postCount(), 1 );
+            self().postCount().f( c -> c + 1 );
 
             return post;
         }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/caa62018/samples/swing/src/main/java/org/qi4j/lib/swing/binding/internal/BoundManyAssociation.java
----------------------------------------------------------------------
diff --git a/samples/swing/src/main/java/org/qi4j/lib/swing/binding/internal/BoundManyAssociation.java b/samples/swing/src/main/java/org/qi4j/lib/swing/binding/internal/BoundManyAssociation.java
index a7dcb0f..a71cb4b 100644
--- a/samples/swing/src/main/java/org/qi4j/lib/swing/binding/internal/BoundManyAssociation.java
+++ b/samples/swing/src/main/java/org/qi4j/lib/swing/binding/internal/BoundManyAssociation.java
@@ -4,6 +4,7 @@ import java.lang.reflect.Method;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
+import java.util.stream.Stream;
 import org.qi4j.api.association.ManyAssociation;
 import org.qi4j.api.injection.scope.Service;
 import org.qi4j.api.injection.scope.Structure;
@@ -78,6 +79,12 @@ public class BoundManyAssociation<T> extends AbstractBinding<T>
     @Override
     public Iterator<T> iterator()
     {
-        return null;  //To change body of implemented methods use File | Settings | File Templates.
+        return actualAssociations.iterator();
+    }
+
+    @Override
+    public Stream<T> stream()
+    {
+        return actualAssociations.stream();
     }
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/caa62018/samples/swing/src/main/java/org/qi4j/lib/swing/binding/internal/BoundNamedAssociation.java
----------------------------------------------------------------------
diff --git a/samples/swing/src/main/java/org/qi4j/lib/swing/binding/internal/BoundNamedAssociation.java b/samples/swing/src/main/java/org/qi4j/lib/swing/binding/internal/BoundNamedAssociation.java
index 8e9f187..c5d6292 100644
--- a/samples/swing/src/main/java/org/qi4j/lib/swing/binding/internal/BoundNamedAssociation.java
+++ b/samples/swing/src/main/java/org/qi4j/lib/swing/binding/internal/BoundNamedAssociation.java
@@ -3,6 +3,7 @@ package org.qi4j.lib.swing.binding.internal;
 import java.lang.reflect.Method;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.stream.Stream;
 import org.qi4j.api.association.NamedAssociation;
 import org.qi4j.api.injection.scope.Service;
 import org.qi4j.api.injection.scope.Structure;
@@ -80,4 +81,11 @@ public class BoundNamedAssociation<T>
         return actualAssociations.iterator();
     }
 
+    @Override
+    public Stream<Map.Entry<String, T>> stream()
+    {
+        return actualAssociations.stream();
+    }
+
+
 }


[06/50] [abbrv] zest-qi4j git commit: Add Test for QI-298

Posted by ni...@apache.org.
Add Test for QI-298


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/74f2a024
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/74f2a024
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/74f2a024

Branch: refs/heads/3.0
Commit: 74f2a02407ae585c9be852d8c90e8ca938878806
Parents: 116fa08
Author: Paul Merlin <pa...@nosphere.org>
Authored: Thu Jun 12 14:43:14 2014 +0200
Committer: Paul Merlin <pa...@nosphere.org>
Committed: Thu Jun 12 14:43:14 2014 +0200

----------------------------------------------------------------------
 .../qi4j/runtime/composite/MapOverrideTest.java | 71 ++++++++++----------
 .../runtime/composite/TransientAsClassTest.java | 40 +++++++++++
 2 files changed, 76 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/74f2a024/core/runtime/src/test/java/org/qi4j/runtime/composite/MapOverrideTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/runtime/composite/MapOverrideTest.java b/core/runtime/src/test/java/org/qi4j/runtime/composite/MapOverrideTest.java
index 4359f0d..03de4b3 100644
--- a/core/runtime/src/test/java/org/qi4j/runtime/composite/MapOverrideTest.java
+++ b/core/runtime/src/test/java/org/qi4j/runtime/composite/MapOverrideTest.java
@@ -13,9 +13,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.qi4j.runtime.composite;
 
+import java.lang.reflect.Method;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
 import org.junit.Ignore;
 import org.junit.Test;
 import org.qi4j.api.composite.Composite;
@@ -27,12 +31,6 @@ import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ModuleAssembly;
 import org.qi4j.test.AbstractQi4jTest;
 
-import java.lang.reflect.Method;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
 import static org.hamcrest.core.IsEqual.equalTo;
 import static org.junit.Assert.assertThat;
 
@@ -42,7 +40,7 @@ import static org.junit.Assert.assertThat;
  * Note that keySet(), values() and entrySet() would ALSO require overloading, but this has been left out for
  * clarity reasons.
  */
-@Ignore("Awaiting complete fix of Qi-361.")
+@Ignore( "Awaiting QI-298" )
 public class MapOverrideTest
     extends AbstractQi4jTest
 {
@@ -52,67 +50,67 @@ public class MapOverrideTest
     {
         // unable to add the concern, since it is applied on the prototype too!
         // this seems to be a generic problem with prototypes.
-        module.values( Map.class ).withMixins( HashMap.class ).withConcerns(ReadOnlyMapConcern.class);
+        module.transients( Map.class ).withMixins( HashMap.class ).withConcerns( ReadOnlyMapConcern.class );
     }
 
     @Test
     public void givenReadOnlyAnnotatedHashMapWhenCallingSizeExpectSuccess()
     {
         ValueBuilder<Map> builder = module.newValueBuilder( Map.class );
-        Map<String,String> prototype = builder.prototype();
+        Map<String, String> prototype = builder.prototype();
         prototype.put( "Niclas", "Hedhman" );
-        Map<String,String> underTest =  builder.newInstance();
-        assertThat( underTest.size(), equalTo(1) );
+        Map<String, String> underTest = builder.newInstance();
+        assertThat( underTest.size(), equalTo( 1 ) );
     }
 
     @Test
     public void givenReadOnlyAnnotatedHashMapWhenCallingIsEmptyExpectSuccess()
     {
         ValueBuilder<Map> builder = module.newValueBuilder( Map.class );
-        Map<String,String> prototype = builder.prototype();
+        Map<String, String> prototype = builder.prototype();
         prototype.put( "Niclas", "Hedhman" );
-        Map<String,String> underTest =  builder.newInstance();
-        assertThat( underTest.isEmpty(), equalTo(false) );
+        Map<String, String> underTest = builder.newInstance();
+        assertThat( underTest.isEmpty(), equalTo( false ) );
     }
-    
+
     @Test
     public void givenReadOnlyAnnotatedHashMapWhenCallingContainsKeyExpectSuccess()
     {
         ValueBuilder<Map> builder = module.newValueBuilder( Map.class );
-        Map<String,String> prototype = builder.prototype();
+        Map<String, String> prototype = builder.prototype();
         prototype.put( "Niclas", "Hedhman" );
-        Map<String,String> underTest =  builder.newInstance();
-        assertThat( underTest.containsKey("Niclas"), equalTo(true) );
+        Map<String, String> underTest = builder.newInstance();
+        assertThat( underTest.containsKey( "Niclas" ), equalTo( true ) );
     }
 
     @Test
     public void givenReadOnlyAnnotatedHashMapWhenCallingContainsValueExpectSuccess()
     {
         ValueBuilder<Map> builder = module.newValueBuilder( Map.class );
-        Map<String,String> prototype = builder.prototype();
+        Map<String, String> prototype = builder.prototype();
         prototype.put( "Niclas", "Hedhman" );
-        Map<String,String> underTest =  builder.newInstance();
-        assertThat( underTest.containsValue("Hedhman"), equalTo(true) );
+        Map<String, String> underTest = builder.newInstance();
+        assertThat( underTest.containsValue( "Hedhman" ), equalTo( true ) );
     }
 
     @Test
     public void givenReadOnlyAnnotatedHashMapWhenCallingGetExpectSuccess()
     {
         ValueBuilder<Map> builder = module.newValueBuilder( Map.class );
-        Map<String,String> prototype = builder.prototype();
+        Map<String, String> prototype = builder.prototype();
         prototype.put( "Niclas", "Hedhman" );
-        Map<String,String> underTest =  builder.newInstance();
-        assertThat( underTest.get( "Niclas" ), equalTo("Hedhman") );
+        Map<String, String> underTest = builder.newInstance();
+        assertThat( underTest.get( "Niclas" ), equalTo( "Hedhman" ) );
     }
 
     @Test
     public void givenReadOnlyAnnotatedHashMapWhenCallingKeySetExpectSuccess()
     {
         ValueBuilder<Map> builder = module.newValueBuilder( Map.class );
-        Map<String,String> prototype = builder.prototype();
+        Map<String, String> prototype = builder.prototype();
         prototype.put( "Niclas", "Hedhman" );
-        Map<String,String> underTest =  builder.newInstance();
-        assertThat( underTest.keySet(), equalTo(Collections.singleton("Niclas")) );
+        Map<String, String> underTest = builder.newInstance();
+        assertThat( underTest.keySet(), equalTo( Collections.singleton( "Niclas" ) ) );
     }
 
     @Test
@@ -125,12 +123,12 @@ public class MapOverrideTest
     public void givenReadOnlyAnnotatedHashMapWhenCallingValuesExpectSuccess()
     {
         ValueBuilder<Map> builder = module.newValueBuilder( Map.class );
-        Map<String,String> prototype = builder.prototype();
+        Map<String, String> prototype = builder.prototype();
         prototype.put( "Niclas", "Hedhman" );
-        Map<String,String> underTest =  builder.newInstance();
-        Collection<String> values = Collections.singletonList("Hedhman");
-        assertThat( underTest.values().size(), equalTo(values.size()) );
-        assertThat( underTest.values().contains("Hedhman"), equalTo(true) );
+        Map<String, String> underTest = builder.newInstance();
+        Collection<String> values = Collections.singletonList( "Hedhman" );
+        assertThat( underTest.values().size(), equalTo( values.size() ) );
+        assertThat( underTest.values().contains( "Hedhman" ), equalTo( true ) );
     }
 
     @Test( expected = ReadOnlyException.class )
@@ -161,7 +159,8 @@ public class MapOverrideTest
 
     }
 
-    public static abstract class ReadOnlyMapConcern extends ConcernOf<Map>
+    public static abstract class ReadOnlyMapConcern
+        extends ConcernOf<Map>
         implements Map
     {
         @Invocation
@@ -195,11 +194,13 @@ public class MapOverrideTest
         }
     }
 
-    private static class ReadOnlyException extends RuntimeException
+    private static class ReadOnlyException
+        extends RuntimeException
     {
         public ReadOnlyException( Composite me, Method method )
         {
             super( "Method " + method.getName() + " in [" + me.toString() + "] is READ ONLY." );
         }
     }
+
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/74f2a024/core/runtime/src/test/java/org/qi4j/runtime/composite/TransientAsClassTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/runtime/composite/TransientAsClassTest.java b/core/runtime/src/test/java/org/qi4j/runtime/composite/TransientAsClassTest.java
new file mode 100644
index 0000000..b4744b1
--- /dev/null
+++ b/core/runtime/src/test/java/org/qi4j/runtime/composite/TransientAsClassTest.java
@@ -0,0 +1,40 @@
+package org.qi4j.runtime.composite;
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.qi4j.bootstrap.AssemblyException;
+import org.qi4j.bootstrap.ModuleAssembly;
+import org.qi4j.test.AbstractQi4jTest;
+
+import static org.hamcrest.core.IsEqual.equalTo;
+import static org.junit.Assert.assertThat;
+
+/**
+ * Test for QI-298.
+ */
+@Ignore( "Awaiting QI-298" )
+public class TransientAsClassTest
+    extends AbstractQi4jTest
+{
+    public static class UnderTest
+    {
+        public String foo()
+        {
+            return "bar";
+        }
+    }
+
+    @Override
+    public void assemble( ModuleAssembly module )
+        throws AssemblyException
+    {
+        module.transients( UnderTest.class );
+    }
+
+    @Test
+    public void test()
+    {
+        UnderTest underTest = module.newTransient( UnderTest.class );
+        assertThat( underTest.foo(), equalTo( "bar" ) );
+    }
+}


[45/50] [abbrv] zest-qi4j git commit: Replacing loop with Stream API.

Posted by ni...@apache.org.
Replacing loop with Stream API.


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/1dfbffce
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/1dfbffce
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/1dfbffce

Branch: refs/heads/3.0
Commit: 1dfbffcef1337352d6397793c08633dc91657a24
Parents: 61280dc
Author: Niclas Hedhman <ni...@hedhman.org>
Authored: Sat Oct 4 15:09:32 2014 +0800
Committer: Niclas Hedhman <ni...@hedhman.org>
Committed: Sat Oct 4 15:09:32 2014 +0800

----------------------------------------------------------------------
 .../qi4j/api/dataset/iterable/IterableDataSet.java    |  6 +++---
 .../org/qi4j/api/dataset/iterable/IterableQuery.java  |  2 +-
 .../org/qi4j/api/object/NoSuchObjectException.java    |  3 +--
 .../main/java/org/qi4j/api/object/ObjectFactory.java  |  2 +-
 .../org/qi4j/api/property/GenericPropertyInfo.java    | 14 +++++---------
 5 files changed, 11 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/1dfbffce/core/api/src/main/java/org/qi4j/api/dataset/iterable/IterableDataSet.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/dataset/iterable/IterableDataSet.java b/core/api/src/main/java/org/qi4j/api/dataset/iterable/IterableDataSet.java
index 213763b..b31c29a 100644
--- a/core/api/src/main/java/org/qi4j/api/dataset/iterable/IterableDataSet.java
+++ b/core/api/src/main/java/org/qi4j/api/dataset/iterable/IterableDataSet.java
@@ -22,18 +22,18 @@ public class IterableDataSet<T>
     @Override
     public DataSet<T> constrain( Predicate<T> selection )
     {
-        return new IterableDataSet<T>( Iterables.filter( selection, iterable ) );
+        return new IterableDataSet<>( Iterables.filter( selection, iterable ) );
     }
 
     @Override
     public <U> DataSet<U> project( Function<T, U> conversion )
     {
-        return new IterableDataSet<U>( Iterables.map( conversion, iterable ) );
+        return new IterableDataSet<>( Iterables.map( conversion, iterable ) );
     }
 
     @Override
     public Query<T> newQuery()
     {
-        return new IterableQuery<T>( iterable );
+        return new IterableQuery<>( iterable );
     }
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/1dfbffce/core/api/src/main/java/org/qi4j/api/dataset/iterable/IterableQuery.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/dataset/iterable/IterableQuery.java b/core/api/src/main/java/org/qi4j/api/dataset/iterable/IterableQuery.java
index 7e67184..29451ca 100644
--- a/core/api/src/main/java/org/qi4j/api/dataset/iterable/IterableQuery.java
+++ b/core/api/src/main/java/org/qi4j/api/dataset/iterable/IterableQuery.java
@@ -17,7 +17,7 @@ public class IterableQuery<T> implements Query<T>
     private Iterable<T> iterable;
     private int skip;
     private int limit;
-    private Map<String, Object> variables = new HashMap<String, Object>();
+    private Map<String, Object> variables = new HashMap<>();
 
     public IterableQuery( Iterable<T> iterable )
     {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/1dfbffce/core/api/src/main/java/org/qi4j/api/object/NoSuchObjectException.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/object/NoSuchObjectException.java b/core/api/src/main/java/org/qi4j/api/object/NoSuchObjectException.java
index 71a4cb7..6f61c48 100644
--- a/core/api/src/main/java/org/qi4j/api/object/NoSuchObjectException.java
+++ b/core/api/src/main/java/org/qi4j/api/object/NoSuchObjectException.java
@@ -28,8 +28,7 @@ public class NoSuchObjectException
 
     public NoSuchObjectException( String type, String moduleName )
     {
-        super( "Could not find any visible Object of type [" + type + "] in module [" +
-               moduleName + "]." );
+        super( "Could not find any visible Object of type [" + type + "] in module [" + moduleName + "]." );
         this.objectType = type;
         this.moduleName = moduleName;
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/1dfbffce/core/api/src/main/java/org/qi4j/api/object/ObjectFactory.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/object/ObjectFactory.java b/core/api/src/main/java/org/qi4j/api/object/ObjectFactory.java
index 9b8ec47..19905b6 100644
--- a/core/api/src/main/java/org/qi4j/api/object/ObjectFactory.java
+++ b/core/api/src/main/java/org/qi4j/api/object/ObjectFactory.java
@@ -37,7 +37,7 @@ public interface ObjectFactory
     /**
      * Inject an existing instance. Only fields and methods will be called.
      *
-     * @param instance
+     * @param instance The object that should receive the injections.
      *
      * @throws ConstructionException
      */

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/1dfbffce/core/api/src/main/java/org/qi4j/api/property/GenericPropertyInfo.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/property/GenericPropertyInfo.java b/core/api/src/main/java/org/qi4j/api/property/GenericPropertyInfo.java
index b8b9467..54ab32c 100644
--- a/core/api/src/main/java/org/qi4j/api/property/GenericPropertyInfo.java
+++ b/core/api/src/main/java/org/qi4j/api/property/GenericPropertyInfo.java
@@ -20,6 +20,7 @@ package org.qi4j.api.property;
 import java.lang.reflect.AccessibleObject;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
+import java.util.Arrays;
 
 import static org.qi4j.api.util.Classes.typeOf;
 
@@ -46,15 +47,10 @@ public final class GenericPropertyInfo
 
         if( methodReturnType instanceof Class<?> )
         {
-            Type[] interfaces = ( (Class<?>) methodReturnType ).getGenericInterfaces();
-            for( Type anInterface : interfaces )
-            {
-                Type propertyType = toPropertyType( anInterface );
-                if( propertyType != null )
-                {
-                    return propertyType;
-                }
-            }
+            Arrays.stream( ( (Class<?>) methodReturnType ).getGenericInterfaces() )
+                .map( GenericPropertyInfo::toPropertyType )
+                .filter( propType -> propType != null )
+                .findFirst();
         }
         return null;
     }


[39/50] [abbrv] zest-qi4j git commit: Replacing loops with Stream API, and a use of Method reference.

Posted by ni...@apache.org.
Replacing loops with Stream API, and a use of Method reference.


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/aee712a1
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/aee712a1
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/aee712a1

Branch: refs/heads/3.0
Commit: aee712a18251563827590d350b7597736d70fac7
Parents: 0a50ebd
Author: Niclas Hedhman <ni...@hedhman.org>
Authored: Sat Oct 4 14:14:20 2014 +0800
Committer: Niclas Hedhman <ni...@hedhman.org>
Committed: Sat Oct 4 14:14:20 2014 +0800

----------------------------------------------------------------------
 .../main/java/org/qi4j/api/common/MetaInfo.java | 24 ++++++++------------
 1 file changed, 9 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/aee712a1/core/api/src/main/java/org/qi4j/api/common/MetaInfo.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/common/MetaInfo.java b/core/api/src/main/java/org/qi4j/api/common/MetaInfo.java
index 9fd084c..2266207 100644
--- a/core/api/src/main/java/org/qi4j/api/common/MetaInfo.java
+++ b/core/api/src/main/java/org/qi4j/api/common/MetaInfo.java
@@ -17,6 +17,7 @@ package org.qi4j.api.common;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.AnnotatedElement;
 import java.lang.reflect.Type;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.LinkedHashMap;
@@ -80,7 +81,7 @@ public final class MetaInfo
 
     static
     {
-        ignored = new HashSet<Class>( 4, 0.8f ); // Optimize size used.
+        ignored = new HashSet<>( 4, 0.8f ); // Optimize size used.
         ignored.addAll( asList( Mixins.class, Concerns.class, SideEffects.class ) );
     }
 
@@ -88,12 +89,12 @@ public final class MetaInfo
 
     public MetaInfo()
     {
-        metaInfoMap = new LinkedHashMap<Class<?>, Object>();
+        metaInfoMap = new LinkedHashMap<>();
     }
 
     public MetaInfo( MetaInfo metaInfo )
     {
-        metaInfoMap = new LinkedHashMap<Class<?>, Object>();
+        metaInfoMap = new LinkedHashMap<>();
         metaInfoMap.putAll( metaInfo.metaInfoMap );
     }
 
@@ -108,10 +109,7 @@ public final class MetaInfo
         {
             Class<?> metaInfoclass = metaInfo.getClass();
             Iterable<Type> types = typesOf( metaInfoclass );
-            for( Type type : types )
-            {
-                metaInfoMap.put( Classes.RAW_CLASS.apply( type ), metaInfo );
-            }
+            types.forEach( type -> metaInfoMap.put( Classes.RAW_CLASS.apply( type ), metaInfo ) );
         }
     }
 
@@ -127,14 +125,10 @@ public final class MetaInfo
 
     public MetaInfo withAnnotations( AnnotatedElement annotatedElement )
     {
-        for( Annotation annotation : annotatedElement.getAnnotations() )
-        {
-            if( !ignored.contains( annotation.annotationType() )
-                && get( annotation.annotationType() ) == null )
-            {
-                set( annotation );
-            }
-        }
+        Arrays.stream( annotatedElement.getAnnotations() )
+            .filter( annotation -> !ignored.contains( annotation.annotationType() )
+                   && get( annotation.annotationType() ) == null )
+            .forEach( this::set );
         return this;
     }
 


[47/50] [abbrv] zest-qi4j git commit: Fix CleanStackTrace Test

Posted by ni...@apache.org.
Fix CleanStackTrace Test


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/63512dbd
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/63512dbd
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/63512dbd

Branch: refs/heads/3.0
Commit: 63512dbd7d1abd7f038910fa0ed9525e8ca5eabb
Parents: caa6201
Author: Paul Merlin <pa...@nosphere.org>
Authored: Sat Oct 4 12:48:51 2014 +0200
Committer: Paul Merlin <pa...@nosphere.org>
Committed: Sat Oct 4 12:49:51 2014 +0200

----------------------------------------------------------------------
 .../org/qi4j/test/composite/CleanStackTraceTest.java    | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/63512dbd/core/runtime/src/test/java/org/qi4j/test/composite/CleanStackTraceTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/test/composite/CleanStackTraceTest.java b/core/runtime/src/test/java/org/qi4j/test/composite/CleanStackTraceTest.java
index 1c01597..06e3085 100644
--- a/core/runtime/src/test/java/org/qi4j/test/composite/CleanStackTraceTest.java
+++ b/core/runtime/src/test/java/org/qi4j/test/composite/CleanStackTraceTest.java
@@ -76,14 +76,14 @@ public class CleanStackTraceTest
         {
             String separator = System.getProperty( "line.separator" );
             String correctTrace1 = "java.lang.RuntimeException: level 2" + separator +
-                                   "\tat org.qi4j.test.composite.CleanStackTraceTest$DoStuffMixin.doStuff(CleanStackTraceTest.java:121)" + separator +
-                                   "\tat org.qi4j.test.composite.CleanStackTraceTest$NillyWilly.invoke(CleanStackTraceTest.java:134)" + separator +
-                                   "\tat org.qi4j.test.composite.CleanStackTraceTest.cleanStackTraceOnApplicationException(CleanStackTraceTest.java:72)";
+                                   "\tat org.qi4j.test.composite.CleanStackTraceTest$DoStuffMixin.doStuff(CleanStackTraceTest.java:122)" + separator +
+                                   "\tat org.qi4j.test.composite.CleanStackTraceTest$NillyWilly.invoke(CleanStackTraceTest.java:135)" + separator +
+                                   "\tat org.qi4j.test.composite.CleanStackTraceTest.cleanStackTraceOnApplicationException(CleanStackTraceTest.java:73)";
             assertEquality( e, correctTrace1 );
             String correctTrace2 = "java.lang.RuntimeException: level 1" + separator +
-                                   "\tat org.qi4j.test.composite.CleanStackTraceTest$DoStuffMixin.doStuff(CleanStackTraceTest.java:117)" + separator +
-                                   "\tat org.qi4j.test.composite.CleanStackTraceTest$NillyWilly.invoke(CleanStackTraceTest.java:134)" + separator +
-                                   "\tat org.qi4j.test.composite.CleanStackTraceTest.cleanStackTraceOnApplicationException(CleanStackTraceTest.java:72)";
+                                   "\tat org.qi4j.test.composite.CleanStackTraceTest$DoStuffMixin.doStuff(CleanStackTraceTest.java:118)" + separator +
+                                   "\tat org.qi4j.test.composite.CleanStackTraceTest$NillyWilly.invoke(CleanStackTraceTest.java:135)" + separator +
+                                   "\tat org.qi4j.test.composite.CleanStackTraceTest.cleanStackTraceOnApplicationException(CleanStackTraceTest.java:73)";
             assertThat( e.getCause(), notNullValue() );
             assertEquality( e.getCause(), correctTrace2 );
         }


[10/50] [abbrv] zest-qi4j git commit: MongoDB EntityStore now use Mongo Driver 2.12.2

Posted by ni...@apache.org.
MongoDB EntityStore now use Mongo Driver 2.12.2


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/a4cf8c75
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/a4cf8c75
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/a4cf8c75

Branch: refs/heads/3.0
Commit: a4cf8c7583c5de40e0c2000b31091830a36ca23d
Parents: b430b0a
Author: Paul Merlin <pa...@nosphere.org>
Authored: Thu Jun 12 14:55:41 2014 +0200
Committer: Paul Merlin <pa...@nosphere.org>
Committed: Thu Jun 12 14:55:41 2014 +0200

----------------------------------------------------------------------
 .../mongodb/MongoEntityStoreConfiguration.java  |  2 --
 .../mongodb/MongoMapEntityStoreMixin.java       | 27 ++++++++------------
 libraries.gradle                                |  2 +-
 3 files changed, 11 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/a4cf8c75/extensions/entitystore-mongodb/src/main/java/org/qi4j/entitystore/mongodb/MongoEntityStoreConfiguration.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-mongodb/src/main/java/org/qi4j/entitystore/mongodb/MongoEntityStoreConfiguration.java b/extensions/entitystore-mongodb/src/main/java/org/qi4j/entitystore/mongodb/MongoEntityStoreConfiguration.java
index 92763ac..6b26cab 100644
--- a/extensions/entitystore-mongodb/src/main/java/org/qi4j/entitystore/mongodb/MongoEntityStoreConfiguration.java
+++ b/extensions/entitystore-mongodb/src/main/java/org/qi4j/entitystore/mongodb/MongoEntityStoreConfiguration.java
@@ -58,8 +58,6 @@ public interface MongoEntityStoreConfiguration
 
         /** Exceptions are raised for network issues, but not server errors */
         NORMAL,
-        /** No exceptions are raised, even for network issues */
-        NONE,
         /** Exceptions are raised for network issues, and server errors; waits on a server for the write operation */
         SAFE,
         /** Exceptions are raised for network issues, and server errors; waits on a majority of servers for the write operation */

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/a4cf8c75/extensions/entitystore-mongodb/src/main/java/org/qi4j/entitystore/mongodb/MongoMapEntityStoreMixin.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-mongodb/src/main/java/org/qi4j/entitystore/mongodb/MongoMapEntityStoreMixin.java b/extensions/entitystore-mongodb/src/main/java/org/qi4j/entitystore/mongodb/MongoMapEntityStoreMixin.java
index fc77f54..361f953 100644
--- a/extensions/entitystore-mongodb/src/main/java/org/qi4j/entitystore/mongodb/MongoMapEntityStoreMixin.java
+++ b/extensions/entitystore-mongodb/src/main/java/org/qi4j/entitystore/mongodb/MongoMapEntityStoreMixin.java
@@ -23,6 +23,7 @@ import com.mongodb.DBCollection;
 import com.mongodb.DBCursor;
 import com.mongodb.DBObject;
 import com.mongodb.MongoClient;
+import com.mongodb.MongoCredential;
 import com.mongodb.ServerAddress;
 import com.mongodb.WriteConcern;
 import com.mongodb.util.JSON;
@@ -47,8 +48,6 @@ import org.qi4j.io.Sender;
 import org.qi4j.spi.entitystore.EntityNotFoundException;
 import org.qi4j.spi.entitystore.EntityStoreException;
 import org.qi4j.spi.entitystore.helpers.MapEntityStore;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * MongoDB implementation of MapEntityStore.
@@ -56,10 +55,9 @@ import org.slf4j.LoggerFactory;
 public class MongoMapEntityStoreMixin
     implements ServiceActivation, MapEntityStore, MongoAccessors
 {
-    private static final Logger LOGGER = LoggerFactory.getLogger( "org.qi4j.entitystore.mongodb" );
     private static final String DEFAULT_DATABASE_NAME = "qi4j:entitystore";
     private static final String DEFAULT_COLLECTION_NAME = "qi4j:entitystore:entities";
-    public static final String IDENTITY_COLUMN = "identity";
+    public static final String IDENTITY_COLUMN = "_id";
     public static final String STATE_COLUMN = "state";
     @This
     private Configuration<MongoEntityStoreConfiguration> configuration;
@@ -79,18 +77,16 @@ public class MongoMapEntityStoreMixin
         loadConfiguration();
 
         // Create Mongo driver and open the database
-        mongo = new MongoClient( serverAddresses );
-        db = mongo.getDB( databaseName );
-
-        // Authenticate if needed
-        if( !username.isEmpty() )
+        if( username.isEmpty() )
         {
-            if( !db.authenticate( username, password ) )
-            {
-                LOGGER.warn( "Authentication against MongoDB with username '" + username + "' failed. "
-                             + "Subsequent requests will be made 'anonymously'." );
-            }
+            mongo = new MongoClient( serverAddresses );
         }
+        else
+        {
+            MongoCredential credential = MongoCredential.createMongoCRCredential( username, databaseName, password );
+            mongo = new MongoClient( serverAddresses, Arrays.asList( credential ) );
+        }
+        db = mongo.getDB( databaseName );
 
         // Create index if needed
         db.requestStart();
@@ -152,9 +148,6 @@ public class MongoMapEntityStoreMixin
             case MAJORITY:
                 writeConcern = WriteConcern.MAJORITY;
                 break;
-            case NONE:
-                writeConcern = WriteConcern.NONE;
-                break;
             case REPLICAS_SAFE:
                 writeConcern = WriteConcern.REPLICAS_SAFE;
                 break;

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/a4cf8c75/libraries.gradle
----------------------------------------------------------------------
diff --git a/libraries.gradle b/libraries.gradle
index eb9da0c..f162e44 100644
--- a/libraries.gradle
+++ b/libraries.gradle
@@ -37,8 +37,8 @@ def leveldbVersion = '0.7'
 def leveldbJniVersion = '1.8'
 def liquibaseVersion = '3.2.0'
 def log4jVersion = '1.2.17'
-def mongodbVersion = '2.11.3'
 def logbackVersion = '1.1.2'
+def mongodbVersion = '2.12.2'
 def mysqlVersion = '5.1.31'
 def neoVersion = '1.3' // 1.9.4 Fails to compile! - 2.1.2 exists
 def neoIndexVersion = '1.3-1.3.M01' // Do not exist anymore!


[13/50] [abbrv] zest-qi4j git commit: Core Runtime, minor: Fragment and Transient loaders gen 1.7 OpCodes only

Posted by ni...@apache.org.
Core Runtime, minor: Fragment and Transient loaders gen 1.7 OpCodes only

Seems fair as we now require Java 7.


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/cf478f2f
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/cf478f2f
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/cf478f2f

Branch: refs/heads/3.0
Commit: cf478f2f608c1730a91aeef6554f0083d885623f
Parents: 3dd0f6a
Author: Paul Merlin <pa...@nosphere.org>
Authored: Thu Jun 12 15:04:28 2014 +0200
Committer: Paul Merlin <pa...@nosphere.org>
Committed: Thu Jun 12 15:04:28 2014 +0200

----------------------------------------------------------------------
 .../runtime/composite/FragmentClassLoader.java  | 62 ++++++++++++++++----
 .../runtime/composite/TransientClassLoader.java | 31 +++-------
 2 files changed, 59 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/cf478f2f/core/runtime/src/main/java/org/qi4j/runtime/composite/FragmentClassLoader.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/composite/FragmentClassLoader.java b/core/runtime/src/main/java/org/qi4j/runtime/composite/FragmentClassLoader.java
index 183308f..c140511 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/composite/FragmentClassLoader.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/composite/FragmentClassLoader.java
@@ -19,14 +19,55 @@ import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 import java.util.ArrayList;
 import java.util.List;
-import org.objectweb.asm.*;
+import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.Type;
 import org.qi4j.api.entity.Lifecycle;
 import org.qi4j.api.mixin.Initializable;
 import org.qi4j.api.util.Classes;
 import org.qi4j.api.util.Methods;
 import org.qi4j.functional.Iterables;
 
-import static org.objectweb.asm.Opcodes.*;
+import static org.objectweb.asm.Opcodes.AASTORE;
+import static org.objectweb.asm.Opcodes.ACC_PRIVATE;
+import static org.objectweb.asm.Opcodes.ACC_PUBLIC;
+import static org.objectweb.asm.Opcodes.ACC_STATIC;
+import static org.objectweb.asm.Opcodes.ACC_SUPER;
+import static org.objectweb.asm.Opcodes.ACONST_NULL;
+import static org.objectweb.asm.Opcodes.ALOAD;
+import static org.objectweb.asm.Opcodes.ANEWARRAY;
+import static org.objectweb.asm.Opcodes.ARETURN;
+import static org.objectweb.asm.Opcodes.ASTORE;
+import static org.objectweb.asm.Opcodes.ATHROW;
+import static org.objectweb.asm.Opcodes.BIPUSH;
+import static org.objectweb.asm.Opcodes.CHECKCAST;
+import static org.objectweb.asm.Opcodes.DLOAD;
+import static org.objectweb.asm.Opcodes.DRETURN;
+import static org.objectweb.asm.Opcodes.DUP;
+import static org.objectweb.asm.Opcodes.FLOAD;
+import static org.objectweb.asm.Opcodes.FRETURN;
+import static org.objectweb.asm.Opcodes.GETFIELD;
+import static org.objectweb.asm.Opcodes.GETSTATIC;
+import static org.objectweb.asm.Opcodes.GOTO;
+import static org.objectweb.asm.Opcodes.ICONST_0;
+import static org.objectweb.asm.Opcodes.ICONST_1;
+import static org.objectweb.asm.Opcodes.ICONST_2;
+import static org.objectweb.asm.Opcodes.ICONST_3;
+import static org.objectweb.asm.Opcodes.ICONST_4;
+import static org.objectweb.asm.Opcodes.ICONST_5;
+import static org.objectweb.asm.Opcodes.ILOAD;
+import static org.objectweb.asm.Opcodes.INVOKEINTERFACE;
+import static org.objectweb.asm.Opcodes.INVOKESPECIAL;
+import static org.objectweb.asm.Opcodes.INVOKESTATIC;
+import static org.objectweb.asm.Opcodes.INVOKEVIRTUAL;
+import static org.objectweb.asm.Opcodes.IRETURN;
+import static org.objectweb.asm.Opcodes.LLOAD;
+import static org.objectweb.asm.Opcodes.LRETURN;
+import static org.objectweb.asm.Opcodes.POP;
+import static org.objectweb.asm.Opcodes.PUTSTATIC;
+import static org.objectweb.asm.Opcodes.RETURN;
 import static org.objectweb.asm.Type.getInternalName;
 import static org.qi4j.api.util.Classes.interfacesOf;
 
@@ -34,23 +75,22 @@ import static org.qi4j.api.util.Classes.interfacesOf;
  * Generate subclasses of mixins/modifiers that implement all interfaces not in the class itself
  * and which delegates those calls to a given composite invoker.
  */
+@SuppressWarnings( "raw" )
 public class FragmentClassLoader
     extends ClassLoader
 {
-    private static int jdkVersion = Opcodes.V1_5;
+    private static final int JDK_VERSION;
     public static final String GENERATED_POSTFIX = "_Stub";
 
     static
     {
         String jdkString = System.getProperty( "java.specification.version" );
-
-        if( jdkString.equals( "1.6" ) )
-        {
-            jdkVersion = Opcodes.V1_6;
-        }
-        else if( jdkString.equals( "1.7" ) )
+        switch( jdkString )
         {
-            jdkVersion = Opcodes.V1_7;
+            case "1.7":
+            default:
+                JDK_VERSION = Opcodes.V1_7;
+                break;
         }
     }
 
@@ -117,7 +157,7 @@ public class FragmentClassLoader
         ClassWriter cw = new ClassWriter( ClassWriter.COMPUTE_MAXS );
 
         // Class definition start
-        cw.visit( jdkVersion, ACC_PUBLIC + ACC_SUPER, classSlash, null, baseClassSlash, null );
+        cw.visit( JDK_VERSION, ACC_PUBLIC + ACC_SUPER, classSlash, null, baseClassSlash, null );
 
         // Composite reference
         {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/cf478f2f/core/runtime/src/main/java/org/qi4j/runtime/composite/TransientClassLoader.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/composite/TransientClassLoader.java b/core/runtime/src/main/java/org/qi4j/runtime/composite/TransientClassLoader.java
index 7e9f639..f3e0aa6 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/composite/TransientClassLoader.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/composite/TransientClassLoader.java
@@ -76,7 +76,8 @@ import static org.qi4j.api.util.Classes.interfacesOf;
 /**
  * Generate subclasses of classes used for transients. All methods delegate to CompositeInvoker.
  */
-public class TransientClassLoader
+@SuppressWarnings( "raw" )
+/* package */ final class TransientClassLoader
     extends ClassLoader
 {
     private static final int JDK_VERSION;
@@ -88,31 +89,24 @@ public class TransientClassLoader
         switch( jdkString )
         {
             case "1.7":
-                JDK_VERSION = Opcodes.V1_7;
-                break;
-            case "1.6":
-                JDK_VERSION = Opcodes.V1_6;
-                break;
-            case "1.5":
             default:
-                JDK_VERSION = Opcodes.V1_5;
+                JDK_VERSION = Opcodes.V1_7;
                 break;
         }
     }
 
-    public TransientClassLoader( ClassLoader parent )
+    /* package */ TransientClassLoader( ClassLoader parent )
     {
         super( parent );
     }
 
     @Override
-    @SuppressWarnings( "raw" )
     protected Class findClass( String name )
         throws ClassNotFoundException
     {
         if( name.endsWith( GENERATED_POSTFIX ) )
         {
-            Class baseClass = null;
+            Class baseClass;
             String baseName = name.substring( 0, name.length() - 6 );
             try
             {
@@ -152,7 +146,6 @@ public class TransientClassLoader
         return getClass().getClassLoader().loadClass( name );
     }
 
-    @SuppressWarnings( "raw" )
     public static byte[] generateClass( String name, Class baseClass )
         throws ClassNotFoundException
     {
@@ -441,7 +434,6 @@ public class TransientClassLoader
         return cw.toByteArray();
     }
 
-    @SuppressWarnings( "raw" )
     private static boolean isOverloaded( Method method, Class baseClass )
     {
         if( Modifier.isFinal( method.getModifiers() ) )
@@ -454,15 +446,13 @@ public class TransientClassLoader
         }
     }
 
-    @SuppressWarnings( "raw" )
     private static boolean isInternalQi4jMethod( Method method, Class baseClass )
     {
         return isDeclaredIn( method, Initializable.class, baseClass )
                || isDeclaredIn( method, Lifecycle.class, baseClass );
     }
 
-    @SuppressWarnings( {"raw", "unchecked"} )
-    private static boolean isDeclaredIn( Method method, Class clazz, Class baseClass )
+    private static boolean isDeclaredIn( Method method, Class<?> clazz, Class<?> baseClass )
     {
         if( !clazz.isAssignableFrom( baseClass ) )
         {
@@ -480,7 +470,6 @@ public class TransientClassLoader
         }
     }
 
-    @SuppressWarnings( "raw" )
     private static Class getInterfaceMethodDeclaration( Method method, Class clazz )
         throws NoSuchMethodException
     {
@@ -501,10 +490,9 @@ public class TransientClassLoader
         throw new NoSuchMethodException( method.getName() );
     }
 
-    @SuppressWarnings( {"raw", "unchecked"} )
-    private static boolean isInterfaceMethod( Method method, Class baseClass )
+    private static boolean isInterfaceMethod( Method method, Class<?> baseClass )
     {
-        for( Class aClass : Iterables.filter( Methods.HAS_METHODS, Iterables.map( Classes.RAW_CLASS, interfacesOf( baseClass ) ) ) )
+        for( Class<?> aClass : Iterables.filter( Methods.HAS_METHODS, Iterables.map( Classes.RAW_CLASS, interfacesOf( baseClass ) ) ) )
         {
             try
             {
@@ -790,7 +778,6 @@ public class TransientClassLoader
         }
     }
 
-    @SuppressWarnings( "raw" )
     public static boolean isGenerated( Class clazz )
     {
         return clazz.getName().endsWith( GENERATED_POSTFIX );
@@ -801,14 +788,12 @@ public class TransientClassLoader
         return object.getClass().getName().endsWith( GENERATED_POSTFIX );
     }
 
-    @SuppressWarnings( "raw" )
     public Class loadFragmentClass( Class fragmentClass )
         throws ClassNotFoundException
     {
         return loadClass( fragmentClass.getName().replace( '$', '_' ) + GENERATED_POSTFIX );
     }
 
-    @SuppressWarnings( "raw" )
     public static Class getSourceClass( Class fragmentClass )
     {
         return fragmentClass.getName().endsWith( GENERATED_POSTFIX ) ? fragmentClass.getSuperclass() : fragmentClass;


[20/50] [abbrv] zest-qi4j git commit: Fixed all JavaDoc ERRORS reported by DocLint in Java 8.

Posted by ni...@apache.org.
http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/functional/src/main/java/org/qi4j/functional/Functions.java
----------------------------------------------------------------------
diff --git a/core/functional/src/main/java/org/qi4j/functional/Functions.java b/core/functional/src/main/java/org/qi4j/functional/Functions.java
index 8e9e6a6..0b50b35 100644
--- a/core/functional/src/main/java/org/qi4j/functional/Functions.java
+++ b/core/functional/src/main/java/org/qi4j/functional/Functions.java
@@ -35,13 +35,10 @@ public final class Functions
     }
 
     /**
-     * compose(F1(M,T),F2(F,M)) = F1(F2(F)) -> T
+     * compose(F1(M,T),F2(F,M)) = F1(F2(F)) -&gt; T
      *
      * @param outer
      * @param inner
-     * @param <FROM>
-     * @param <MIDDLE>
-     * @param <TO>
      *
      * @return
      */

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/io/src/main/java/org/qi4j/io/Input.java
----------------------------------------------------------------------
diff --git a/core/io/src/main/java/org/qi4j/io/Input.java b/core/io/src/main/java/org/qi4j/io/Input.java
index 41647c4..bde80e5 100644
--- a/core/io/src/main/java/org/qi4j/io/Input.java
+++ b/core/io/src/main/java/org/qi4j/io/Input.java
@@ -16,12 +16,13 @@ package org.qi4j.io;
 
 /**
  * Input source of data.
- * <p/>
+ * <p>
  * Invoke transferTo to send data from this input to given output. transferTo can be invoked
  * as many times as you want. The transferTo implementation must ensure that any exceptions thrown
  * by the Input or the Output which transferred data is sent to is handled properly, i.e. that resources
  * are closed. Any client code to transferTo calls should not have to bother with resource management,
  * but may catch exceptions anyway for logging and similar purposes.
+ * </p>
  */
 // START SNIPPET: input
 public interface Input<T, SenderThrowableType extends Throwable>

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/io/src/main/java/org/qi4j/io/Outputs.java
----------------------------------------------------------------------
diff --git a/core/io/src/main/java/org/qi4j/io/Outputs.java b/core/io/src/main/java/org/qi4j/io/Outputs.java
index ca9b2c0..f3fd92f 100644
--- a/core/io/src/main/java/org/qi4j/io/Outputs.java
+++ b/core/io/src/main/java/org/qi4j/io/Outputs.java
@@ -36,9 +36,9 @@ public class Outputs
     /**
      * Write lines to a text file with UTF-8 encoding. Separate each line with a newline ("\n" character). If the writing or sending fails,
      * the file is deleted.
-     * <p/>
+     * <p>
      * If the filename ends with .gz, then the data is automatically GZipped.
-     *
+     * </p>
      * @param file the file to save the text to
      *
      * @return an Output for storing text in a file
@@ -54,9 +54,9 @@ public class Outputs
     /**
      * Write lines to a text file. Separate each line with a newline ("\n" character). If the writing or sending fails,
      * the file is deleted.
-     * <p/>
+     * <p>
      * If the filename ends with .gz, then the data is automatically GZipped.
-     *
+     * </p>
      * @param file the file to save the text to
      *
      * @return an Output for storing text in a file

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/runtime/src/main/java/org/qi4j/runtime/injection/DependencyModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/injection/DependencyModel.java b/core/runtime/src/main/java/org/qi4j/runtime/injection/DependencyModel.java
index 2062029..10eca0d 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/injection/DependencyModel.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/injection/DependencyModel.java
@@ -209,11 +209,22 @@ public final class DependencyModel
     }
 
     /**
-     * Get the raw dependency type. If the dependency uses generics this is the raw type,
-     * and otherwise it is the type of the field. Examples:<br/>
-     * {@code @Service MyService service} -> MyService<br/>
-     * {@code @Entity Iterable<Foo> fooList} -> Iterable<br/>
-     * {@code @Entity Query<Foo> fooQuery} -> Query<br/>
+     * Get the raw dependency type.
+     * <p>
+     * If the dependency uses generics this is the raw type,
+     * and otherwise it is the type of the field.
+     * </p>
+     * <p>
+     * Examples:
+     * </p>
+     * {@code @Service MyService service} -> MyService
+     * </p>
+     * <p>
+     * {@code @Entity Iterable<Foo> fooList} -> Iterable
+     * </p>
+     * <p>
+     * {@code @Entity Query<Foo> fooQuery} -> Query
+     * </p>
      *
      * @return raw injection type.
      */

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/runtime/src/main/java/org/qi4j/runtime/service/ImportedServiceReferenceInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/service/ImportedServiceReferenceInstance.java b/core/runtime/src/main/java/org/qi4j/runtime/service/ImportedServiceReferenceInstance.java
index 36bed24..4e792df 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/service/ImportedServiceReferenceInstance.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/service/ImportedServiceReferenceInstance.java
@@ -32,11 +32,11 @@ import org.slf4j.LoggerFactory;
 
 /**
  * Implementation of ServiceReference. This manages the reference to the imported service.
- * <p/>
+ * <p>
  * Whenever the service is requested it is returned directly to the client. That means that
  * to handle service passivation and unavailability correctly, any proxying must be done in the
  * service importer.
- *
+ * </p>
  * @param <T> Service Type
  */
 public final class ImportedServiceReferenceInstance<T>

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/runtime/src/main/java/org/qi4j/runtime/service/ServiceReferenceInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/service/ServiceReferenceInstance.java b/core/runtime/src/main/java/org/qi4j/runtime/service/ServiceReferenceInstance.java
index 259cfdf..706df16 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/service/ServiceReferenceInstance.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/service/ServiceReferenceInstance.java
@@ -36,12 +36,14 @@ import org.qi4j.runtime.activation.ActivationDelegate;
 import org.qi4j.runtime.structure.ModuleInstance;
 
 /**
- * Implementation of ServiceReference. This manages the actual instance of the service
- * and implements the service Activation.
- * <p/>
+ * Implementation of ServiceReference.
+ * <p>
+ * This manages the actual instance of the service and implements the service Activation.
+ * </p>
+ * <p>
  * Whenever the service is requested a proxy is returned which points to this class. This means
  * that the instance can be passivated even though a client is holding on to a service proxy.
- *
+ * </p>
  * @param <T> Service Type
  */
 public final class ServiceReferenceInstance<T>

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/runtime/src/test/java/org/qi4j/test/composite/CleanStackTraceTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/test/composite/CleanStackTraceTest.java b/core/runtime/src/test/java/org/qi4j/test/composite/CleanStackTraceTest.java
index f5e51ad..7d0d322 100644
--- a/core/runtime/src/test/java/org/qi4j/test/composite/CleanStackTraceTest.java
+++ b/core/runtime/src/test/java/org/qi4j/test/composite/CleanStackTraceTest.java
@@ -34,8 +34,9 @@ import static org.junit.Assume.assumeTrue;
 
 /**
  * Test if the stacktrace is cleaned up properly.
- * <p/>
+ * <p>
  * NOTE: This satisfiedBy MUST NOT be inside package org.qi4j.runtime, or it will fail.
+ * </p>
  */
 public class CleanStackTraceTest
     extends AbstractQi4jTest

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/spi/src/main/java/org/qi4j/spi/entity/EntityState.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/qi4j/spi/entity/EntityState.java b/core/spi/src/main/java/org/qi4j/spi/entity/EntityState.java
index 2f5c457..2e149ca 100644
--- a/core/spi/src/main/java/org/qi4j/spi/entity/EntityState.java
+++ b/core/spi/src/main/java/org/qi4j/spi/entity/EntityState.java
@@ -37,20 +37,20 @@ public interface EntityState
 
     /**
      * Version of the entity. This is managed by the EntityStore.
-     * <p/>
+     * <p>
      * If the underlying EntityStore does not support versioning, then version
      * must always be set to 0.
-     *
+     * </p>
      * @return version of the entity
      */
     String version();
 
     /**
      * Last modified timestamp of the entity. This is managed by the EntityStore.
-     * <p/>
+     * <p>
      * If the underlying EntityStore does not support timestamping, then last modified
      * must always be set to the current time.
-     *
+     * </p>
      * @return last modified timestamp of the entity, as defined by System.currentTimeMillis()
      */
     long lastModified();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/spi/src/main/java/org/qi4j/spi/entitystore/ConcurrentModificationCheckConcern.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/qi4j/spi/entitystore/ConcurrentModificationCheckConcern.java b/core/spi/src/main/java/org/qi4j/spi/entitystore/ConcurrentModificationCheckConcern.java
index 8c3e22c..cfeead6 100644
--- a/core/spi/src/main/java/org/qi4j/spi/entitystore/ConcurrentModificationCheckConcern.java
+++ b/core/spi/src/main/java/org/qi4j/spi/entitystore/ConcurrentModificationCheckConcern.java
@@ -30,12 +30,13 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 /**
  * Concern that helps EntityStores do concurrent modification checks.
- * <p/>
+ * <p>
  * It caches the versions of state that it loads, and forgets them when
  * the state is committed. For normal operation this means that it does
  * not have to go down to the underlying store to get the current version.
  * Whenever there is a concurrent modification the store will most likely
  * have to check with the underlying store what the current version is.
+ * </p>
  */
 public abstract class ConcurrentModificationCheckConcern
     extends ConcernOf<EntityStore>

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/spi/src/main/java/org/qi4j/spi/entitystore/EntityStoreUnitOfWork.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/qi4j/spi/entitystore/EntityStoreUnitOfWork.java b/core/spi/src/main/java/org/qi4j/spi/entitystore/EntityStoreUnitOfWork.java
index 2cb005f..21655cd 100644
--- a/core/spi/src/main/java/org/qi4j/spi/entitystore/EntityStoreUnitOfWork.java
+++ b/core/spi/src/main/java/org/qi4j/spi/entitystore/EntityStoreUnitOfWork.java
@@ -29,10 +29,10 @@ public interface EntityStoreUnitOfWork
 
     /**
      * Create new EntityState for a given identity.
-     * <p/>
+     * <p>
      * This should only create the EntityState and not insert it into any database, since that should occur during
      * the {@link EntityStoreUnitOfWork#applyChanges()} call.
-     *
+     * </p>
      * @param anIdentity       the identity of the entity
      * @param entityDescriptor entity descriptor
      *

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/spi/src/main/java/org/qi4j/spi/entitystore/helpers/MapEntityStore.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/qi4j/spi/entitystore/helpers/MapEntityStore.java b/core/spi/src/main/java/org/qi4j/spi/entitystore/helpers/MapEntityStore.java
index e044690..1b87f22 100644
--- a/core/spi/src/main/java/org/qi4j/spi/entitystore/helpers/MapEntityStore.java
+++ b/core/spi/src/main/java/org/qi4j/spi/entitystore/helpers/MapEntityStore.java
@@ -29,6 +29,7 @@ public interface MapEntityStore
 {
 
     /**
+     * @param entityReference The reference to the entity that we want to get.
      * @return Entity state Reader
      */
     Reader get( EntityReference entityReference )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/spi/src/main/java/org/qi4j/spi/value/ValueDeserializerAdapter.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/qi4j/spi/value/ValueDeserializerAdapter.java b/core/spi/src/main/java/org/qi4j/spi/value/ValueDeserializerAdapter.java
index 8d4a558..73056fe 100644
--- a/core/spi/src/main/java/org/qi4j/spi/value/ValueDeserializerAdapter.java
+++ b/core/spi/src/main/java/org/qi4j/spi/value/ValueDeserializerAdapter.java
@@ -84,7 +84,7 @@ import static org.qi4j.functional.Iterables.first;
  *     Some other Plain values are expected in given formats:
  * </p>
  * <ul>
- *     <li>BigInteger and BigDecimal depends on ValueSerializer.{@link Options};</li>
+ *     <li>BigInteger and BigDecimal depends on {@link org.qi4j.api.value.ValueSerializer.Options};</li>
  *     <li>Date as String in ISO-8601, {@literal @millis@} or {@literal /Date(..)} Microsoft format;</li>
  *     <li>DateTime (JodaTime) as a ISO-8601 String with optional timezone offset;</li>
  *     <li>LocalDateTime (JodaTime) as whatever {@link LocalDateTime#LocalDateTime(java.lang.Object)} accept as {@literal instant};</li>

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/testsupport/src/main/java/org/qi4j/test/AbstractQi4jBaseTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/qi4j/test/AbstractQi4jBaseTest.java b/core/testsupport/src/main/java/org/qi4j/test/AbstractQi4jBaseTest.java
index 0d9652f..3c878a1 100644
--- a/core/testsupport/src/main/java/org/qi4j/test/AbstractQi4jBaseTest.java
+++ b/core/testsupport/src/main/java/org/qi4j/test/AbstractQi4jBaseTest.java
@@ -84,9 +84,9 @@ public abstract class AbstractQi4jBaseTest
 
     /**
      * This method is called when there was an AssemblyException in the creation of the Qi4j application model.
-     * <p/>
+     * <p>
      * Override this method to catch valid failures to place into satisfiedBy suites.
-     *
+     * </p>
      * @param exception the exception thrown.
      *
      * @throws org.qi4j.bootstrap.AssemblyException The default implementation of this method will simply re-throw the exception.

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/testsupport/src/main/java/org/qi4j/test/AbstractQi4jScenarioTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/qi4j/test/AbstractQi4jScenarioTest.java b/core/testsupport/src/main/java/org/qi4j/test/AbstractQi4jScenarioTest.java
index 13e0eb8..48e1f0b 100644
--- a/core/testsupport/src/main/java/org/qi4j/test/AbstractQi4jScenarioTest.java
+++ b/core/testsupport/src/main/java/org/qi4j/test/AbstractQi4jScenarioTest.java
@@ -97,13 +97,13 @@ public abstract class AbstractQi4jScenarioTest
 
     /**
      * This method is called when there was an AssemblyException in the creation of the Qi4j application model.
-     * <p/>
+     * <p>
      * Override this method to catch valid failures to place into satisfiedBy suites.
+     * </p>
      *
      * @param exception the exception thrown.
      *
-     * @throws org.qi4j.bootstrap.AssemblyException
-     *          The default implementation of this method will simply re-throw the exception.
+     * @throws org.qi4j.bootstrap.AssemblyException The default implementation of this method will simply re-throw the exception.
      */
     static protected void assemblyException( AssemblyException exception )
         throws AssemblyException
@@ -131,7 +131,9 @@ public abstract class AbstractQi4jScenarioTest
                 }
                 else
                 {
-                    throw new InternalError( "I have seen a case where a UoW is on the stack, but not opened. First is" + uow.usecase().name() );
+                    throw new InternalError( "I have seen a case where a UoW is on the stack, but not opened. First is" + uow
+                        .usecase()
+                        .name() );
                 }
             }
             new Exception( "UnitOfWork not properly cleaned up" ).printStackTrace();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/extensions/entitystore-file/src/main/java/org/qi4j/entitystore/file/FileEntityStoreConfiguration.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-file/src/main/java/org/qi4j/entitystore/file/FileEntityStoreConfiguration.java b/extensions/entitystore-file/src/main/java/org/qi4j/entitystore/file/FileEntityStoreConfiguration.java
index 5d51fc5..34395c0 100644
--- a/extensions/entitystore-file/src/main/java/org/qi4j/entitystore/file/FileEntityStoreConfiguration.java
+++ b/extensions/entitystore-file/src/main/java/org/qi4j/entitystore/file/FileEntityStoreConfiguration.java
@@ -17,7 +17,8 @@ public interface FileEntityStoreConfiguration
      * The directory where the File Entity Store will be keep its persisted state.
      * <p>
      * Default: System.getProperty( "user.dir" ) + "/qi4j/filestore";
-     * <br/>
+     * </p>
+     * <p>
      * Ignored if the FileConfiguration service is found.
      * </p>
      * <p>

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/extensions/entitystore-jdbm/src/main/java/org/qi4j/entitystore/jdbm/JdbmConfiguration.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-jdbm/src/main/java/org/qi4j/entitystore/jdbm/JdbmConfiguration.java b/extensions/entitystore-jdbm/src/main/java/org/qi4j/entitystore/jdbm/JdbmConfiguration.java
index 616e266..a50b3b5 100644
--- a/extensions/entitystore-jdbm/src/main/java/org/qi4j/entitystore/jdbm/JdbmConfiguration.java
+++ b/extensions/entitystore-jdbm/src/main/java/org/qi4j/entitystore/jdbm/JdbmConfiguration.java
@@ -31,9 +31,9 @@ public interface JdbmConfiguration
     // END SNIPPET: config
    /**
     * The file where the JDBM data will be stored
-    * <p/>
+    * <p>
     * Default: System.getProperty( "user.dir" ) + "/qi4j/jdbmstore.data";
-    *
+    * </p>
     * @return path to data file relative to current path
     */
     // START SNIPPET: config

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/extensions/entitystore-preferences/src/main/java/org/qi4j/entitystore/prefs/PreferencesEntityStoreService.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-preferences/src/main/java/org/qi4j/entitystore/prefs/PreferencesEntityStoreService.java b/extensions/entitystore-preferences/src/main/java/org/qi4j/entitystore/prefs/PreferencesEntityStoreService.java
index 3cdcfd1..b0958ff 100644
--- a/extensions/entitystore-preferences/src/main/java/org/qi4j/entitystore/prefs/PreferencesEntityStoreService.java
+++ b/extensions/entitystore-preferences/src/main/java/org/qi4j/entitystore/prefs/PreferencesEntityStoreService.java
@@ -24,21 +24,25 @@ import org.qi4j.spi.entitystore.EntityStore;
 
 /**
  * EntityStore backed by Preferences API.
- * <p/>
+ * <p>
  * A root node is created in the System preferences, whose name
  * is the same as the Application name (default:"Application").
- * <p/>
+ * </p>
+ * <p>
  * Each entity is stored under its identity name.
- * <p/>
+ * </p>
+ * <p>
  * Property types are converted to native Preferences API types
  * as much as possible. All others will be serialized to a string using JSON.
- * <p/>
+ * </p>
+ * <p>
  * Associations are stored as the identity of the referenced Entity, ManyAssociations are stored as multi-line strings
  * (one identity per line), and NamedAssociations are stored as multi-line strings (one name on a line, identity on the
  * next line).
- * <p/>
+ * </p>
+ * <p>
  * The main use of the EntityStore is for storage of ConfigurationComposites for ServiceComposites.
- *
+ * </p>
  * @see org.qi4j.api.service.ServiceComposite
  * @see org.qi4j.api.configuration.Configuration
  */

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/SQLIndexingEngineService.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/SQLIndexingEngineService.java b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/SQLIndexingEngineService.java
index 49c59e8..ad0c2b1 100644
--- a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/SQLIndexingEngineService.java
+++ b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/SQLIndexingEngineService.java
@@ -26,11 +26,12 @@ import org.qi4j.spi.query.EntityFinder;
 
 /**
  * This is actual service responsible of managing indexing and queries and creating database structure.
- * <p/>
+ * <p>
  * The reason why all these components are in one single service is that they all require some data about
  * the database structure. Rather than exposing all of that data publicly to be available via another service,
  * it is stored in a state-style private mixin. Thus all the database-related data is available only to this
  * service, and no one else.
+ * </p>
  */
 @Mixins( {
     SQLEntityFinder.class,

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmHistory.java
----------------------------------------------------------------------
diff --git a/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmHistory.java b/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmHistory.java
index ff54abb..9aea62e 100644
--- a/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmHistory.java
+++ b/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmHistory.java
@@ -29,7 +29,6 @@ import org.qi4j.api.property.Property;
  * AlarmPoint system <i>should</i> implement <code>AlarmHistory</code> classes to
  * record the events of an <code>AlarmPoint</code>.
  *
- * @author Niclas Hedhman
  */
 @Mixins( AlarmHistory.AlarmHistoryMixin.class )
 public interface AlarmHistory
@@ -98,7 +97,8 @@ public interface AlarmHistory
      * <code>activate();
      * acknowledge();
      * deactivate();
-     * </code></pre>, the Map contains <table>
+     * </code></pre>, the Map contains
+     * <table summary="Triggers">
      * <tr><td>(String) activate</td><td>(Integer) 1</td></tr>
      * <tr><td>(String) deactivate</td><td>(Integer) 1</td></tr>
      * <tr><td>(String) acknowledge</td><td>(Integer) 1</td></tr>

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmNameFormat.java
----------------------------------------------------------------------
diff --git a/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmNameFormat.java b/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmNameFormat.java
index 58e67d8..c37fdc7 100644
--- a/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmNameFormat.java
+++ b/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmNameFormat.java
@@ -36,8 +36,8 @@ import org.qi4j.api.constraint.Constraints;
  *
  * public interface ExpressiveAlarm extends AlarmPoint
  * {
- *     &#64AlarmNameFormat(minimumLength=25)
- *     Property<String> systemName();
+ *     &#64;AlarmNameFormat(minimumLength=25)
+ *     Property&lt;String&gt; systemName();
  * }
  * </code></pre>
  * <p>

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmPoint.java
----------------------------------------------------------------------
diff --git a/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmPoint.java b/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmPoint.java
index 398ae30..81b98fd 100644
--- a/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmPoint.java
+++ b/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmPoint.java
@@ -51,7 +51,8 @@ import org.qi4j.api.property.Property;
  * <i>acknowledge</i> and must be present in all standard systems and standard impl.
  * </p>
  * <p>
- * The basic usage looks like this;<code><pre>
+ * The basic usage looks like this;
+ * <pre><code>
  *     // Creation
  *     AlarmPoint ala1 = alarmService.createAlarm( "My AlarmPoint" );
  *       :
@@ -59,16 +60,22 @@ import org.qi4j.api.property.Property;
  *     // use
  *     if( alarmcondition )  // The condition should only detect transitions.
  *         ala1.trigger( this, "activate" );
- * </pre></code>
+ * </code></pre>
  * <p>
  * It is important to know that every call to <code>trigger()</code>
  * will generate an AlarmEvent, so the <code>trigger()</code> should
  * only be called when the standard condition changes. For this purpose, there is
  * a convenience method, that will create/generate the <code>trigger</code>
  * method calls when a boolean standard condition changes. The usage is fairly
- * simple. Example;<code><pre>
- *     ala1.updateCondition( value > highlimit );
- * </pre></code>
+ * simple.
+ * </p>
+ * <p>
+ * Example;
+ * </p>
+ * <pre><code>
+ *     ala1.updateCondition( value &gt; highlimit );
+ * </code></pre>
+ * <p>
  * It is possible to mix and match the usage of <code>updateCondition()</code>
  * and <code>trigger()</code> methods without any concerns.
  * </p>
@@ -76,12 +83,12 @@ import org.qi4j.api.property.Property;
  * To create alarms with different AlarmModels, other than the
  * default as shown above, you need to retrieve the AlarmModel that
  * fulfill the needs required. This can be done in the following manner;
- * <code><pre>
+ * </p>
+ * <pre><code>
  *     AlarmModel[] impl = alarmService.getAlarmModelsAvailable();
  *     // selection algorithm
  *     AlarmPoint ala2 = impl[selected].createAlarm( "My AlarmPoint" );
- * </pre></code>
- * </p>
+ * </code></pre>
  * <p>
  * The default AlarmModel can be changed by a call to the
  * <code>AlarmSystem.setDefaultAlarmModel()</code> and
@@ -96,12 +103,9 @@ import org.qi4j.api.property.Property;
  * for the pre-defined AlarmPoint behaviours, and the others for the rest of
  * the Alarms.
  * </p>
- *
- * @author Niclas Hedhman
  */
 public interface AlarmPoint
 {
-
     String STATUS_NORMAL = "Normal";
     String STATUS_ACTIVATED = "Activated";
     String STATUS_DEACTIVATED = "Deactivated";
@@ -144,10 +148,12 @@ public interface AlarmPoint
     /**
      * Activates an AlarmPoint.
      * <p>
-     * Convinience method for:<pre>
-     *       trigger( "activate" );
-     *   </pre>
+     * Convenience method for:
      * </p>
+     * <pre><code>
+     *       trigger( "activate" );
+     * </code>
+     * </pre>
      */
     void activate();
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/libraries/alarm/src/main/java/org/qi4j/library/alarm/ExtendedAlarmModelService.java
----------------------------------------------------------------------
diff --git a/libraries/alarm/src/main/java/org/qi4j/library/alarm/ExtendedAlarmModelService.java b/libraries/alarm/src/main/java/org/qi4j/library/alarm/ExtendedAlarmModelService.java
index 227b35f..dbb764e 100644
--- a/libraries/alarm/src/main/java/org/qi4j/library/alarm/ExtendedAlarmModelService.java
+++ b/libraries/alarm/src/main/java/org/qi4j/library/alarm/ExtendedAlarmModelService.java
@@ -31,14 +31,12 @@ import org.qi4j.api.value.ValueBuilder;
 import org.qi4j.api.value.ValueBuilderFactory;
 
 /**
- * <p>
  * The Standard Model is centered around the Normal, Activated, Acknowledged
  * Deactivated, Reactivated, Blocked and Disabled states, and the triggers "activate", "deactivate",
  * "acknowledge", "block", "unblock", "enable" and "disable". The following matrix details the
- * resulting grid;
- * <p>
- * <table>
- * <tr><th>Initial State</th>* <th>Trigger</th><th>Resulting State</th><th>Event Generated</th></tr>
+ * resulting grid.
+ * <table summary="Transitions">
+ * <tr><th>Initial State</th><th>Trigger</th><th>Resulting State</th><th>Event Generated</th></tr>
  * <tr><td>Normal</td><td>activate</td><td>Activated</td><td>activation</td></tr>
  * <tr><td>Normal</td><td>deactivate</td><td>Normal</td><td>-</td></tr>
  * <tr><td>Normal</td><td>acknowledge</td><td>Normal</td><td>-</td></tr>
@@ -78,7 +76,6 @@ import org.qi4j.api.value.ValueBuilderFactory;
  * <tr><td>Activated</td><td>enable</td><td>Activated</td><td>-</td></tr>
  * <tr><td>Reactivated</td><td>enable</td><td>Reactivated</td><td>-</td></tr>
  * <tr><td>Disabled</td><td>enable</td><td>Normal</td><td>enable</td></tr>
- *
  * </table>
  */
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/libraries/alarm/src/main/java/org/qi4j/library/alarm/SimpleAlarmModelService.java
----------------------------------------------------------------------
diff --git a/libraries/alarm/src/main/java/org/qi4j/library/alarm/SimpleAlarmModelService.java b/libraries/alarm/src/main/java/org/qi4j/library/alarm/SimpleAlarmModelService.java
index 4f824ce..378709e 100644
--- a/libraries/alarm/src/main/java/org/qi4j/library/alarm/SimpleAlarmModelService.java
+++ b/libraries/alarm/src/main/java/org/qi4j/library/alarm/SimpleAlarmModelService.java
@@ -34,12 +34,10 @@ import org.qi4j.api.value.ValueBuilderFactory;
 public interface SimpleAlarmModelService extends AlarmModel, ServiceComposite
 {
     /**
-     * <p>
      * The Simple AlarmPoint Model is centered around the Normal and Activated.
      * The triggers "activate" and "deactivate". The following matrix details the
-     * resulting grid;
-     * <p>
-     * <table>
+     * resulting grid.
+     * <table summary="Transitions">
      * <tr><th>Initial State</th><th>Trigger</th><th>Resulting State</th><th>Event Generated</th></tr>
      * <tr><td>Normal</td><td>activate</td><td>Activated</td><td>activation</td></tr>
      * <tr><td>Normal</td><td>deactivate</td><td>Normal</td><td>-</td></tr>

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/libraries/alarm/src/main/java/org/qi4j/library/alarm/StandardAlarmModelService.java
----------------------------------------------------------------------
diff --git a/libraries/alarm/src/main/java/org/qi4j/library/alarm/StandardAlarmModelService.java b/libraries/alarm/src/main/java/org/qi4j/library/alarm/StandardAlarmModelService.java
index 80c731f..1911398 100644
--- a/libraries/alarm/src/main/java/org/qi4j/library/alarm/StandardAlarmModelService.java
+++ b/libraries/alarm/src/main/java/org/qi4j/library/alarm/StandardAlarmModelService.java
@@ -31,12 +31,13 @@ import org.qi4j.api.value.ValueBuilder;
 import org.qi4j.api.value.ValueBuilderFactory;
 
 /**
- * <p>
  * The Standard AlarmPoint Model is centered around the Normal, Activated, Acknowledged
  * and Deactivated states, and the triggers "activate", "deactivate",
- * and "acknowledge". The following matrix details the resulting grid;
+ * and "acknowledge".
  * <p>
- * <table>
+ * The following matrix details the resulting grid.
+ * </p>
+ * <table summary="Transitions">
  * <tr><th>Initial State</th><th>Trigger</th><th>Resulting State</th><th>Event Generated</th></tr>
  * <tr><td>Normal</td><td>activate</td><td>Activated</td><td>activation</td></tr>
  * <tr><td>Normal</td><td>deactivate</td><td>Normal</td><td>-</td></tr>

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/libraries/eventsourcing-rest/src/main/java/org/qi4j/library/eventsourcing/domain/rest/server/DomainEventSourceResource.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing-rest/src/main/java/org/qi4j/library/eventsourcing/domain/rest/server/DomainEventSourceResource.java b/libraries/eventsourcing-rest/src/main/java/org/qi4j/library/eventsourcing/domain/rest/server/DomainEventSourceResource.java
index 29788c4..4c59747 100644
--- a/libraries/eventsourcing-rest/src/main/java/org/qi4j/library/eventsourcing/domain/rest/server/DomainEventSourceResource.java
+++ b/libraries/eventsourcing-rest/src/main/java/org/qi4j/library/eventsourcing/domain/rest/server/DomainEventSourceResource.java
@@ -43,13 +43,17 @@ import org.restlet.resource.ResourceException;
 import static org.qi4j.functional.Iterables.iterable;
 
 /**
- * Get events in various formats. The feed is paged, with one
+ * Get events in various formats.
+ * <p>
+ * The feed is paged, with one
  * current set page, one working set page, and the rest being archive pages that never change. The links "next", "previous",
  * "first" and "last" are used as expected per the Atom spec.
- * <p/>
+ * </p>
+ * <pre><code>
  * / = current set of most recent events (event range: count-pagesize to count)
  * /n,m = events from index n to index m. These are archive pages.
  * /n = working set page, where n is the first event index to be presented
+ * </code></pre>>
  */
 public class DomainEventSourceResource
         extends Restlet

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/api/ApplicationEvent.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/api/ApplicationEvent.java b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/api/ApplicationEvent.java
index 038beb7..efd02d8 100644
--- a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/api/ApplicationEvent.java
+++ b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/api/ApplicationEvent.java
@@ -22,14 +22,19 @@ import org.qi4j.api.property.Property;
 import org.qi4j.api.value.ValueComposite;
 
 /**
- * Representation of an application-event. An application event is triggered by calling a method
+ * Representation of an application-event.
+ * <p>
+ * An application event is triggered by calling a method
  * that is of the form:
- * <p/>
+ * </p>
+ * <pre><code>
  * void someName(ApplicationEvent event, SomeParam param);
- * <p/>
+ * </code></pre>
+ * <p>
  * The "event" argument should be invoked with null, as it will be created during
  * the method call. If it is not null, then the method call is a replay of previously
  * created events.
+ * </p>
  */
 public interface ApplicationEvent
         extends ValueComposite, Identity

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/source/ApplicationEventSource.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/source/ApplicationEventSource.java b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/source/ApplicationEventSource.java
index 3dd335e..bb47de2 100644
--- a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/source/ApplicationEventSource.java
+++ b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/source/ApplicationEventSource.java
@@ -26,21 +26,28 @@ import org.qi4j.library.eventsourcing.application.api.TransactionApplicationEven
 public interface ApplicationEventSource
 {
     /**
-     * Get list of event transactions after the given timestamp. If they are on the exact same timestamp, they will not be included.
-     * <p/>
+     * Get list of event transactions after the given timestamp.
+     * <p>
+     * If they are on the exact same timestamp, they will not be included.
+     * </p>
+     * <p>
      * The method uses the visitor pattern, so a visitor is sent in which is given each transaction, one at a time.
-     *
+     * </p>
      * @param afterTimestamp timestamp of transactions
      */
     Input<TransactionApplicationEvents, IOException> transactionsAfter( long afterTimestamp, long maxTransactions );
 
     /**
-     * Get list of event transactions before the given timestamp. If they are on the exact same timestamp, they will not be included.
-     * <p/>
+     * Get list of event transactions before the given timestamp.
+     * <p>
+     * If they are on the exact same timestamp, they will not be included.
+     * </p>
+     * <p>
      * The method uses the visitor pattern, so a visitor is sent in which is given each transaction, one at a time.
-     * <p/>
+     * </p>
+     * <p>
      * The transactions are sent to the visitor with the latest transaction first, i.e. walking backwards in the stream.
-     *
+     * </p>
      * @param beforeTimestamp timestamp of transactions
      */
     Input<TransactionApplicationEvents, IOException> transactionsBefore( long beforeTimestamp, long maxTransactions );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/source/helper/ApplicationTransactionTracker.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/source/helper/ApplicationTransactionTracker.java b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/source/helper/ApplicationTransactionTracker.java
index 31600b7..17f04e2 100644
--- a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/source/helper/ApplicationTransactionTracker.java
+++ b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/source/helper/ApplicationTransactionTracker.java
@@ -28,14 +28,17 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Helper that enables a service to easily track transactions. Upon startup
- * the tracker will get all the transactions from the store since the last
+ * Helper that enables a service to easily track transactions.
+ * <p>
+ * Upon startup the tracker will get all the transactions from the store since the last
  * check, and delegate them to the given Output. It will also register itself
  * with the store so that it can get continuous updates.
- * <p/>
+ * </p>
+ * <p>
  * Then, as transactions come in from the store, they will be processed in real-time.
  * If a transaction is successfully handled the configuration of the service, which must
  * extend DomainEventTrackerConfiguration, will update the marker for the last successfully handled transaction.
+ * </p>
  */
 public class ApplicationTransactionTracker<ReceiverThrowableType extends Throwable>
 {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/api/DomainEventValue.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/api/DomainEventValue.java b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/api/DomainEventValue.java
index 61e537f..cf03741 100644
--- a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/api/DomainEventValue.java
+++ b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/api/DomainEventValue.java
@@ -21,11 +21,13 @@ import org.qi4j.api.property.Property;
 import org.qi4j.api.value.ValueComposite;
 
 /**
- * Representation of a domain-event. An event is triggered by calling a method
- * that is of the form:
- * <p/>
+ * Representation of a domain-event.
+ * <p>An event is triggered by calling a method that is of the form:
+ * </p>
+ * <pre><code>
  * &#64;DomainEvent
  * void someName(SomeParam param, AnotherParam param2);
+ * </code></pre>
  *
  */
 public interface DomainEventValue

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/EventSource.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/EventSource.java b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/EventSource.java
index 1bfc707..e025b3f 100644
--- a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/EventSource.java
+++ b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/EventSource.java
@@ -27,8 +27,10 @@ import org.qi4j.library.eventsourcing.domain.api.UnitOfWorkDomainEventsValue;
 public interface EventSource
 {
     /**
-     * Get list of UnitOfWorkDomainEventsValue after the given offset. To get the first set of events, use 0 as offset parameter to get events from the start.
-     * <p/>
+     * Get list of UnitOfWorkDomainEventsValue after the given offset.
+     * <p>
+     * To get the first set of events, use 0 as offset parameter to get events from the start.
+     * </p>
      *
      * @param offset where in the list of events to start
      * @param limit maximum number of events returned

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/helper/DomainEventTracker.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/helper/DomainEventTracker.java b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/helper/DomainEventTracker.java
index 5b8d63a..4673dfc 100644
--- a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/helper/DomainEventTracker.java
+++ b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/helper/DomainEventTracker.java
@@ -28,14 +28,18 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Helper that enables a service to easily track transactions. Upon startup
+ * Helper that enables a service to easily track transactions.
+ * <p>
+ * Upon startup
  * the tracker will get all the transactions from the store since the last
  * check, and delegate them to the given Output. It will also register itself
  * with the store so that it can get continuous updates.
- * <p/>
+ * </p>
+ * <p>
  * Then, as transactions come in from the store, they will be processed in real-time.
  * If a transaction is successfully handled the configuration of the service, which must
  * extend DomainEventTrackerConfiguration, will update the marker for the last successfully handled transaction.
+ * </p>
  */
 public class DomainEventTracker
         implements Runnable, UnitOfWorkEventsListener

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/libraries/fileconfig/src/main/java/org/qi4j/library/fileconfig/FileConfiguration.java
----------------------------------------------------------------------
diff --git a/libraries/fileconfig/src/main/java/org/qi4j/library/fileconfig/FileConfiguration.java b/libraries/fileconfig/src/main/java/org/qi4j/library/fileconfig/FileConfiguration.java
index 24f099a..17d4d9c 100644
--- a/libraries/fileconfig/src/main/java/org/qi4j/library/fileconfig/FileConfiguration.java
+++ b/libraries/fileconfig/src/main/java/org/qi4j/library/fileconfig/FileConfiguration.java
@@ -28,7 +28,8 @@ import java.io.File;
  * <p>
  * You can override defaults by adding org.qi4j.library.fileconfig.FileConfiguration_OS.properties files to your
  * classpath where OS is one of win, mac or unix.
- * <br/>
+ * </p>
+ * <p>
  * You can also override all properties definitions at assembly time by setting a FileConfigurationOverride object
  * as meta info of this service.
  * </p>

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/libraries/http/src/main/java/org/qi4j/library/http/SecureJettyConfiguration.java
----------------------------------------------------------------------
diff --git a/libraries/http/src/main/java/org/qi4j/library/http/SecureJettyConfiguration.java b/libraries/http/src/main/java/org/qi4j/library/http/SecureJettyConfiguration.java
index 9fcfd7e..ea26830 100644
--- a/libraries/http/src/main/java/org/qi4j/library/http/SecureJettyConfiguration.java
+++ b/libraries/http/src/main/java/org/qi4j/library/http/SecureJettyConfiguration.java
@@ -153,14 +153,14 @@ public interface SecureJettyConfiguration
     /**
      * If the {@link SecureJettyService} certificate MUST be PKIX validated.
      *
-     * <p/><b>IMPORTANT:</b>
+     * <p><b>IMPORTANT:</b></p>
      * <ul>
      *   <li>Server certificate validation do not use the configured truststore but the one of the JVM.</li>
      *   <li>Server certificates validation behavior depends on CRL and OCSP related configuration properties.</li>
      * </ul>
-     * <p/>
+     * <p>
      * Defaults to false.
-     *
+     * </p>
      * @return If the {@link SecureJettyService} certificate MUST be PKIX validated.
      */
     @UseDefaults
@@ -169,14 +169,14 @@ public interface SecureJettyConfiguration
     /**
      * If client certificates PKIX validation MUST use either CRL or OCSP.
      *
-     * <p/><b>IMPORTANT:</b>
+     * <p><b>IMPORTANT:</b></p>
      * <ul>
      *   <li>Peer certificates validation use the configured truststore if present, the one of the JVM if not.</li>
      *   <li>Peer certificates validation behavior depends on CRL and OCSP related configuration properties.</li>
      * </ul>
-     * <p/>
+     * <p>
      * Defaults to false.
-     *
+     * </p>
      * @return If client certificates PKIX validation MUST use either CRL or OCSP.
      */
     @UseDefaults

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/libraries/invocation-cache/src/main/java/org/qi4j/library/invocationcache/ReturnCachedValueOnExceptionConcern.java
----------------------------------------------------------------------
diff --git a/libraries/invocation-cache/src/main/java/org/qi4j/library/invocationcache/ReturnCachedValueOnExceptionConcern.java b/libraries/invocation-cache/src/main/java/org/qi4j/library/invocationcache/ReturnCachedValueOnExceptionConcern.java
index fa8d68d..400baf5 100644
--- a/libraries/invocation-cache/src/main/java/org/qi4j/library/invocationcache/ReturnCachedValueOnExceptionConcern.java
+++ b/libraries/invocation-cache/src/main/java/org/qi4j/library/invocationcache/ReturnCachedValueOnExceptionConcern.java
@@ -26,8 +26,9 @@ import org.qi4j.api.injection.scope.This;
 
 /**
  * Return value of @Cached calls on exceptions.
- * <p/>
+ * <p>
  * If an Exception occurs, try to reuse a previous result. Don't do anything on Throwables.
+ * </p>
  */
 @AppliesTo( Cached.class )
 public class ReturnCachedValueOnExceptionConcern

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/libraries/jmx/src/main/java/org/qi4j/library/jmx/JMXConnectorService.java
----------------------------------------------------------------------
diff --git a/libraries/jmx/src/main/java/org/qi4j/library/jmx/JMXConnectorService.java b/libraries/jmx/src/main/java/org/qi4j/library/jmx/JMXConnectorService.java
index 4e7a24b..0d41a4f 100644
--- a/libraries/jmx/src/main/java/org/qi4j/library/jmx/JMXConnectorService.java
+++ b/libraries/jmx/src/main/java/org/qi4j/library/jmx/JMXConnectorService.java
@@ -36,11 +36,15 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * This service starts a JMX RMI connector. It also creates an RMI-registry
+ * This service starts a JMX RMI connector.
+ * <p>
+ * It also creates an RMI-registry
  * to register the connector. The service is configured by changing the
  * settings in the JMXConnectorConfiguration.
- * <p/>
+ * </p>
+ * <p>
  * Authentication is done with an optional username+password in the configuration.
+ * </p>
  */
 @Mixins(JMXConnectorService.JmxConnectorMixin.class)
 @Activators( JMXConnectorService.Activator.class )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/libraries/lang-beanshell/src/main/java/org/qi4j/lang/beanshell/BeanShellMixin.java
----------------------------------------------------------------------
diff --git a/libraries/lang-beanshell/src/main/java/org/qi4j/lang/beanshell/BeanShellMixin.java b/libraries/lang-beanshell/src/main/java/org/qi4j/lang/beanshell/BeanShellMixin.java
index f47aea3..a276605 100644
--- a/libraries/lang-beanshell/src/main/java/org/qi4j/lang/beanshell/BeanShellMixin.java
+++ b/libraries/lang-beanshell/src/main/java/org/qi4j/lang/beanshell/BeanShellMixin.java
@@ -41,9 +41,12 @@ import org.qi4j.library.scripting.ScriptReloadable;
  * Each method in an interface is declared by a BeanShell method
  * in a file located in classpath with the name "&lt;interface&gt;.bsh",
  * where the interface name includes the package, and has "." replaced with "/".
- * <p/>
+ * <p>
  * Example:
+ * </p>
+ * <p>
  * org/qi4j/samples/hello/domain/HelloWorldSpeaker.bsh
+ * </p>
  */
 @AppliesTo( BeanShellMixin.AppliesTo.class )
 public class BeanShellMixin

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/libraries/lang-groovy/src/main/java/org/qi4j/lang/groovy/GroovyMixin.java
----------------------------------------------------------------------
diff --git a/libraries/lang-groovy/src/main/java/org/qi4j/lang/groovy/GroovyMixin.java b/libraries/lang-groovy/src/main/java/org/qi4j/lang/groovy/GroovyMixin.java
index 787c083..dd15683 100644
--- a/libraries/lang-groovy/src/main/java/org/qi4j/lang/groovy/GroovyMixin.java
+++ b/libraries/lang-groovy/src/main/java/org/qi4j/lang/groovy/GroovyMixin.java
@@ -42,10 +42,13 @@ import org.qi4j.io.Outputs;
  * using Groovy. Each method in an interface is declared by a Groovy method
  * in a file located in classpath with the name "<interface>.groovy",
  * where the interface name includes the package, and has "." replaced with "/".
- * <p/>
+ * <p>
  * Example:
+ * </p>
+ * <pre><code>
  * org/qi4j/samples/hello/domain/HelloWorldSpeaker.groovy
  * org/qi4j/samples/hello/domain/HelloWorldSpeaker.sayAgain.groovy
+ * </code></pre>
  *
  */
 @AppliesTo( GroovyMixin.AppliesTo.class )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/libraries/lang-javascript/src/main/java/org/qi4j/lang/javascript/JavaScriptMixin.java
----------------------------------------------------------------------
diff --git a/libraries/lang-javascript/src/main/java/org/qi4j/lang/javascript/JavaScriptMixin.java b/libraries/lang-javascript/src/main/java/org/qi4j/lang/javascript/JavaScriptMixin.java
index c48c208..f924f89 100644
--- a/libraries/lang-javascript/src/main/java/org/qi4j/lang/javascript/JavaScriptMixin.java
+++ b/libraries/lang-javascript/src/main/java/org/qi4j/lang/javascript/JavaScriptMixin.java
@@ -32,9 +32,12 @@ import org.qi4j.library.scripting.ScriptReloadable;
  * using Rhino. Each method in an interface is declared as a JS function
  * in a file located in classpath with the name "<interface>.<method>.js",
  * where the interface name includes the package, and has "." replaced with "/".
- * <p/>
+ * <p>
  * Example:
+ * </p>
+ * <pre><code>
  * org/qi4j/samples/hello/domain/HelloWorldSpeaker.say.js
+ * </code></pre>
  */
 @AppliesTo( JavaScriptMixin.AppliesTo.class )
 public class JavaScriptMixin

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/libraries/lang-jruby/src/main/java/org/qi4j/lang/jruby/JRubyMixin.java
----------------------------------------------------------------------
diff --git a/libraries/lang-jruby/src/main/java/org/qi4j/lang/jruby/JRubyMixin.java b/libraries/lang-jruby/src/main/java/org/qi4j/lang/jruby/JRubyMixin.java
index 682d99f..c36d7f6 100644
--- a/libraries/lang-jruby/src/main/java/org/qi4j/lang/jruby/JRubyMixin.java
+++ b/libraries/lang-jruby/src/main/java/org/qi4j/lang/jruby/JRubyMixin.java
@@ -41,9 +41,12 @@ import org.qi4j.library.scripting.ScriptReloadable;
  * using JRuby. Each method in an interface is declared by a Ruby method
  * in a file located in classpath with the name "<interface>.rb",
  * where the interface name includes the package, and has "." replaced with "/".
- * <p/>
+ * <p>
  * Example:
+ * </p>
+ * <pre><code>
  * org/qi4j/samples/hello/domain/HelloWorldSpeaker.rb
+ * </code></pre>
  */
 @AppliesTo( JRubyMixin.AppliesTo.class )
 public class JRubyMixin

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/libraries/logging/src/main/java/org/qi4j/logging/trace/Trace.java
----------------------------------------------------------------------
diff --git a/libraries/logging/src/main/java/org/qi4j/logging/trace/Trace.java b/libraries/logging/src/main/java/org/qi4j/logging/trace/Trace.java
index 02ae647..c56eeb0 100644
--- a/libraries/logging/src/main/java/org/qi4j/logging/trace/Trace.java
+++ b/libraries/logging/src/main/java/org/qi4j/logging/trace/Trace.java
@@ -17,19 +17,24 @@
  */
 package org.qi4j.logging.trace;
 
-import java.lang.annotation.*;
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
 import org.qi4j.api.injection.InjectionScope;
 
 /**
  * The Trace annotation is to indicate which methods should be traced when tracing is enabled.
- * <p/>
+ * <p>
  * The <i>level</i> of the Trace indicates the <i>threshold level</i> that the <code>Tracer</code> instance must be set
  * to, to enable tracing. If the <i>threshold level</i> of the <code>Tracer</code> instance is equal to or higher than
  * the <i>level</i> of the <code>Trace</code> annotation the method will be traced.
  * </p>
- * <p/>
+ * <p>
  * The <code>Trace</code> annotation will only be used for <code>TraceConcern</code> and not if the
  * all encompassing <code>TraceAllConcern</code> is used.
+ * </p>
  */
 @Retention( RetentionPolicy.RUNTIME )
 @Target( { ElementType.METHOD } )
@@ -47,7 +52,7 @@ public @interface Trace
 
     /**
      * The value is the threshold level required to enable the tracing.
-     * <p/>
+     * <p>
      * If the Trace level is set to 100 (default), it is required that the
      * Tracer (retrieved from the LogService) used is set to 100 or higher.
      * </p>

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/libraries/logging/src/main/java/org/qi4j/logging/trace/TraceAllConcern.java
----------------------------------------------------------------------
diff --git a/libraries/logging/src/main/java/org/qi4j/logging/trace/TraceAllConcern.java b/libraries/logging/src/main/java/org/qi4j/logging/trace/TraceAllConcern.java
index 332506f..f09cb3f 100644
--- a/libraries/logging/src/main/java/org/qi4j/logging/trace/TraceAllConcern.java
+++ b/libraries/logging/src/main/java/org/qi4j/logging/trace/TraceAllConcern.java
@@ -25,11 +25,11 @@ import org.qi4j.api.injection.scope.This;
 /**
  * The TraceAllConcern will call the traceEntry(), traceExit() and traceException() methods in the
  * Tracer instance associated with the CompositeType that the TraceAllConcern is part of.
- * <p/>
+ * <p>
  * The Trace paradigm is all about tracking the entry and exit (both normal and exceptional ones)
  * of methods.
  * </p>
- * <p/>
+ * <p>
  * The main difference to the <code>TraceConcern</code> is that this concern is not associated with
  * the <code>@Trace</code> annotation, and all methods in the interfaces will be traced, unless
  * the LogService has turned off tracing.

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/libraries/logging/src/main/java/org/qi4j/logging/trace/TraceConcern.java
----------------------------------------------------------------------
diff --git a/libraries/logging/src/main/java/org/qi4j/logging/trace/TraceConcern.java b/libraries/logging/src/main/java/org/qi4j/logging/trace/TraceConcern.java
index 89fba15..00ac950 100644
--- a/libraries/logging/src/main/java/org/qi4j/logging/trace/TraceConcern.java
+++ b/libraries/logging/src/main/java/org/qi4j/logging/trace/TraceConcern.java
@@ -26,7 +26,7 @@ import org.qi4j.api.injection.scope.This;
 /**
  * The TraceConcern will call the traceEntry(), traceExit() and traceException() methods in the
  * Tracer instance associated with the CompositeType that the TraceConcern is part of.
- * <p/>
+ * <p>
  * The Trace paradigm is all about tracking the entry and exit (both normal and exceptional ones)
  * of methods. The TraceConcern will be added to all methods that declares the <code>@Trace</code>
  * annotation, with an optional <i>level</i> argument. The <i>level</i> is the threshold of the
@@ -34,9 +34,10 @@ import org.qi4j.api.injection.scope.This;
  * must be equal or higher than the <i>level</i> set in the <code>@Trace</code> annotation of the
  * method.
  * </p>
- * <p/>
- * If the <i>priority</p> of the <code>Tracer</code> is set to OFF (Integer.MIN_VALUE) then no
+ * <p>
+ * If the <i>priority</i> of the <code>Tracer</code> is set to OFF (Integer.MIN_VALUE) then no
  * tracing will happen.
+ * </p>
  */
 @AppliesTo( Trace.class )
 public final class TraceConcern extends AbstractTraceConcern

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/libraries/osgi/src/main/java/org/qi4j/library/osgi/FallbackStrategy.java
----------------------------------------------------------------------
diff --git a/libraries/osgi/src/main/java/org/qi4j/library/osgi/FallbackStrategy.java b/libraries/osgi/src/main/java/org/qi4j/library/osgi/FallbackStrategy.java
index 2796c69..a725db2 100644
--- a/libraries/osgi/src/main/java/org/qi4j/library/osgi/FallbackStrategy.java
+++ b/libraries/osgi/src/main/java/org/qi4j/library/osgi/FallbackStrategy.java
@@ -15,13 +15,13 @@ import org.osgi.framework.ServiceReference;
  * The fallback strategy is invoked when the OSGi service is not available and a method call is invoked.
  * <p>
  * The FallbackStrategy is declared on the {@link OSGiServiceImporter} service declaration, like;
- * <code><pre>
+ * <pre><code>
  *     FallbackStrategy strategy = new MyStrategy();
  *     module.services( OSGiServiceImporter.class )
  *         .identifiedBy( "osgi" )
  *         .setMetaInfo( bundleContext )
  *         .setMetaInfo( strategy );
- * </pre></code>
+ * </code></pre>
  */
 public interface FallbackStrategy {
     Object invoke(final ServiceReference reference, Method method, Object... args);

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/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 1e39f62..e7ffb73 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
@@ -10,7 +10,7 @@ import org.restlet.data.Status;
 import org.restlet.resource.ResourceException;
 
 /**
- * Implements a chained list of specification->handler. Add the most specific handlers first, and the most generic last.
+ * Implements a chained list of specification-&gt;handler. Add the most specific handlers first, and the most generic last.
  */
 public class ErrorHandler
     implements ResponseHandler

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/libraries/rest-server/src/main/java/org/qi4j/library/rest/server/api/constraint/InteractionValidation.java
----------------------------------------------------------------------
diff --git a/libraries/rest-server/src/main/java/org/qi4j/library/rest/server/api/constraint/InteractionValidation.java b/libraries/rest-server/src/main/java/org/qi4j/library/rest/server/api/constraint/InteractionValidation.java
index b20b302..3739a22 100644
--- a/libraries/rest-server/src/main/java/org/qi4j/library/rest/server/api/constraint/InteractionValidation.java
+++ b/libraries/rest-server/src/main/java/org/qi4j/library/rest/server/api/constraint/InteractionValidation.java
@@ -19,29 +19,36 @@ package org.qi4j.library.rest.server.api.constraint;
 
 /**
  * Interface that resources can implement to achieve custom validation
- * of whether an interaction is valid or not. If the logic only applies for one
+ * of whether an interaction is valid or not.
+ * <p>
+ * If the logic only applies for one
  * method it is usually better to use this instead of creating a new annotation for it.
- * <p/>
+ * </p>
+ * <p>
  * This is triggered by annotating the method that should be validated like so:
+ * </p>
  * <pre><code>
  *
  * &#64;RequiresValid("xyz") public void xyz()
  * {...}
- * <p/>
+ *
  * </code></pre>
+ * <p>
  * This causes isValid("xyz") to be called. The isValid()
  * method can use the name to determine which set of logic is to be applied. Typically the provided
  * string will correspond to the name of the interaction, but this is not strictly necessary. It is
  * possible to combine several annotations on one method, if desired:
+ * </p>
  * <pre><code>
  *
  * &#64;RequiresValid("allowed") &#64;RequiresValid("officehours")
  * public void xyz()
  * {...}
  * </code></pre>
- * <p/>
+ * <p>
  * The validation occurs both when a Resource is computed for the resource as a whole, and when an actual
  * invocation of an interaction is made.
+ * </p>
  */
 public interface InteractionValidation
 {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/libraries/rest/src/main/java/org/qi4j/library/rest/admin/EntitiesResource.java
----------------------------------------------------------------------
diff --git a/libraries/rest/src/main/java/org/qi4j/library/rest/admin/EntitiesResource.java b/libraries/rest/src/main/java/org/qi4j/library/rest/admin/EntitiesResource.java
index c515013..b643178 100644
--- a/libraries/rest/src/main/java/org/qi4j/library/rest/admin/EntitiesResource.java
+++ b/libraries/rest/src/main/java/org/qi4j/library/rest/admin/EntitiesResource.java
@@ -43,8 +43,9 @@ import org.restlet.resource.ServerResource;
 
 /**
  * Listing of all Entities.
- * <p/>
+ * <p>
  * Mapped to /entity
+ * </p>
  */
 public class EntitiesResource
     extends ServerResource

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/Scheduler.java
----------------------------------------------------------------------
diff --git a/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/Scheduler.java b/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/Scheduler.java
index 1b30045..5052055 100644
--- a/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/Scheduler.java
+++ b/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/Scheduler.java
@@ -40,7 +40,7 @@ import static org.qi4j.api.unitofwork.concern.UnitOfWorkPropagation.Propagation.
  *
  * By default, a {@link Schedule} is not durable. In other words, it do not survive an {@link Application} restart.
  * To make a {@link Schedule} durable, set it's durable property to true once its scheduled.
- * Durable {@link Schedule}s that have no future run are removed by {@link SchedulerGarbageCollector}.
+ * Durable {@link Schedule}s that have no future run are removed by {@code SchedulerGarbageCollector} (not implemented?).
  */
 @Concerns( UnitOfWorkConcern.class )
 public interface Scheduler

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/libraries/spring/src/main/java/org/qi4j/library/spring/bootstrap/Qi4jApplicationBootstrap.java
----------------------------------------------------------------------
diff --git a/libraries/spring/src/main/java/org/qi4j/library/spring/bootstrap/Qi4jApplicationBootstrap.java b/libraries/spring/src/main/java/org/qi4j/library/spring/bootstrap/Qi4jApplicationBootstrap.java
index 1145ef5..02ca11f 100644
--- a/libraries/spring/src/main/java/org/qi4j/library/spring/bootstrap/Qi4jApplicationBootstrap.java
+++ b/libraries/spring/src/main/java/org/qi4j/library/spring/bootstrap/Qi4jApplicationBootstrap.java
@@ -23,8 +23,9 @@ import org.springframework.context.ApplicationContextAware;
 
 /**
  * Run a Qi4j Application as a Spring Bean and export its Services to Spring.
- * 
+ * <p>
  * Steps to export Qi4j service:
+ * </p>
  * <ul>
  * <li>Create spring BeanFactory service of qi4j services to export.</li>
  * <li>Create a class that extends {@link Qi4jApplicationBootstrap}.</li>
@@ -32,32 +33,33 @@ import org.springframework.context.ApplicationContextAware;
  * <li>Assemble qi4j application by implementing #assemble method.</li>
  * <li>Sets the identity of bean factory service. This identity is the spring
  * bean name.</li>
- * <li>Declare qi4j bootstrap in spring xml application context. <br/>
+ * <li>Declare qi4j bootstrap in spring xml application context. </li>
  * 
- * <pre>
- * &lt?xml version="1.0" encoding="UTF-8"?&gt<br/>
+ * <pre><code>
+ * &lt?xml version="1.0" encoding="UTF-8"?&gt
+ *
  * &lt;beans xmlns="http://www.springframework.org/schema/beans"
  * xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  * xmlns:qi4j="http://www.qi4j.org/schema/qi4j/spring"
  * xsi:schemaLocation="
  * http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
  * http://www.qi4j.org/schema/qi4j/spring http://www.qi4j.org/schema/qi4j/spring/spring-0.5.xsd"&gt
- * <br/>
+ *
  * &lt!-- class that implements Qi4jApplicationBootstrap --&gt
- * <br/>
+ *
  * &lt;qi4j:bootstrap class="org.qi4j.library.spring.bootstrap.Qi4jTestBootstrap"/&gt
- * <br/>
+ *
  * &lt;bean id="commentServiceHolder" class="org.qi4j.library.spring.bootstrap.CommentServiceHolder"&gt
- * <p/>
+ *
  * &lt;constructor-arg ref="commentService"/&gt &lt;!-- Reference qi4j comment service --&gt
- * <br/>
+ *
  * &lt;/bean&gt;
- * </pre>
+ * </code></pre>
  * </li>
  * </ul>
- * <p/>
  * <p>
  * <b>Importing Spring beans as services</b><br/>
+ * </p>
  * <ol>
  * <li>Application bootstrap class must implement interface
  * {@link ApplicationContextAware}.</li>
@@ -65,11 +67,10 @@ import org.springframework.context.ApplicationContextAware;
  * {@link ModuleAssembly#importedServices(Class...)}.</li>
  * <li>Set concrete Spring bean as meta-data of the imported service.</li>
  * </ol>
- * </p>
- * 
+ * <p>
  * Look at org.qi4j.library.spring.bootstrap.Qi4jExportServiceTest for sample
  * implementation.
- * 
+ * </p>
  */
 public abstract class Qi4jApplicationBootstrap
 {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/libraries/sql/src/main/java/org/qi4j/library/sql/common/SQLConfiguration.java
----------------------------------------------------------------------
diff --git a/libraries/sql/src/main/java/org/qi4j/library/sql/common/SQLConfiguration.java b/libraries/sql/src/main/java/org/qi4j/library/sql/common/SQLConfiguration.java
index a49167a..e03fc7d 100644
--- a/libraries/sql/src/main/java/org/qi4j/library/sql/common/SQLConfiguration.java
+++ b/libraries/sql/src/main/java/org/qi4j/library/sql/common/SQLConfiguration.java
@@ -19,7 +19,7 @@ import org.qi4j.api.configuration.ConfigurationComposite;
 import org.qi4j.api.property.Property;
 
 /**
- * Typical configuration for service, which uses a {@link DataSource} as connection to SQL
+ * Typical configuration for service, which uses a {@link javax.sql.DataSource} as connection to SQL
  * database, and given schema name as schema to create tables in.
  */
 public interface SQLConfiguration

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/singular/HasUoWFile.java
----------------------------------------------------------------------
diff --git a/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/singular/HasUoWFile.java b/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/singular/HasUoWFile.java
index 074312c..e0df50e 100644
--- a/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/singular/HasUoWFile.java
+++ b/libraries/uowfile/src/main/java/org/qi4j/library/uowfile/singular/HasUoWFile.java
@@ -30,6 +30,7 @@ public interface HasUoWFile
 {
     /**
      * IMPORTANT Use this {@link File} inside read-only {@link UnitOfWork}s only
+     * @return The file that is attached.
      */
     File attachedFile();
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/infrastructure/WicketQi4jApplication.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/infrastructure/WicketQi4jApplication.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/infrastructure/WicketQi4jApplication.java
index 8397cf8..1057bc6 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/infrastructure/WicketQi4jApplication.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/infrastructure/WicketQi4jApplication.java
@@ -75,11 +75,11 @@ public class WicketQi4jApplication
      *
      * If you like, you can also override this method in the custom application class and simply
      * return an instance of YourAssembler:
-     * <code><pre>
+     * <pre><code>
      * &#64;Override protected ApplicationAssembler getAssembler() {
      *     return new YourAssemblerInAnyPath();
      * }
-     * </pre></code>
+     * </code></pre>
      */
     protected ApplicationAssembler getAssembler()
         throws Exception

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/infrastructure/testing/ExpectedException.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/infrastructure/testing/ExpectedException.java b/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/infrastructure/testing/ExpectedException.java
index 496b6d7..568d750 100644
--- a/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/infrastructure/testing/ExpectedException.java
+++ b/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/infrastructure/testing/ExpectedException.java
@@ -22,19 +22,30 @@ import org.junit.runner.Description;
 import org.junit.runners.model.Statement;
 
 /**
- * ExpectedException
- *
+ * ExpectedException.
+ * <p>
  * Wrapper of {@link org.junit.rules.ExpectedException} in order to provide custom
  * expected exception one-liners for convenience.
- *
+ * </p>
+ * <p>
  * If you're checking certain DomainSpecificException often, you could wrap it here too...
- *
- * {@see http://alexruiz.developerblogs.com/?p=1530}
- *
+ * </p>
+ * <p>
+ * See <a href="http://alexruiz.developerblogs.com/?p=1530">http://alexruiz.developerblogs.com/?p=1530</a>
+ * </p>
+ * <p>
  * NOTE!
+ * </p>
+ * <p>
  * 1. the check for the expected exception must be immediately above the code that is expected to throw such exception
+ * </p>
+ * <p>
  * 2. the line of code that is expected to throw an exception should be the last line in the test method
- * {@see http://java.dzone.com/articles/unexpected-behavior-junits}
+ * </p>
+ * <p>
+ * See <a href="http://java.dzone.com/articles/unexpected-behavior-junits">http://java.dzone.com/articles/unexpected-behavior-junits</a>
+ * </p>
+ * <p>
  */
 public class ExpectedException implements TestRule
 {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/samples/dci/src/main/java/org/qi4j/dci/moneytransfer/context/PayBillsContext.java
----------------------------------------------------------------------
diff --git a/samples/dci/src/main/java/org/qi4j/dci/moneytransfer/context/PayBillsContext.java b/samples/dci/src/main/java/org/qi4j/dci/moneytransfer/context/PayBillsContext.java
index 1cfe255..3902a19 100644
--- a/samples/dci/src/main/java/org/qi4j/dci/moneytransfer/context/PayBillsContext.java
+++ b/samples/dci/src/main/java/org/qi4j/dci/moneytransfer/context/PayBillsContext.java
@@ -25,9 +25,9 @@ import org.qi4j.dci.moneytransfer.rolemap.CreditorRolemap;
 
 /**
  * Context for paying bills from an account to a list of creditor accounts.
- * <p/>
- * Roles are defined within the context
- * A RoleMap lists what Roles an entity can play.
+ * <p>
+ * Roles are defined within the context. A RoleMap lists what Roles an entity can play.
+ * </p>
  */
 public class PayBillsContext
 {
@@ -47,26 +47,37 @@ public class PayBillsContext
 
     /**
      * The SourceAccountRole orchestrates the Pay Bills use case interactions.
-     * <p/>
+     * <p>
      * Code matches the use case text carefully (see references below).
-     * <p/>
+     * </p>
+     * <p>
      * Pay Bills use case scenario:
-     * <p/>
-     * 1) Bank finds creditors (could be a use case scenario in itself)
-     * 2) Bank calculates the amount owed to creditors
-     * 3) Bank verifies sufficient funds
-     * 4) Bank transfer money to each creditor
-     * <p/>
+     * </p>
+     * <ol>
+     * <li> Bank finds creditors (could be a use case scenario in itself)</li>
+     * <li> Bank calculates the amount owed to creditors</li>
+     * <li>Bank verifies sufficient funds</li>
+     * <li>Bank transfer money to each creditor</li>
+     * </ol>
+     *
+     * <p>
      * Algorithm (steps to implement the scenario):
-     * <p/>
+     * </p>
+     * <p>
      * 1a) Source Account finds list of creditors
-     * <p/>
+     * </p>
+     * <p>
      * 2a) Source Account loops creditors to find the sum owed
-     * <p/>
+     * </p>
+     * <p>
      * 3a) Source Account verifies that its current balance is greater than the sum owed, and throws an exception if not
-     * <p/>
+     * </p>
+     * <p>
      * 4a) Source Account loops creditors
+     * </p>
+     * <p>
      * 4b) Make a MoneyTransfer of the amount owed to each creditor
+     * </p>
      */
 
     @Mixins( SourceAccountRole.Mixin.class )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/samples/dci/src/main/java/org/qi4j/dci/moneytransfer/context/PayBillsContext2.java
----------------------------------------------------------------------
diff --git a/samples/dci/src/main/java/org/qi4j/dci/moneytransfer/context/PayBillsContext2.java b/samples/dci/src/main/java/org/qi4j/dci/moneytransfer/context/PayBillsContext2.java
index e442978..c4030ba 100644
--- a/samples/dci/src/main/java/org/qi4j/dci/moneytransfer/context/PayBillsContext2.java
+++ b/samples/dci/src/main/java/org/qi4j/dci/moneytransfer/context/PayBillsContext2.java
@@ -22,9 +22,10 @@ import org.qi4j.dci.moneytransfer.domain.data.BalanceData;
 
 /**
  * Context for paying bills from an account to a list of creditor accounts.
- * <p/>
- * Roles are defined within the context
+ * <p>
+ * Roles are defined within the context.
  * A RoleMap lists what Roles an entity can play.
+ * </p>
  */
 public class PayBillsContext2
 {
@@ -47,26 +48,42 @@ public class PayBillsContext2
 
     /**
      * The SourceAccountRole orchestrates the Pay Bills use case interactions.
-     * <p/>
+     * <p>
      * Code matches the use case text carefully (see references below).
-     * <p/>
+     * </p>
+     * <p>
      * Pay Bills use case scenario:
-     * <p/>
+     * </p>
+     * <p>
      * 1) Bank finds creditors (could be a use case scenario in itself)
+     * </p>
+     * <p>
      * 2) Bank calculates the amount owed to creditors
+     * </p>
+     * <p>
      * 3) Bank verifies sufficient funds
+     * </p>
+     * <p>
      * 4) Bank transfer money to each creditor
-     * <p/>
+     * </p>
+     * <p>
      * Algorithm (steps to implement the scenario):
-     * <p/>
+     * </p>
+     * <p>
+     * <p>
      * 1a) Source Account finds list of creditors
-     * <p/>
+     * </p>
+     * <p>
      * 2a) Source Account loops creditors to find the sum owed
-     * <p/>
+     * </p>
+     * <p>
      * 3a) Source Account verifies that its current balance is greater than the sum owed, and throws an exception if not
-     * <p/>
+     * </p>
+     * <p>
      * 4a) Source Account loops creditors
+     * <p>
      * 4b) Make a MoneyTransfer of the amount owed to each creditor
+     * </p>
      */
     class SourceAccountRole
         extends Role<BalanceData>

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/samples/dddsample2/src/main/java/org/qi4j/samples/cargo/app1/model/cargo/Cargo.java
----------------------------------------------------------------------
diff --git a/samples/dddsample2/src/main/java/org/qi4j/samples/cargo/app1/model/cargo/Cargo.java b/samples/dddsample2/src/main/java/org/qi4j/samples/cargo/app1/model/cargo/Cargo.java
index 6ef80eb..4ca2a83 100755
--- a/samples/dddsample2/src/main/java/org/qi4j/samples/cargo/app1/model/cargo/Cargo.java
+++ b/samples/dddsample2/src/main/java/org/qi4j/samples/cargo/app1/model/cargo/Cargo.java
@@ -17,37 +17,45 @@ import org.qi4j.samples.cargo.app1.system.factories.DeliveryFactory;
 /**
  * A Cargo. This is the central class in the domain model,
  * and it is the root of the Cargo-Itinerary-Leg-Delivery-RouteSpecification aggregate.
- * <p/>
+ * <p>
  * A cargo is identified by a unique tracking id, and it always has an origin
  * and a route specification. The life cycle of a cargo begins with the booking procedure,
  * when the tracking id is assigned. During a (short) period of time, between booking
  * and initial routing, the cargo has no itinerary.
- * <p/>
+ * </p>
+ * <p>
  * The booking clerk requests a list of possible routes, matching the route specification,
  * and assigns the cargo to one route. The route to which a cargo is assigned is described
  * by an itinerary.
- * <p/>
+ * </p>
+ * <p>
  * A cargo can be re-routed during transport, on demand of the customer, in which case
  * a new route is specified for the cargo and a new route is requested. The old itinerary,
  * being a value object, is discarded and a new one is attached.
- * <p/>
+ * </p>
+ * <p>
  * It may also happen that a cargo is accidentally misrouted, which should notify the proper
  * personnel and also trigger a re-routing procedure.
- * <p/>
+ * </p>
+ * <p>
  * When a cargo is handled, the status of the delivery changes. Everything about the delivery
  * of the cargo is contained in the Delivery value object, which is replaced whenever a cargo
  * is handled by an asynchronous event triggered by the registration of the handling event.
- * <p/>
+ * </p>
+ * <p>
  * The delivery can also be affected by routing changes, i.e. when a the route specification
  * changes, or the cargo is assigned to a new route. In that case, the delivery update is performed
  * synchronously within the cargo aggregate.
- * <p/>
+ * </p>
+ * <p>
  * The life cycle of a cargo ends when the cargo is claimed by the customer.
- * <p/>
+ * </p>
+ * <p>
  * The cargo aggregate, and the entre domain model, is built to solve the problem
  * of booking and tracking cargo. All important business rules for determining whether
  * or not a cargo is misdirected, what the current status of the cargo is (on board carrier,
  * in port etc), are captured in this aggregate.
+ * </p>
  */
 @Mixins( Cargo.CargoMixin.class )
 public interface Cargo
@@ -81,16 +89,18 @@ public interface Cargo
     /**
      * Updates all aspects of the cargo aggregate status
      * based on the current route specification, itinerary and handling of the cargo.
-     * <p/>
+     * <p>
      * When either of those three changes, i.e. when a new route is specified for the cargo,
      * the cargo is assigned to a route or when the cargo is handled, the status must be
      * re-calculated.
-     * <p/>
+     * </p>
+     * <p>
      * {@link RouteSpecification} and {@link Itinerary} are both inside the Cargo
      * aggregate, so changes to them cause the status to be updated <b>synchronously</b>,
      * but changes to the delivery history (when a cargo is handled) cause the status update
      * to happen <b>asynchronously</b> since {@link org.qi4j.samples.cargo.app1.model.handling.HandlingEvent}
      * is in a different aggregate.
+     * </p>
      *
      * @param handlingHistory handling history
      */
@@ -176,17 +186,18 @@ public interface Cargo
         /**
          * Updates all aspects of the cargo aggregate status
          * based on the current route specification, itinerary and handling of the cargo.
-         * <p/>
+         * <p>
          * When either of those three changes, i.e. when a new route is specified for the cargo,
          * the cargo is assigned to a route or when the cargo is handled, the status must be
          * re-calculated.
-         * <p/>
+         * </p>
+         * <p>
          * {@link RouteSpecification} and {@link Itinerary} are both inside the Cargo
          * aggregate, so changes to them cause the status to be updated <b>synchronously</b>,
          * but changes to the delivery history (when a cargo is handled) cause the status update
          * to happen <b>asynchronously</b> since
          * {@link org.qi4j.samples.cargo.app1.model.handling.HandlingEvent} is in a different aggregate.
-         *
+         * </p>
          * @param handlingHistory handling history
          */
         public void deriveDeliveryProgress( final HandlingHistory handlingHistory )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tests/performance/src/perf/java/org/qi4j/test/performance/entitystore/sql/PostgreSQLEntityStorePerformanceTest.java
----------------------------------------------------------------------
diff --git a/tests/performance/src/perf/java/org/qi4j/test/performance/entitystore/sql/PostgreSQLEntityStorePerformanceTest.java b/tests/performance/src/perf/java/org/qi4j/test/performance/entitystore/sql/PostgreSQLEntityStorePerformanceTest.java
index 3e85392..4291297 100644
--- a/tests/performance/src/perf/java/org/qi4j/test/performance/entitystore/sql/PostgreSQLEntityStorePerformanceTest.java
+++ b/tests/performance/src/perf/java/org/qi4j/test/performance/entitystore/sql/PostgreSQLEntityStorePerformanceTest.java
@@ -38,10 +38,12 @@ import org.qi4j.test.performance.entitystore.AbstractEntityStorePerformanceTest;
 
 /**
  * Performance test for PostgreSQLEntityStore.
- * <p/>
+ * <p>
  * WARN This test is deactivated on purpose, please do not commit it activated.
- * <p/>
+ * </p>
+ * <p>
  * To run it see PostgreSQLEntityStoreTest.
+ * </p>
  */
 @Ignore( "WARN Tearing down this test is broken!" )
 public class PostgreSQLEntityStorePerformanceTest

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tests/performance/src/perf/java/org/qi4j/test/performance/runtime/composite/InvocationPerformanceTest.java
----------------------------------------------------------------------
diff --git a/tests/performance/src/perf/java/org/qi4j/test/performance/runtime/composite/InvocationPerformanceTest.java b/tests/performance/src/perf/java/org/qi4j/test/performance/runtime/composite/InvocationPerformanceTest.java
index 128dd9e..0e495ed 100644
--- a/tests/performance/src/perf/java/org/qi4j/test/performance/runtime/composite/InvocationPerformanceTest.java
+++ b/tests/performance/src/perf/java/org/qi4j/test/performance/runtime/composite/InvocationPerformanceTest.java
@@ -32,11 +32,13 @@ import org.qi4j.test.AbstractQi4jTest;
 
 /**
  * Invocation performance test.
- * <p/>
+ * <p>
  * Don't forget to add VM value "-server" before running this test!
- * <p/>
+ * </p>
+ * <p>
  * These tests are very sensitive to warmup of JVM, hence the duplication. Often the first round
  * is only for getting the code jitted, and the second round is what you want to look at.
+ * </p>
  */
 public class InvocationPerformanceTest
     extends AbstractQi4jTest

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tests/performance/src/perf/java/org/qi4j/test/performance/runtime/composite/PropertyMixinInvocationPerformanceTest.java
----------------------------------------------------------------------
diff --git a/tests/performance/src/perf/java/org/qi4j/test/performance/runtime/composite/PropertyMixinInvocationPerformanceTest.java b/tests/performance/src/perf/java/org/qi4j/test/performance/runtime/composite/PropertyMixinInvocationPerformanceTest.java
index b726623..6e38584 100644
--- a/tests/performance/src/perf/java/org/qi4j/test/performance/runtime/composite/PropertyMixinInvocationPerformanceTest.java
+++ b/tests/performance/src/perf/java/org/qi4j/test/performance/runtime/composite/PropertyMixinInvocationPerformanceTest.java
@@ -32,8 +32,9 @@ import org.qi4j.test.AbstractQi4jTest;
 
 /**
  * PropertyMixin invocation performance test.
- * <p/>
+ * <p>
  * Don't forget to add VM value "-server" before running this test!
+ * </p>
  */
 public class PropertyMixinInvocationPerformanceTest
     extends AbstractQi4jTest

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tools/envisage/src/main/java/org/qi4j/envisage/tree/TreeModelPane.java
----------------------------------------------------------------------
diff --git a/tools/envisage/src/main/java/org/qi4j/envisage/tree/TreeModelPane.java b/tools/envisage/src/main/java/org/qi4j/envisage/tree/TreeModelPane.java
index 7a34550..8d60aa8 100644
--- a/tools/envisage/src/main/java/org/qi4j/envisage/tree/TreeModelPane.java
+++ b/tools/envisage/src/main/java/org/qi4j/envisage/tree/TreeModelPane.java
@@ -38,9 +38,11 @@ import org.qi4j.tools.model.descriptor.ApplicationDetailDescriptor;
 
 /**
  * Application Model View as Swing Component.
- * It support 2 view:<br/>
- * - by Structure<br/>
- * - by Type<br/>
+ * It support 2 view:
+ * <pre><code>
+ * - by Structure
+ * - by Type
+ * </code></pre>
  */
 public final class TreeModelPane
     extends JPanel

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/package.html
----------------------------------------------------------------------
diff --git a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/package.html b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/package.html
index 04c0adf..7cd430b 100644
--- a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/package.html
+++ b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/package.html
@@ -6,16 +6,18 @@
 Description of TransientComposite tutorials.
 
 <h2>TransientComposite tutorials</h2>
-
+<p>
 Throughout this set of tutorials it will be shown how to create and work with TransientComposites, which
 is the basic element in Qi4j. We will refactor one HelloWorld class to take advantage of the various
 features in Qi4j. These refactorings will make it easier to reuse parts of the class,
 and introduce new features without having to change existing code. We will also look
 at some of the existing classes, or Fragments, available in Qi4j that you can reuse
 so that you don't have to write everything yourself.
-<p/>
+</p>
+<p>
 Each tutorial in this series starts with the result from the previous tutorial, so you can
 always look at the next tutorial step for guidance on what to do. Here are the steps:
+</p>
 <ol>
     <li>Interface refactoring</li>
     <li>Creating a TransientComposite</li>

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial1/package.html
----------------------------------------------------------------------
diff --git a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial1/package.html b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial1/package.html
index 408f76a..23d7725 100644
--- a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial1/package.html
+++ b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial1/package.html
@@ -1,22 +1,26 @@
 <body>
 <h1>Tutorial 1 - Interface refactoring</h1>
-
+<p>
 In this tutorial we start with a basic Java class, which when invoked will concatenate
 the two properties "phrase" and "name". If invoked with the properties set to "Hello"
 and "World" respectively it will hence return "Hello World".
-<p/>
+</p>
+<p>
 Qi4j relies heavily on the use of interfaces. This makes it possible for an object
 to externally implement a number of interfaces which internally is backed by a number
 of Mixins, some of which you may have written yourself, and some of which may have been
 reused. This also makes it easy to introduce Modifiers (aka "interceptors", aka "advice"),
 which are Fragments which execute before and/or after the method on the Mixin is invoked.
-<p/>
+</p>
+<p>
 The first task is therefore to refactor the code so that the method is implemented from an
 interface instead. We should then also separate the state into one interface and the behaviour
 into another. This will make things easier for us later when state and behaviour becomes
 implemented by separate Mixins.
-<p/>
+</p>
+<p>
 Steps for this tutorial:
+</p>
 <ol>
     <li>Refactor the class into interface and implementation.</li>
     <li>Refactor the interface so that it extends one interface called HelloWorldBehaviour with behaviour and one called


[12/50] [abbrv] zest-qi4j git commit: Gradle Wrapper now use 1.12

Posted by ni...@apache.org.
Gradle Wrapper now use 1.12

Yay, skipped tests are correctly now advertised in test reports.


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/3dd0f6a9
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/3dd0f6a9
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/3dd0f6a9

Branch: refs/heads/3.0
Commit: 3dd0f6a98e51217cd7a913480a59ff34d11dfa9a
Parents: b28f2c4
Author: Paul Merlin <pa...@nosphere.org>
Authored: Thu Jun 12 14:58:10 2014 +0200
Committer: Paul Merlin <pa...@nosphere.org>
Committed: Thu Jun 12 14:58:10 2014 +0200

----------------------------------------------------------------------
 gradle/wrapper/gradle-wrapper.jar        | Bin 51106 -> 51348 bytes
 gradle/wrapper/gradle-wrapper.properties |   4 ++--
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3dd0f6a9/gradle/wrapper/gradle-wrapper.jar
----------------------------------------------------------------------
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index 3c7abdf..0087cd3 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3dd0f6a9/gradle/wrapper/gradle-wrapper.properties
----------------------------------------------------------------------
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 5a9a8d8..947f764 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Mon Feb 17 09:34:59 CET 2014
+#Thu Jun 12 14:19:20 CEST 2014
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=http\://services.gradle.org/distributions/gradle-1.11-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-1.12-bin.zip


[31/50] [abbrv] zest-qi4j git commit: Replaced Joda Time with Java 8 Time API.

Posted by ni...@apache.org.
http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/booking/RoutePanel.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/booking/RoutePanel.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/booking/RoutePanel.java
index 5094ed7..1052770 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/booking/RoutePanel.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/booking/RoutePanel.java
@@ -77,11 +77,13 @@ public class RoutePanel extends Panel
             protected void populateItem( ListItem<Leg> item )
             {
                 Leg leg = item.getModelObject();
+                Date loadTime = new Date( leg.loadTime().get().toInstant().toEpochMilli() );
+                Date unloadTime = new Date( leg.unloadTime().get().toInstant().toEpochMilli() );
                 item.add( new Label( "voyage", leg.voyage().get().toString() ),
                           new Label( "loadLocation", leg.loadLocation().get().getCode() ),
-                          new Label( "loadTime", new Model<Date>( leg.loadTime().get() ) ),
+                          new Label( "loadTime", new Model<Date>( loadTime ) ),
                           new Label( "unloadLocation", leg.unloadLocation().get().getCode() ),
-                          new Label( "unloadTime", new Model<Date>( leg.unloadTime().get() ) )
+                          new Label( "unloadTime", new Model<Date>( unloadTime ) )
                 );
             }
         } );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/handling/IncidentLoggingApplicationMockupPage.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/handling/IncidentLoggingApplicationMockupPage.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/handling/IncidentLoggingApplicationMockupPage.java
index 57d1683..1e4b287 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/handling/IncidentLoggingApplicationMockupPage.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/handling/IncidentLoggingApplicationMockupPage.java
@@ -18,6 +18,10 @@
 package org.qi4j.sample.dcicargo.sample_b.communication.web.handling;
 
 import java.text.SimpleDateFormat;
+import java.time.LocalDate;
+import java.time.LocalTime;
+import java.time.ZoneOffset;
+import java.time.ZonedDateTime;
 import java.util.Date;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
@@ -30,8 +34,6 @@ import org.apache.wicket.model.Model;
 import org.apache.wicket.model.PropertyModel;
 import org.apache.wicket.model.StringResourceModel;
 import org.apache.wicket.util.value.ValueMap;
-import org.joda.time.DateTime;
-import org.joda.time.LocalDate;
 import org.qi4j.sample.dcicargo.sample_b.communication.query.CommonQueries;
 import org.qi4j.sample.dcicargo.sample_b.communication.query.HandlingQueries;
 import org.qi4j.sample.dcicargo.sample_b.communication.web.BasePage;
@@ -81,7 +83,7 @@ public class IncidentLoggingApplicationMockupPage extends BasePage
         FeedbackPanel feedback;
 
         // Form values
-        Date completion;
+        ZonedDateTime completion;
         String trackingId, unLocode, voyageNumber, eventType;
 
         // Input
@@ -100,7 +102,7 @@ public class IncidentLoggingApplicationMockupPage extends BasePage
             // Completion time
 
             final DateTextFieldWithPicker completionDateInput = new DateTextFieldWithPicker( "completion", "Completion", this );
-            completionDateInput.earliestDate( new LocalDate() );
+            completionDateInput.earliestDate( LocalDate.now() );
             add( completionDateInput.setLabel( Model.of( "Completion" ) ) );
 
             HandlingQueries fetch = new HandlingQueries();
@@ -198,7 +200,7 @@ public class IncidentLoggingApplicationMockupPage extends BasePage
 
                         // We simulate receiving raw text data from incident logging applications
                         // Add current time to date to have same-dates in processing order (would register full time in real app)
-                        Date adjustedCompletion = new Date( completion.getTime() + new DateTime().getMillisOfDay() );
+                        Date adjustedCompletion = new Date( completion.toInstant().toEpochMilli() );
                         String completionTimeString = new SimpleDateFormat( "yyyy-MM-dd HH:mm" ).format( adjustedCompletion );
 
                         // Parse "incoming" data (step 1 of ProcessHandlingEvent use case)

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/tracking/HandlingHistoryPanel.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/tracking/HandlingHistoryPanel.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/tracking/HandlingHistoryPanel.java
index c07442b..8a3c699 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/tracking/HandlingHistoryPanel.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/tracking/HandlingHistoryPanel.java
@@ -65,7 +65,10 @@ public class HandlingHistoryPanel extends Panel
                 item.add( new WebMarkupContainer( "onTrackIcon" ).add( new AttributeAppender( "src", iconName, "" ) ) );
 
                 // Date
-                item.add( new Label( "completion", new Model<Date>( event.completionTime().get() ) ) );
+                item.add( new Label( "completion", new Model<Date>( new Date( event.completionTime()
+                                                                                  .get()
+                                                                                  .toInstant()
+                                                                                  .toEpochMilli() ) ) ) );
 
                 // Event description (data substitution in strings from HandlingHistoryPanel.properties)
                 ValueMap map = new ValueMap();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/tracking/TrackCargoPage.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/tracking/TrackCargoPage.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/tracking/TrackCargoPage.java
index 2161a9a..9e55cb3 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/tracking/TrackCargoPage.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/tracking/TrackCargoPage.java
@@ -18,7 +18,8 @@
 package org.qi4j.sample.dcicargo.sample_b.communication.web.tracking;
 
 import java.text.SimpleDateFormat;
-import java.util.Date;
+import java.time.LocalDate;
+import java.time.ZonedDateTime;
 import java.util.List;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
@@ -168,10 +169,9 @@ public class TrackCargoPage extends BasePage
 
                 // ETA ----------------------------------------------------------------------
                 String destination = cargo.routeSpecification().get().destination().get().getString();
-                Date eta = cargo.delivery().get().eta().get();
-                String etaString = eta == null ? "?" : new SimpleDateFormat( "yyyy-MM-dd" ).format( eta );
+                ZonedDateTime eta = cargo.delivery().get().eta().get();
                 add( new Label( "eta", new StringResourceModel(
-                    "eta", this, null, Model.of( destination ), Model.of( etaString ) ) ) );
+                    "eta", this, null, Model.of( destination ), Model.of( eta.toString() ) ) ) );
 
                 // Warning/Notifier ----------------------------------------------------------------------
                 add( new WebMarkupContainer( "isMisdirected" ).setVisible( cargo.delivery()

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/booking/BookNewCargo.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/booking/BookNewCargo.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/booking/BookNewCargo.java
index deed463..957888d 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/booking/BookNewCargo.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/booking/BookNewCargo.java
@@ -17,7 +17,9 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.interaction.booking;
 
-import java.util.Date;
+import java.time.Instant;
+import java.time.LocalDate;
+import java.time.ZonedDateTime;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.injection.scope.Service;
 import org.qi4j.api.injection.scope.This;
@@ -55,9 +57,9 @@ public class BookNewCargo extends Context
 
     private Location origin;
     private Location destination;
-    private Date arrivalDeadline;
+    private ZonedDateTime arrivalDeadline;
 
-    public BookNewCargo( CargoFactory cargoFactory, Location origin, Location destination, Date arrivalDeadline )
+    public BookNewCargo( CargoFactory cargoFactory, Location origin, Location destination, ZonedDateTime arrivalDeadline )
         throws Exception
     {
         bookingSystem = rolePlayer( BookingSystemRole.class, cargoFactory );
@@ -66,7 +68,7 @@ public class BookNewCargo extends Context
         this.arrivalDeadline = arrivalDeadline;
     }
 
-    public BookNewCargo( String originId, String destinationId, Date deadline )
+    public BookNewCargo( String originId, String destinationId, ZonedDateTime deadline )
         throws Exception
     {
         this( loadEntity( CargoAggregateRoot.class, CargoAggregateRoot.CARGOS_ID ),
@@ -108,14 +110,14 @@ public class BookNewCargo extends Context
             public TrackingId createCargo( String trackingIdString )
                 throws Exception
             {
-                Date earliestDeparture = new Date();
+                ZonedDateTime earliestDeparture = ZonedDateTime.now();
                 RouteSpecification routeSpec = routeSpecFactory.build( c.origin,
                                                                        c.destination,
                                                                        earliestDeparture,
                                                                        c.arrivalDeadline );
 
                 ValueBuilder<Delivery> delivery = vbf.newValueBuilder( Delivery.class );
-                delivery.prototype().timestamp().set( new Date() );
+                delivery.prototype().timestamp().set( Instant.now() );
                 delivery.prototype().transportStatus().set( TransportStatus.NOT_RECEIVED );
                 delivery.prototype().routingStatus().set( RoutingStatus.NOT_ROUTED );
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/booking/routing/AssignCargoToRoute.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/booking/routing/AssignCargoToRoute.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/booking/routing/AssignCargoToRoute.java
index b656771..4c804fb 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/booking/routing/AssignCargoToRoute.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/booking/routing/AssignCargoToRoute.java
@@ -17,7 +17,9 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.interaction.booking.routing;
 
-import java.util.Date;
+import java.time.Duration;
+import java.time.Instant;
+import java.time.ZonedDateTime;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.value.ValueBuilder;
@@ -39,8 +41,12 @@ import org.qi4j.sample.dcicargo.sample_b.infrastructure.dci.Context;
 import org.qi4j.sample.dcicargo.sample_b.infrastructure.dci.RoleMixin;
 
 import static org.qi4j.sample.dcicargo.sample_b.data.structure.delivery.RoutingStatus.ROUTED;
-import static org.qi4j.sample.dcicargo.sample_b.data.structure.delivery.TransportStatus.*;
-import static org.qi4j.sample.dcicargo.sample_b.data.structure.handling.HandlingEventType.*;
+import static org.qi4j.sample.dcicargo.sample_b.data.structure.delivery.TransportStatus.CLAIMED;
+import static org.qi4j.sample.dcicargo.sample_b.data.structure.delivery.TransportStatus.NOT_RECEIVED;
+import static org.qi4j.sample.dcicargo.sample_b.data.structure.delivery.TransportStatus.ONBOARD_CARRIER;
+import static org.qi4j.sample.dcicargo.sample_b.data.structure.handling.HandlingEventType.LOAD;
+import static org.qi4j.sample.dcicargo.sample_b.data.structure.handling.HandlingEventType.RECEIVE;
+import static org.qi4j.sample.dcicargo.sample_b.data.structure.handling.HandlingEventType.UNLOAD;
 
 /**
  * Assign Cargo to Route (subfunction use case)
@@ -149,16 +155,12 @@ public class AssignCargoToRoute extends Context
                                                                                                .get() );
 
                     // Estimate carrier arrival time
-                    Date estimatedArrivalDate = carrierMovement.arrivalTime().get();
-                    if( c.lastHandlingEvent.completionTime().get().after( carrierMovement.departureTime().get() ) )
+                    ZonedDateTime estimatedArrivalDate = carrierMovement.arrivalTime().get();
+                    if( c.lastHandlingEvent.completionTime().get().isAfter( carrierMovement.departureTime().get() ) )
                     {
-                        long start = carrierMovement.departureTime().get().getTime();
-                        long end = carrierMovement.arrivalTime().get().getTime();
-                        long duration = end - start;
-                        estimatedArrivalDate = new Date( c.lastHandlingEvent
-                                                             .completionTime()
-                                                             .get()
-                                                             .getTime() + duration );
+                        Duration duration = Duration.between( carrierMovement.departureTime().get(),
+                                                              carrierMovement.arrivalTime().get() );
+                        estimatedArrivalDate = c.lastHandlingEvent.completionTime().get().plus(duration);
                     }
 
                     nextHandlingEvent.handlingEventType().set( UNLOAD );
@@ -179,7 +181,7 @@ public class AssignCargoToRoute extends Context
 
                 ValueBuilder<Delivery> deliveryBuilder = vbf.newValueBuilder( Delivery.class );
                 newDelivery = deliveryBuilder.prototype();
-                newDelivery.timestamp().set( new Date() );
+                newDelivery.timestamp().set( Instant.now() );
                 newDelivery.lastHandlingEvent().set( c.lastHandlingEvent );
                 newDelivery.transportStatus().set( c.transportStatus );
                 newDelivery.isUnloadedAtDestination().set( false );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/booking/specification/DeriveUpdatedRouteSpecification.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/booking/specification/DeriveUpdatedRouteSpecification.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/booking/specification/DeriveUpdatedRouteSpecification.java
index 106ea51..01f72fd 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/booking/specification/DeriveUpdatedRouteSpecification.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/booking/specification/DeriveUpdatedRouteSpecification.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.interaction.booking.specification;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.qi4j.api.injection.scope.Service;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.mixin.Mixins;
@@ -106,8 +106,8 @@ public class DeriveUpdatedRouteSpecification extends Context
 
             Location newOrigin;
             Location newDestination;
-            Date newEarliestDeparture;
-            Date newArrivalDeadline;
+            ZonedDateTime newEarliestDeparture;
+            ZonedDateTime newArrivalDeadline;
 
             public RouteSpecification getUpdatedRouteSpecification()
                 throws CannotCreateRouteSpecificationException, UnexpectedCarrierException

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectArrivedCargo.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectArrivedCargo.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectArrivedCargo.java
index 563d637..a0a2eb3 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectArrivedCargo.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectArrivedCargo.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.inspection.event;
 
-import java.util.Date;
+import java.time.Instant;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.value.ValueBuilder;
@@ -42,7 +42,6 @@ import static org.qi4j.sample.dcicargo.sample_b.data.structure.handling.Handling
 /**
  * Inspect Arrived Cargo (subfunction use case)
  *
- * This is one the variations of the {@link com.marcgrue.dcisample_b.context.interaction.handling.inspection.InspectCargoDeliveryStatus} use case.
  */
 public class InspectArrivedCargo extends Context
 {
@@ -110,7 +109,7 @@ public class InspectArrivedCargo extends Context
 
                 ValueBuilder<Delivery> newDeliveryBuilder = vbf.newValueBuilder( Delivery.class );
                 newDelivery = newDeliveryBuilder.prototype();
-                newDelivery.timestamp().set( new Date() );
+                newDelivery.timestamp().set( Instant.now() );
                 newDelivery.lastHandlingEvent().set( c.arrivalEvent );
                 newDelivery.transportStatus().set( IN_PORT );
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectCargoInCustoms.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectCargoInCustoms.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectCargoInCustoms.java
index 8b67067..3393223 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectCargoInCustoms.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectCargoInCustoms.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.inspection.event;
 
-import java.util.Date;
+import java.time.Instant;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.value.ValueBuilder;
@@ -41,7 +41,6 @@ import static org.qi4j.sample.dcicargo.sample_b.data.structure.handling.Handling
 /**
  * Inspect Cargo In Customs (subfunction use case)
  *
- * This is one the variations of the {@link com.marcgrue.dcisample_b.context.interaction.handling.inspection.InspectCargoDeliveryStatus} use case.
  *
  * Can the cargo get handled by customs only in the current port location?! Nothing now prevents
  * an unexpected cargo in customs in some random location. A domain expert is needed to explain
@@ -117,7 +116,7 @@ public class InspectCargoInCustoms extends Context
 
                 ValueBuilder<Delivery> newDeliveryBuilder = vbf.newValueBuilder( Delivery.class );
                 newDelivery = newDeliveryBuilder.prototype();
-                newDelivery.timestamp().set( new Date() );
+                newDelivery.timestamp().set( Instant.now() );
                 newDelivery.lastHandlingEvent().set( c.customsEvent );
                 newDelivery.transportStatus().set( IN_PORT );
                 newDelivery.isUnloadedAtDestination().set( false );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectClaimedCargo.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectClaimedCargo.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectClaimedCargo.java
index 110a441..bff45d6 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectClaimedCargo.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectClaimedCargo.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.inspection.event;
 
-import java.util.Date;
+import java.time.Instant;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.value.ValueBuilder;
@@ -39,8 +39,6 @@ import static org.qi4j.sample.dcicargo.sample_b.data.structure.handling.Handling
 /**
  * Inspect Claimed Cargo (subfunction use case)
  *
- * This is one the variations of the {@link com.marcgrue.dcisample_b.context.interaction.handling.inspection.InspectCargoDeliveryStatus} use case.
- *
  * NOTE: We don't throw any misrouted/misdirected exceptions even though the cargo might not have
  * followed the original itinerary. The cargo has been delivered at destination and claimed by
  * Cargo Owner, so we're happy no matter how it got there.
@@ -106,7 +104,7 @@ public class InspectClaimedCargo extends Context
 
                 ValueBuilder<Delivery> newDeliveryBuilder = vbf.newValueBuilder( Delivery.class );
                 newDelivery = newDeliveryBuilder.prototype();
-                newDelivery.timestamp().set( new Date() );
+                newDelivery.timestamp().set( Instant.now() );
                 newDelivery.lastHandlingEvent().set( c.claimEvent );
                 newDelivery.transportStatus().set( CLAIMED );
                 newDelivery.isUnloadedAtDestination().set( false ); // Why not true if claimed in final destination?

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectLoadedCargo.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectLoadedCargo.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectLoadedCargo.java
index 0625040..3ae1f99 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectLoadedCargo.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectLoadedCargo.java
@@ -17,7 +17,9 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.inspection.event;
 
-import java.util.Date;
+import java.time.Duration;
+import java.time.Instant;
+import java.time.ZonedDateTime;
 import java.util.Random;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.mixin.Mixins;
@@ -102,7 +104,7 @@ public class InspectLoadedCargo extends Context
         deliveryInspector.inspectLoadedCargo();
     }
 
-    @Mixins( DeliveryInspectorRole.Mixin.class )
+    @Mixins(DeliveryInspectorRole.Mixin.class)
     public interface DeliveryInspectorRole
     {
         void setContext( InspectLoadedCargo context );
@@ -124,7 +126,7 @@ public class InspectLoadedCargo extends Context
 
                 ValueBuilder<Delivery> newDeliveryBuilder = vbf.newValueBuilder( Delivery.class );
                 newDelivery = newDeliveryBuilder.prototype();
-                newDelivery.timestamp().set( new Date() );
+                newDelivery.timestamp().set( Instant.now() );
                 newDelivery.lastHandlingEvent().set( c.loadEvent );
                 newDelivery.transportStatus().set( ONBOARD_CARRIER );
                 newDelivery.isUnloadedAtDestination().set( false );
@@ -144,13 +146,12 @@ public class InspectLoadedCargo extends Context
                 }
 
                 // Estimate carrier arrival time
-                Date estimatedArrivalDate = carrierMovement.arrivalTime().get();
-                if( c.loadEvent.completionTime().get().after( carrierMovement.departureTime().get() ) )
+                ZonedDateTime estimatedArrivalDate = carrierMovement.arrivalTime().get();
+                if( c.loadEvent.completionTime().get().isAfter( carrierMovement.departureTime().get() ) )
                 {
-                    long start = carrierMovement.departureTime().get().getTime();
-                    long end = carrierMovement.arrivalTime().get().getTime();
-                    long duration = end - start;
-                    estimatedArrivalDate = new Date( c.loadEvent.completionTime().get().getTime() + duration );
+                    Duration duration = Duration.between( carrierMovement.departureTime().get(),
+                                                          carrierMovement.arrivalTime().get() );
+                    estimatedArrivalDate = c.loadEvent.completionTime().get().plus(duration);
                     // ... We could notify cargo owner if we already now know that we will miss the next ship
                 }
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectReceivedCargo.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectReceivedCargo.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectReceivedCargo.java
index 3caa509..f9f2578 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectReceivedCargo.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectReceivedCargo.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.inspection.event;
 
-import java.util.Date;
+import java.time.Instant;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.value.ValueBuilder;
@@ -44,8 +44,6 @@ import static org.qi4j.sample.dcicargo.sample_b.data.structure.handling.Handling
 /**
  * Inspect Received Cargo (subfunction use case)
  *
- * This is one the variations of the {@link com.marcgrue.dcisample_b.context.interaction.handling.inspection.InspectCargoDeliveryStatus} use case.
- *
  * Note that we consider the cargo still on track if it's received in cargo origin regardless of routing status!
  */
 public class InspectReceivedCargo extends Context
@@ -121,7 +119,7 @@ public class InspectReceivedCargo extends Context
 
                 ValueBuilder<Delivery> newDeliveryBuilder = vbf.newValueBuilder( Delivery.class );
                 newDelivery = newDeliveryBuilder.prototype();
-                newDelivery.timestamp().set( new Date() );
+                newDelivery.timestamp().set( Instant.now() );
                 newDelivery.lastHandlingEvent().set( c.receiveEvent );
                 newDelivery.transportStatus().set( IN_PORT );
                 newDelivery.isUnloadedAtDestination().set( false );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectUnhandledCargo.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectUnhandledCargo.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectUnhandledCargo.java
index 476586c..894f799 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectUnhandledCargo.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectUnhandledCargo.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.inspection.event;
 
-import java.util.Date;
+import java.time.Instant;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.value.ValueBuilder;
@@ -39,8 +39,6 @@ import static org.qi4j.sample.dcicargo.sample_b.data.structure.handling.Handling
 /**
  * Inspect Unhandled Cargo (subfunction use case)
  *
- * This is one the variations of the {@link com.marcgrue.dcisample_b.context.interaction.handling.inspection.InspectCargoDeliveryStatus} use case.
- *
  * Here we can check a cargo that hasn't been received in origin yet.
  */
 public class InspectUnhandledCargo extends Context
@@ -98,7 +96,7 @@ public class InspectUnhandledCargo extends Context
 
                 ValueBuilder<Delivery> newDeliveryBuilder = vbf.newValueBuilder( Delivery.class );
                 newDelivery = newDeliveryBuilder.prototype();
-                newDelivery.timestamp().set( new Date() );
+                newDelivery.timestamp().set( Instant.now() );
                 newDelivery.lastHandlingEvent().set( null );
                 newDelivery.transportStatus().set( NOT_RECEIVED );
                 newDelivery.isUnloadedAtDestination().set( false );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectUnloadedCargo.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectUnloadedCargo.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectUnloadedCargo.java
index fe64e12..a61d84d 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectUnloadedCargo.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/inspection/event/InspectUnloadedCargo.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.inspection.event;
 
-import java.util.Date;
+import java.time.Instant;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.value.ValueBuilder;
@@ -46,7 +46,6 @@ import static org.qi4j.sample.dcicargo.sample_b.data.structure.handling.Handling
 /**
  * Inspect Unloaded Cargo (subfunction use case)
  *
- * This is one the variations of the {@link com.marcgrue.dcisample_b.context.interaction.handling.inspection.InspectCargoDeliveryStatus} use case.
  */
 public class InspectUnloadedCargo extends Context
 {
@@ -117,7 +116,7 @@ public class InspectUnloadedCargo extends Context
 
                 ValueBuilder<Delivery> newDeliveryBuilder = vbf.newValueBuilder( Delivery.class );
                 newDelivery = newDeliveryBuilder.prototype();
-                newDelivery.timestamp().set( new Date() );
+                newDelivery.timestamp().set( Instant.now() );
                 newDelivery.lastHandlingEvent().set( c.unloadEvent );
                 newDelivery.transportStatus().set( IN_PORT );
                 newDelivery.isUnloadedAtDestination().set( false );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/parsing/ParseHandlingEventData.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/parsing/ParseHandlingEventData.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/parsing/ParseHandlingEventData.java
index 21d6fef..db5312c 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/parsing/ParseHandlingEventData.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/parsing/ParseHandlingEventData.java
@@ -17,9 +17,8 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.parsing;
 
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
+import java.time.ZonedDateTime;
+import java.time.format.DateTimeParseException;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.injection.scope.Structure;
 import org.qi4j.api.mixin.Mixins;
@@ -45,7 +44,7 @@ import org.qi4j.sample.dcicargo.sample_b.data.structure.handling.HandlingEventTy
  * a file upload solution like UploadDirectoryScanner in the DDD sample - or some other
  * technical solution.
  */
-@Mixins( ParseHandlingEventData.Mixin.class )
+@Mixins(ParseHandlingEventData.Mixin.class)
 public interface ParseHandlingEventData
     extends ServiceComposite
 {
@@ -66,9 +65,7 @@ public interface ParseHandlingEventData
         @Structure
         ValueBuilderFactory vbf;
 
-        static final String ISO_8601_FORMAT = "yyyy-MM-dd HH:mm";
-
-        Date completionTime;
+        ZonedDateTime completionTime;
         HandlingEventType handlingEventType;
 
         public ParsedHandlingEventData parse( String completionStr,
@@ -83,17 +80,12 @@ public interface ParseHandlingEventData
 
             try
             {
-                completionTime = new SimpleDateFormat( ISO_8601_FORMAT ).parse( completionStr.trim() );
+                completionTime = ZonedDateTime.parse( completionStr.trim() );
+                handlingEventType = HandlingEventType.valueOf( handlingEventTypeStr.trim() );
             }
-            catch( ParseException e )
+            catch( DateTimeParseException e )
             {
-                throw new InvalidHandlingEventDataException(
-                    "Invalid date format: '" + completionStr + "' must be on ISO 8601 format " + ISO_8601_FORMAT );
-            }
-
-            try
-            {
-                handlingEventType = HandlingEventType.valueOf( handlingEventTypeStr.trim() );
+                throw new InvalidHandlingEventDataException( "Invalid date format: '" + completionStr + "' must be on ISO 8601 format yyyy-MM-dd HH:mm" );
             }
             catch( Exception e )
             {
@@ -103,7 +95,7 @@ public interface ParseHandlingEventData
             // Step 4 - Collect parsed handling event data
 
             ValueBuilder<ParsedHandlingEventData> parsedData = vbf.newValueBuilder( ParsedHandlingEventData.class );
-            parsedData.prototype().registrationTime().set( new Date() );
+            parsedData.prototype().registrationTime().set( ZonedDateTime.now() );
             parsedData.prototype().completionTime().set( completionTime );
             parsedData.prototype().trackingIdString().set( trackingIdStr );
             parsedData.prototype().handlingEventType().set( handlingEventType );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/parsing/dto/ParsedHandlingEventData.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/parsing/dto/ParsedHandlingEventData.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/parsing/dto/ParsedHandlingEventData.java
index 19a8410..9f22bbd 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/parsing/dto/ParsedHandlingEventData.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/parsing/dto/ParsedHandlingEventData.java
@@ -18,7 +18,7 @@
 package org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.parsing.dto;
 
 import java.text.SimpleDateFormat;
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.property.Immutable;
@@ -33,9 +33,9 @@ import org.qi4j.sample.dcicargo.sample_b.infrastructure.conversion.DTO;
 @Mixins( ParsedHandlingEventData.Mixin.class )
 public interface ParsedHandlingEventData extends DTO
 {
-    Property<Date> registrationTime();
+    Property<ZonedDateTime> registrationTime();
 
-    Property<Date> completionTime();
+    Property<ZonedDateTime> completionTime();
 
     Property<String> trackingIdString();
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/registration/exception/CannotRegisterHandlingEventException.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/registration/exception/CannotRegisterHandlingEventException.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/registration/exception/CannotRegisterHandlingEventException.java
index ea3692a..8f52055 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/registration/exception/CannotRegisterHandlingEventException.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/registration/exception/CannotRegisterHandlingEventException.java
@@ -17,8 +17,6 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.registration.exception;
 
-import java.text.SimpleDateFormat;
-import java.util.Date;
 import org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.parsing.dto.ParsedHandlingEventData;
 import org.qi4j.sample.dcicargo.sample_b.data.structure.handling.HandlingEvent;
 
@@ -41,7 +39,7 @@ public class CannotRegisterHandlingEventException extends Exception
         super();
         this.parsedHandlingEventData = parsedHandlingEventData;
 
-        time = parseDate( parsedHandlingEventData.completionTime().get() );
+        time = parsedHandlingEventData.completionTime().get().toString();
         id = parse( parsedHandlingEventData.trackingIdString().get() );
         type = parse( parsedHandlingEventData.handlingEventType().get().name() );
         unloc = parse( parsedHandlingEventData.unLocodeString().get() );
@@ -57,9 +55,4 @@ public class CannotRegisterHandlingEventException extends Exception
     {
         return str == null ? "null" : str;
     }
-
-    private String parseDate( Date date )
-    {
-        return date == null ? "null" : new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" ).format( date );
-    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/registration/exception/ChronologicalException.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/registration/exception/ChronologicalException.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/registration/exception/ChronologicalException.java
index 94a0371..b40ff6c 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/registration/exception/ChronologicalException.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/registration/exception/ChronologicalException.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.registration.exception;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.parsing.dto.ParsedHandlingEventData;
 
 /**
@@ -25,9 +25,9 @@ import org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.parsing.dt
  */
 public final class ChronologicalException extends CannotRegisterHandlingEventException
 {
-    Date lastCompletionTime;
+    ZonedDateTime lastCompletionTime;
 
-    public ChronologicalException( ParsedHandlingEventData parsedHandlingEventData, Date lastCompletionTime )
+    public ChronologicalException( ParsedHandlingEventData parsedHandlingEventData, ZonedDateTime lastCompletionTime )
     {
         super( parsedHandlingEventData );
         this.lastCompletionTime = lastCompletionTime;

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/service/routing/RoutingService.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/service/routing/RoutingService.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/service/routing/RoutingService.java
index 9296df2..0459c0b 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/service/routing/RoutingService.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/service/routing/RoutingService.java
@@ -18,11 +18,11 @@
 package org.qi4j.sample.dcicargo.sample_b.context.service.routing;
 
 import java.rmi.RemoteException;
+import java.time.LocalDate;
+import java.time.ZonedDateTime;
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Date;
 import java.util.List;
-import org.joda.time.LocalDate;
 import org.qi4j.api.injection.scope.Service;
 import org.qi4j.api.injection.scope.Structure;
 import org.qi4j.api.mixin.Mixins;
@@ -78,7 +78,7 @@ public interface RoutingService
         public List<Itinerary> fetchRoutesForSpecification( RouteSpecification routeSpecification )
             throws FoundNoRoutesException
         {
-            final Date departureDate = routeSpecification.earliestDeparture().get();
+            final ZonedDateTime departureDate = routeSpecification.earliestDeparture().get();
             final Location origin = routeSpecification.origin().get();
             final Location destination = routeSpecification.destination().get();
 
@@ -111,7 +111,7 @@ public interface RoutingService
             if( itineraries.size() == 0 )
             {
                 throw new FoundNoRoutesException( destination.name().get(),
-                                                  new LocalDate( routeSpecification.arrivalDeadline().get() ) );
+                                                  routeSpecification.arrivalDeadline().get() );
             }
 
             return itineraries;

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/service/routing/exception/FoundNoRoutesException.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/service/routing/exception/FoundNoRoutesException.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/service/routing/exception/FoundNoRoutesException.java
index 1808a7d..07dba5d 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/service/routing/exception/FoundNoRoutesException.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/service/routing/exception/FoundNoRoutesException.java
@@ -17,7 +17,8 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.service.routing.exception;
 
-import org.joda.time.LocalDate;
+import java.time.LocalDate;
+import java.time.ZonedDateTime;
 
 /**
  * Custom messages when the arrival deadline is too close and we can't find a route.
@@ -25,9 +26,9 @@ import org.joda.time.LocalDate;
 public class FoundNoRoutesException extends Exception
 {
     private final String city;
-    private final LocalDate deadline;
+    private final ZonedDateTime deadline;
 
-    public FoundNoRoutesException( String city, LocalDate deadline )
+    public FoundNoRoutesException( String city, ZonedDateTime deadline )
     {
         this.city = city;
         this.deadline = deadline;
@@ -36,17 +37,17 @@ public class FoundNoRoutesException extends Exception
     @Override
     public String getMessage()
     {
-        if( deadline.isBefore( new LocalDate().plusDays( 2 ) ) )
+        if( deadline.isBefore( ZonedDateTime.now().plusDays( 2 ) ) )
         {
             return "Impossible to get the cargo to " + city + " before " + deadline
                    + "! Make a new booking with a deadline 2-3 weeks ahead in time.";
         }
-        else if( deadline.isBefore( new LocalDate().plusDays( 4 ) ) )
+        else if( deadline.isBefore( ZonedDateTime.now().plusDays( 4 ) ) )
         {
             return "Couldn't find any routes arriving in " + city + " before " + deadline
                    + ". Please try again or make a new booking with a deadline 2-3 weeks ahead in time.";
         }
-        else if( deadline.isBefore( new LocalDate().plusDays( 6 ) ) )
+        else if( deadline.isBefore( ZonedDateTime.now().plusDays( 6 ) ) )
         {
             return "Sorry, our system couldn't immediately find a route arriving in " + city + " before " + deadline
                    + ". Please try again, and we should hopefully be able to find a new route for you.";

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/factory/HandlingEventFactory.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/factory/HandlingEventFactory.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/factory/HandlingEventFactory.java
index 297ea00..3eef494 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/factory/HandlingEventFactory.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/factory/HandlingEventFactory.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.data.factory;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.entity.EntityBuilder;
 import org.qi4j.api.injection.scope.Structure;
@@ -44,8 +44,8 @@ import org.qi4j.sample.dcicargo.sample_b.data.structure.voyage.Voyage;
 @Mixins( HandlingEventFactory.Mixin.class )
 public interface HandlingEventFactory
 {
-    HandlingEvent createHandlingEvent( Date registrationTime,
-                                       Date completionTime,
+    HandlingEvent createHandlingEvent( ZonedDateTime registrationTime,
+                                       ZonedDateTime completionTime,
                                        TrackingId trackingId,
                                        HandlingEventType handlingEventType,
                                        Location location,
@@ -59,8 +59,8 @@ public interface HandlingEventFactory
         @Structure
         UnitOfWorkFactory uowf;
 
-        public HandlingEvent createHandlingEvent( Date registrationTime,
-                                                  Date completionTime,
+        public HandlingEvent createHandlingEvent( ZonedDateTime registrationTime,
+                                                  ZonedDateTime completionTime,
                                                   TrackingId trackingId,
                                                   HandlingEventType handlingEventType,
                                                   Location location,

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/factory/RouteSpecificationFactoryService.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/factory/RouteSpecificationFactoryService.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/factory/RouteSpecificationFactoryService.java
index 0fe9143..ec7bce3 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/factory/RouteSpecificationFactoryService.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/factory/RouteSpecificationFactoryService.java
@@ -17,8 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.data.factory;
 
-import java.util.Date;
-import org.joda.time.DateMidnight;
+import java.time.ZonedDateTime;
 import org.qi4j.api.injection.scope.Structure;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.service.ServiceComposite;
@@ -42,7 +41,7 @@ import org.qi4j.sample.dcicargo.sample_b.data.structure.location.Location;
 public interface RouteSpecificationFactoryService
     extends ServiceComposite
 {
-    RouteSpecification build( Location origin, Location destination, Date earliestDeparture, Date deadline )
+    RouteSpecification build( Location origin, Location destination, ZonedDateTime earliestDeparture, ZonedDateTime deadline )
         throws CannotCreateRouteSpecificationException;
 
     abstract class Mixin
@@ -51,7 +50,7 @@ public interface RouteSpecificationFactoryService
         @Structure
         ValueBuilderFactory vbf;
 
-        public RouteSpecification build( Location origin, Location destination, Date earliestDeparture, Date deadline )
+        public RouteSpecification build( Location origin, Location destination, ZonedDateTime earliestDeparture, ZonedDateTime deadline )
             throws CannotCreateRouteSpecificationException
         {
             if( origin == destination )
@@ -59,15 +58,12 @@ public interface RouteSpecificationFactoryService
                 throw new CannotCreateRouteSpecificationException( "Origin location can't be same as destination location." );
             }
 
-            Date endOfToday = new DateMidnight().plusDays( 1 ).toDate();
-            if( deadline.before( endOfToday ) )
+            if( deadline.isBefore( ZonedDateTime.now() ) )
             {
-                throw new CannotCreateRouteSpecificationException( "Arrival deadline is in the past or Today." +
-                                                                   "\nDeadline           " + deadline +
-                                                                   "\nToday (midnight)   " + endOfToday );
+                throw new CannotCreateRouteSpecificationException( "Arrival deadline is in the past or Today: " + deadline );
             }
 
-            if( deadline.before( earliestDeparture ) )
+            if( deadline.isBefore( earliestDeparture ) )
             {
                 throw new CannotCreateRouteSpecificationException( "Deadline can't be before departure:" +
                                                                    "\nDeparture   " + earliestDeparture +

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/cargo/RouteSpecification.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/cargo/RouteSpecification.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/cargo/RouteSpecification.java
index cc72b5d..b5c5951 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/cargo/RouteSpecification.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/cargo/RouteSpecification.java
@@ -17,8 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.data.structure.cargo;
 
-import java.text.SimpleDateFormat;
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.property.Property;
@@ -50,7 +49,7 @@ import org.qi4j.sample.dcicargo.sample_b.data.structure.location.Location;
  *
  * All properties are mandatory and immutable.
  */
-@Mixins( RouteSpecification.Mixin.class )
+@Mixins(RouteSpecification.Mixin.class)
 public interface RouteSpecification
     extends ValueComposite
 {
@@ -58,9 +57,9 @@ public interface RouteSpecification
 
     Association<Location> destination();
 
-    Property<Date> earliestDeparture();
+    Property<ZonedDateTime> earliestDeparture();
 
-    Property<Date> arrivalDeadline();
+    Property<ZonedDateTime> arrivalDeadline();
 
     // Side-effects free and UI agnostic convenience methods
     boolean isSatisfiedBy( Itinerary itinerary );
@@ -75,24 +74,21 @@ public interface RouteSpecification
             return itinerary != null &&
                    !itinerary.legs().get().isEmpty() &&
                    origin().get().equals( itinerary.firstLeg().loadLocation().get() ) &&
-                   earliestDeparture().get().before( itinerary.firstLeg().loadTime().get() ) &&
+                   earliestDeparture().get().isBefore( itinerary.firstLeg().loadTime().get() ) &&
                    destination().get().equals( itinerary.lastLeg().unloadLocation().get() ) &&
-                   arrivalDeadline().get().after( itinerary.eta() );
+                   arrivalDeadline().get().isAfter( itinerary.eta() );
         }
 
         public String print()
         {
-            StringBuilder sb = new StringBuilder(
-                "\nROUTE SPECIFICATION ------------" ).
-                append( "\n  Origin               " ).append( origin().get() ).
-                append( "\n  Destination          " ).append( destination().get() ).
-                append( "\n  Earliest departure   " )
-                .append( new SimpleDateFormat( "yyyy-MM-dd" ).format( earliestDeparture().get() ) )
-                .
-                    append( "\n  Arrival deadline     " )
-                .append( new SimpleDateFormat( "yyyy-MM-dd" ).format( arrivalDeadline().get() ) )
-                .
-                    append( "\n--------------------------------" );
+            StringBuilder sb = new StringBuilder( "\nROUTE SPECIFICATION ------------" )
+                .append( "\n  Origin               " ).append( origin().get() )
+                .append( "\n  Destination          " ).append( destination().get() )
+                .append( "\n  Earliest departure   " )
+                .append( earliestDeparture().get().toLocalDate() )
+                .append( "\n  Arrival deadline     " )
+                .append( arrivalDeadline().get().toLocalDate() )
+                .append( "\n--------------------------------" );
             return sb.toString();
         }
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/delivery/Delivery.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/delivery/Delivery.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/delivery/Delivery.java
index 5c13f48..48ab2a4 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/delivery/Delivery.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/delivery/Delivery.java
@@ -17,7 +17,8 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.data.structure.delivery;
 
-import java.util.Date;
+import java.time.Instant;
+import java.time.ZonedDateTime;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.common.UseDefaults;
@@ -91,7 +92,7 @@ import org.qi4j.sample.dcicargo.sample_b.data.structure.itinerary.Itinerary;
 public interface Delivery
     extends ValueComposite
 {
-    Property<Date> timestamp();
+    Property<Instant> timestamp();
 
     /* (types:)
      * RECEIVE
@@ -126,7 +127,7 @@ public interface Delivery
     Property<Boolean> isMisdirected();
 
     @Optional
-    Property<Date> eta();
+    Property<ZonedDateTime> eta();
 
     // Index of earliest uncompleted Itinerary Leg - bumped up after each unload (except at destination)
     @UseDefaults

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/delivery/NextHandlingEvent.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/delivery/NextHandlingEvent.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/delivery/NextHandlingEvent.java
index 72da122..9a90a23 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/delivery/NextHandlingEvent.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/delivery/NextHandlingEvent.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.data.structure.delivery;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.property.Property;
@@ -47,7 +47,7 @@ public interface NextHandlingEvent
     Association<Location> location();
 
     @Optional
-    Property<Date> time();
+    Property<ZonedDateTime> time();
 
     @Optional
     Association<Voyage> voyage();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/handling/HandlingEvent.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/handling/HandlingEvent.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/handling/HandlingEvent.java
index b4b33c8..0e8014d 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/handling/HandlingEvent.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/handling/HandlingEvent.java
@@ -17,8 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.data.structure.handling;
 
-import java.text.SimpleDateFormat;
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.mixin.Mixins;
@@ -52,12 +51,12 @@ import org.qi4j.sample.dcicargo.sample_b.data.structure.voyage.Voyage;
  * {@link HandlingEventType#CLAIM} or {@link HandlingEventType#CUSTOMS}.
  */
 @Immutable
-@Mixins( HandlingEvent.Mixin.class )
+@Mixins(HandlingEvent.Mixin.class)
 public interface HandlingEvent
 {
-    Property<Date> registrationTime();
+    Property<ZonedDateTime> registrationTime();
 
-    Property<Date> completionTime();
+    Property<ZonedDateTime> completionTime();
 
     Property<TrackingId> trackingId();
 
@@ -81,14 +80,12 @@ public interface HandlingEvent
                 voyage = voyage().get().voyageNumber().get().number().get();
             }
 
-            SimpleDateFormat date = new SimpleDateFormat( "yyyy-MM-dd" );
-
             StringBuilder builder = new StringBuilder( "\nHANDLING EVENT -----------------" ).
                 append( "\n  Cargo       " ).append( trackingId().get().id().get() ).
                 append( "\n  Type        " ).append( handlingEventType().get().name() ).
                 append( "\n  Location    " ).append( location().get().getString() ).
-                append( "\n  Completed   " ).append( date.format( completionTime().get() ) ).
-                append( "\n  Registered  " ).append( date.format( registrationTime().get() ) ).
+                append( "\n  Completed   " ).append( completionTime().get() ).
+                append( "\n  Registered  " ).append( registrationTime().get() ).
                 append( "\n  Voyage      " ).append( voyage ).
                 append( "\n--------------------------------\n" );
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/itinerary/Itinerary.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/itinerary/Itinerary.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/itinerary/Itinerary.java
index 41d2d4f..ccb7d5e 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/itinerary/Itinerary.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/itinerary/Itinerary.java
@@ -18,10 +18,10 @@
 package org.qi4j.sample.dcicargo.sample_b.data.structure.itinerary;
 
 import java.text.SimpleDateFormat;
-import java.util.Date;
+import java.time.LocalDate;
+import java.time.ZonedDateTime;
+import java.time.temporal.ChronoUnit;
 import java.util.List;
-import org.joda.time.Days;
-import org.joda.time.LocalDate;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.property.Property;
 import org.qi4j.api.value.ValueComposite;
@@ -49,7 +49,7 @@ public interface Itinerary
 
     Leg lastLeg();
 
-    Date eta();
+    ZonedDateTime eta();
 
     int days();
 
@@ -78,16 +78,16 @@ public interface Itinerary
             return legs().get().get( legs().get().size() - 1 );
         }
 
-        public Date eta()
+        public ZonedDateTime eta()
         {
             return lastLeg().unloadTime().get();
         }
 
         public int days()
         {
-            Date dep = firstLeg().loadTime().get();
-            Date arr = lastLeg().unloadTime().get();
-            return Days.daysBetween( new LocalDate( dep ), new LocalDate( arr ) ).getDays();
+            ZonedDateTime dep = firstLeg().loadTime().get();
+            ZonedDateTime arr = lastLeg().unloadTime().get();
+            return (int) dep.until( arr, ChronoUnit.DAYS );
         }
 
         public String print()
@@ -104,11 +104,11 @@ public interface Itinerary
         {
             sb.append( "\n  Leg " ).append( i );
             sb.append( "  Load " );
-            sb.append( new SimpleDateFormat( "yyyy-MM-dd" ).format( leg.loadTime().get() ) );
+            sb.append( leg.loadTime().get() );
             sb.append( " " ).append( leg.loadLocation().get() );
             sb.append( "   " ).append( leg.voyage().get() );
             sb.append( "   Unload " );
-            sb.append( new SimpleDateFormat( "yyyy-MM-dd" ).format( leg.unloadTime().get() ) );
+            sb.append( leg.unloadTime().get() );
             sb.append( " " ).append( leg.unloadLocation().get() );
         }
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/itinerary/Leg.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/itinerary/Leg.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/itinerary/Leg.java
index bbcc286..e4c621c 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/itinerary/Leg.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/itinerary/Leg.java
@@ -17,7 +17,8 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.data.structure.itinerary;
 
-import java.util.Date;
+import java.time.LocalDate;
+import java.time.ZonedDateTime;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.property.Property;
 import org.qi4j.api.value.ValueComposite;
@@ -36,11 +37,11 @@ public interface Leg
 {
     Association<Location> loadLocation();
 
-    Property<Date> loadTime();
+    Property<ZonedDateTime> loadTime();
 
     Association<Voyage> voyage();
 
-    Property<Date> unloadTime();
+    Property<ZonedDateTime> unloadTime();
 
     Association<Location> unloadLocation();
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/voyage/CarrierMovement.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/voyage/CarrierMovement.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/voyage/CarrierMovement.java
index 20a2442..a189098 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/voyage/CarrierMovement.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/data/structure/voyage/CarrierMovement.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.data.structure.voyage;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.property.Property;
 import org.qi4j.api.value.ValueComposite;
@@ -37,7 +37,7 @@ public interface CarrierMovement
 
     Association<Location> arrivalLocation();
 
-    Property<Date> departureTime();
+    Property<ZonedDateTime> departureTime();
 
-    Property<Date> arrivalTime();
+    Property<ZonedDateTime> arrivalTime();
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/infrastructure/wicket/form/DateTextFieldWithPicker.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/infrastructure/wicket/form/DateTextFieldWithPicker.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/infrastructure/wicket/form/DateTextFieldWithPicker.java
index 26e09aa..361ae8c 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/infrastructure/wicket/form/DateTextFieldWithPicker.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/infrastructure/wicket/form/DateTextFieldWithPicker.java
@@ -18,6 +18,9 @@
 package org.qi4j.sample.dcicargo.sample_b.infrastructure.wicket.form;
 
 import com.google.code.joliratools.StatelessAjaxEventBehavior;
+import java.time.LocalDate;
+import java.time.ZoneId;
+import java.time.format.DateTimeFormatter;
 import java.util.Date;
 import java.util.Map;
 import org.apache.wicket.Component;
@@ -33,9 +36,6 @@ import org.apache.wicket.model.Model;
 import org.apache.wicket.model.PropertyModel;
 import org.apache.wicket.request.mapper.parameter.PageParameters;
 import org.apache.wicket.validation.validator.DateValidator;
-import org.joda.time.DateTime;
-import org.joda.time.LocalDate;
-import org.joda.time.LocalTime;
 
 /**
  * DateTextFieldWithPicker
@@ -187,7 +187,7 @@ public class DateTextFieldWithPicker extends DateTextField
 
         // Input field validation - date should be _after_ minimumDate (not the same)
         LocalDate minimumDate = newEarliestDate.minusDays( 1 );
-        Date convertedMinimumDate = new DateTime( minimumDate.toDateTime( new LocalTime() ) ).toDate();
+        Date convertedMinimumDate = new Date( minimumDate.plusDays(1).atStartOfDay( ZoneId.systemDefault() ).toInstant().toEpochMilli() );
         add( DateValidator.minimum( convertedMinimumDate ) );
 
         return this;
@@ -211,17 +211,22 @@ public class DateTextFieldWithPicker extends DateTextField
     {
         if( selectedDate != null )
         {
-            return selectedDate.toString( YUI_DATE_FORMAT );
+            return formatDate( selectedDate );
         }
 
         // Select today or earliest date (if later) as default
         return earliestDate == null ?
-               new LocalDate().toString( YUI_DATE_FORMAT ) :
-               earliestDate.toString( YUI_DATE_FORMAT );
+               formatDate( LocalDate.now() ) :
+               formatDate( earliestDate );
+    }
+
+    private String formatDate( LocalDate date )
+    {
+        return date.format( DateTimeFormatter.ofPattern( YUI_DATE_FORMAT ) );
     }
 
     private String getEarliestDateStr()
     {
-        return earliestDate == null ? "" : earliestDate.toString( YUI_DATE_FORMAT );
+        return earliestDate == null ? "" : formatDate( earliestDate );
     }
 }
\ No newline at end of file


[37/50] [abbrv] zest-qi4j git commit: Replaced Joda Time with Java 8 Time API.

Posted by ni...@apache.org.
Replaced Joda Time with Java 8 Time API.


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/b71c878d
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/b71c878d
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/b71c878d

Branch: refs/heads/3.0
Commit: b71c878d306d478e279b692254dd728a431f100b
Parents: 9479a63
Author: Niclas Hedhman <ni...@hedhman.org>
Authored: Sat Oct 4 13:49:30 2014 +0800
Committer: Niclas Hedhman <ni...@hedhman.org>
Committed: Sat Oct 4 13:49:30 2014 +0800

----------------------------------------------------------------------
 core/api/build.gradle                           |   1 -
 core/api/src/docs/valuecomposite.txt            |   3 -
 .../org/qi4j/api/composite/PropertyMapper.java  |  13 -
 .../main/java/org/qi4j/api/type/ValueType.java  |   2 +-
 .../org/qi4j/api/unitofwork/UnitOfWork.java     |   3 +-
 .../qi4j/api/unitofwork/UnitOfWorkFactory.java  |   5 +-
 .../src/main/java/org/qi4j/api/util/Dates.java  | 102 ----
 .../org/qi4j/api/value/ValueDeserializer.java   |   3 -
 .../org/qi4j/api/value/ValueSerializer.java     |   3 -
 .../provider/ThisInjectionProviderFactory.java  |   1 +
 .../qi4j/runtime/structure/ModuleInstance.java  |   7 +-
 .../runtime/structure/ModuleUnitOfWork.java     |  17 +-
 .../runtime/unitofwork/BuilderEntityState.java  |   5 +-
 .../runtime/unitofwork/UnitOfWorkInstance.java  |   7 +-
 .../org/qi4j/regression/qi377/IssueTest.java    |  48 +-
 .../runtime/property/PropertyEqualityTest.java  |  74 ++-
 .../org/qi4j/runtime/query/model/Person.java    |   4 +-
 .../java/org/qi4j/spi/entity/EntityState.java   |   4 +-
 .../ConcurrentModificationCheckConcern.java     |   9 +-
 .../DefaultEntityStoreUnitOfWork.java           |   7 +-
 .../spi/entitystore/EntityStateVersions.java    |   5 +-
 .../org/qi4j/spi/entitystore/EntityStore.java   |   3 +-
 .../spi/entitystore/EntityStoreUnitOfWork.java  |   3 +-
 .../entitystore/helpers/DefaultEntityState.java |   7 +-
 .../entitystore/helpers/JSONEntityState.java    |  18 +-
 .../helpers/JSONMapEntityStoreMixin.java        |  14 +-
 .../helpers/MapEntityStoreMixin.java            |  11 +-
 .../spi/value/ValueDeserializerAdapter.java     | 126 ++++-
 .../qi4j/spi/value/ValueSerializerAdapter.java  | 201 +++++---
 .../helpers/JSONManyAssociationStateTest.java   |   7 +-
 .../test/entity/AbstractEntityStoreTest.java    |  30 +-
 .../qi4j/test/indexing/AbstractQueryTest.java   |  48 +-
 .../java/org/qi4j/test/indexing/TestData.java   |  24 +-
 .../org/qi4j/test/indexing/model/Person.java    |  12 +-
 .../test/value/AbstractJsonDateFormatTest.java  |  26 +-
 .../AbstractPlainValueSerializationTest.java    |  43 +-
 ...AbstractValueCompositeSerializationTest.java |  20 +-
 .../qi4j/entitystore/gae/GaeEntityState.java    |  12 +-
 .../entitystore/gae/GaeEntityStoreMixin.java    |   5 +-
 .../gae/GaeEntityStoreUnitOfWork.java           |   7 +-
 .../qi4j/entitystore/neo4j/NeoEntityState.java  |  19 +-
 .../entitystore/neo4j/NeoEntityStoreMixin.java  |   5 +-
 .../neo4j/NeoEntityStoreUnitOfWork.java         |   9 +-
 .../neo4j/test/SimpleNeoStoreTest.java          |   4 -
 .../prefs/PreferencesEntityStoreMixin.java      |  11 +-
 .../entitystore/sql/SQLEntityStoreMixin.java    |   9 +-
 .../sql/internal/DatabaseSQLService.java        |   5 +-
 .../DatabaseSQLServiceStatementsMixin.java      |   9 +-
 .../sql/internal/SQLEntityState.java            |   3 +-
 .../elasticsearch/ElasticSearchIndexer.java     |   3 +-
 .../index/rdf/query/RdfQueryParserFactory.java  |   6 +-
 .../rdf/query/internal/RdfQueryParserImpl.java  |  31 +-
 .../solr/internal/SolrEntityIndexerMixin.java   |   2 +-
 .../index/sql/support/common/QNameInfo.java     |  14 +-
 .../postgresql/PostgreSQLTypeHelper.java        |  45 +-
 .../support/skeletons/AbstractSQLIndexing.java  |   4 +-
 .../support/skeletons/AbstractSQLStartup.java   |  36 +-
 .../skeletons/SQLCompatEntityStateWrapper.java  |   3 +-
 libraries.gradle                                |   2 -
 .../java/org/qi4j/library/alarm/AlarmEvent.java |   4 +-
 .../org/qi4j/library/alarm/AlarmStatus.java     |   6 +-
 .../org/qi4j/library/alarm/AlarmSystem.java     |   4 +-
 .../alarm/ExtendedAlarmModelService.java        |   6 +-
 .../library/alarm/SimpleAlarmModelService.java  |   6 +-
 .../alarm/StandardAlarmModelService.java        |   6 +-
 .../library/alarm/ExtendedAlarmModelTest.java   |   4 +-
 .../library/alarm/SimpleAlarmModelTest.java     |   4 +-
 .../library/alarm/StandardAlarmModelTest.java   |   4 +-
 .../qi4j/library/appbrowser/AppBrowserTest.java |   6 +-
 .../library/circuitbreaker/CircuitBreaker.java  |  26 +-
 .../circuitbreaker/jmx/CircuitBreakerJMX.java   | 189 ++++----
 .../conversion/values/EntityToValueTest.java    |  33 +-
 .../qi4j/library/cxf/divs/DividendsTest.java    |  10 +-
 .../library/cxf/divs/ProjectedDividends.java    |   8 +-
 .../rest/server/DomainEventSourceResource.java  |   4 +-
 .../application/api/ApplicationEvent.java       |   6 +-
 .../factory/ApplicationEventFactoryService.java |   4 +-
 .../replay/ApplicationEventPlayerService.java   |  61 ++-
 .../source/helper/ApplicationEvents.java        |  10 +-
 .../domain/api/UnitOfWorkDomainEventsValue.java |   4 +-
 .../factory/UnitOfWorkNotificationConcern.java  |   3 +-
 .../domain/replay/DomainEventPlayerService.java | 163 +++++--
 .../domain/source/helper/Events.java            |  48 +-
 .../domain/source/helper/EventRouterTest.java   |   5 +-
 .../domain/source/helper/EventsTest.java        |   5 +-
 .../source/helper/UnitOfWorkRouterTest.java     |   5 +-
 .../rdf/entity/EntityTypeSerializer.java        |  18 +-
 .../rdf/entity/EntitySerializerTest.java        |   3 +-
 .../qi4j/library/rest/client/ClientCache.java   | 220 +++++----
 .../responsereader/TableResponseReader.java     | 138 +++---
 .../library/rest/common/table/TableBuilder.java | 427 +++++++++--------
 .../rest/server/api/ResourceValidity.java       |   6 +-
 .../requestreader/DefaultRequestReader.java     |  27 +-
 .../responsewriter/TableResponseWriter.java     |   8 +-
 .../qi4j/library/rest/admin/EntityResource.java |  11 +-
 .../org/qi4j/library/scheduler/Scheduler.java   |   6 +-
 .../qi4j/library/scheduler/SchedulerMixin.java  |  35 +-
 .../library/scheduler/schedule/Schedule.java    |   6 +-
 .../scheduler/schedule/ScheduleFactory.java     |  18 +-
 .../scheduler/schedule/ScheduleTime.java        |  27 +-
 .../scheduler/schedule/cron/CronSchedule.java   |  14 +-
 .../scheduler/schedule/once/OnceSchedule.java   |  10 +-
 .../library/scheduler/timeline/Timeline.java    |  15 +-
 .../timeline/TimelineForScheduleConcern.java    |   3 +-
 .../scheduler/timeline/TimelineRecord.java      |   3 +-
 .../timeline/TimelineScheduleMixin.java         |  32 +-
 .../timeline/TimelineSchedulerServiceMixin.java |  21 +-
 .../qi4j/library/scheduler/SchedulerTest.java   |  21 +-
 .../manual/recipes/createEntity/Accident.java   |   6 +-
 .../dcicargo/pathfinder_a/api/TransitEdge.java  |  14 +-
 .../internal/GraphTraversalServiceImpl.java     |  12 +-
 .../bootstrap/DCISampleApplication_a.java       |   4 -
 .../sample_a/bootstrap/sampledata/BaseData.java |  20 +-
 .../bootstrap/sampledata/BaseDataService.java   | 104 ++--
 .../bootstrap/sampledata/SampleDataService.java |  27 +-
 .../query/dto/HandlingEventDTO.java             |   4 +-
 .../web/booking/BookNewCargoPage.java           |  10 +-
 .../web/booking/CargoDetailsPage.java           |   5 +-
 .../web/booking/CargoListPage.java              |   9 +-
 .../communication/web/booking/RoutePanel.java   |   6 +-
 .../web/handling/RegisterHandlingEventPage.java |   9 +-
 .../web/tracking/HandlingHistoryPanel.java      |   4 +-
 .../web/tracking/TrackCargoPage.java            |   8 +-
 .../context/shipping/booking/BookNewCargo.java  |  25 +-
 .../shipping/booking/BuildDeliverySnapshot.java |  28 +-
 .../handling/RegisterHandlingEvent.java         |  10 +-
 .../context/support/ApplicationEvents.java      |   9 +-
 .../context/support/FoundNoRoutesException.java |  12 +-
 .../RegisterHandlingEventAttemptDTO.java        |   6 +-
 .../context/support/RoutingService.java         |   3 +-
 .../data/shipping/cargo/RouteSpecification.java |   6 +-
 .../data/shipping/delivery/Delivery.java        |   7 +-
 .../delivery/ExpectedHandlingEvent.java         |   4 +-
 .../data/shipping/handling/HandlingEvent.java   |   6 +-
 .../data/shipping/handling/HandlingEvents.java  |  12 +-
 .../data/shipping/itinerary/Itinerary.java      |  22 +-
 .../sample_a/data/shipping/itinerary/Leg.java   |   6 +-
 .../data/shipping/voyage/CarrierMovement.java   |   6 +-
 .../wicket/form/DateTextFieldWithPicker.java    |  32 +-
 .../shipping/booking/BookNewCargoTest.java      |  32 +-
 .../booking/BuildDeliverySnapshotTest.java      | 474 ++++++++++---------
 .../handling/RegisterHandlingEventTest.java     | 139 +++---
 .../pathfinder_b/api/GraphTraversalService.java |   5 +-
 .../dcicargo/pathfinder_b/api/TransitEdge.java  |  15 +-
 .../pathfinder_b/internal/GraphDAO.java         |  15 +-
 .../internal/GraphTraversalServiceImpl.java     |  12 +-
 .../bootstrap/DCISampleApplication_b.java       |   4 -
 .../sample_b/bootstrap/sampledata/BaseData.java |  27 +-
 .../bootstrap/sampledata/SampleDataService.java |  23 +-
 .../query/dto/HandlingEventDTO.java             |   4 +-
 .../web/booking/BookNewCargoPage.java           |   8 +-
 .../web/booking/CargoDetailsPage.java           |   6 +-
 .../web/booking/CargoListPage.java              |   2 +-
 .../communication/web/booking/RoutePanel.java   |   6 +-
 .../IncidentLoggingApplicationMockupPage.java   |  12 +-
 .../web/tracking/HandlingHistoryPanel.java      |   5 +-
 .../web/tracking/TrackCargoPage.java            |   8 +-
 .../interaction/booking/BookNewCargo.java       |  14 +-
 .../booking/routing/AssignCargoToRoute.java     |  28 +-
 .../DeriveUpdatedRouteSpecification.java        |   6 +-
 .../inspection/event/InspectArrivedCargo.java   |   5 +-
 .../inspection/event/InspectCargoInCustoms.java |   5 +-
 .../inspection/event/InspectClaimedCargo.java   |   6 +-
 .../inspection/event/InspectLoadedCargo.java    |  19 +-
 .../inspection/event/InspectReceivedCargo.java  |   6 +-
 .../inspection/event/InspectUnhandledCargo.java |   6 +-
 .../inspection/event/InspectUnloadedCargo.java  |   5 +-
 .../parsing/ParseHandlingEventData.java         |  26 +-
 .../parsing/dto/ParsedHandlingEventData.java    |   6 +-
 .../CannotRegisterHandlingEventException.java   |   9 +-
 .../exception/ChronologicalException.java       |   6 +-
 .../context/service/routing/RoutingService.java |   8 +-
 .../exception/FoundNoRoutesException.java       |  13 +-
 .../data/factory/HandlingEventFactory.java      |  10 +-
 .../RouteSpecificationFactoryService.java       |  16 +-
 .../structure/cargo/RouteSpecification.java     |  32 +-
 .../data/structure/delivery/Delivery.java       |   7 +-
 .../structure/delivery/NextHandlingEvent.java   |   4 +-
 .../data/structure/handling/HandlingEvent.java  |  15 +-
 .../data/structure/itinerary/Itinerary.java     |  20 +-
 .../sample_b/data/structure/itinerary/Leg.java  |   7 +-
 .../data/structure/voyage/CarrierMovement.java  |   6 +-
 .../wicket/form/DateTextFieldWithPicker.java    |  21 +-
 .../bootstrap/test/TestApplication.java         | 202 ++++----
 .../context/test/booking/BookNewCargoTest.java  |   4 +-
 .../booking/routing/AssignCargoToRouteTest.java |  12 +-
 .../routing/RegisterNewDestinationTest.java     |  10 +-
 .../DeriveUpdatedRouteSpecTest.java             |   4 +-
 .../event/InspectArrivedCargoTest.java          |  12 +-
 .../event/InspectCargoInCustomsTest.java        |  12 +-
 .../event/InspectClaimedCargoTest.java          |  14 +-
 .../event/InspectLoadedCargoTest.java           |  38 +-
 .../event/InspectReceivedCargoTest.java         |  20 +-
 .../event/InspectUnhandledCargoTest.java        |  12 +-
 .../event/InspectUnloadedCargoTest.java         |  26 +-
 .../parsing/ParseHandlingEventDataTest.java     |  12 +-
 .../registration/RegisterHandlingEventTest.java |   6 +-
 .../samples/forum/context/view/ViewPost.java    |   4 +-
 .../qi4j/samples/forum/data/entity/Post.java    |   4 +-
 .../forum/domainevent/DomainEventValue.java     |   3 +-
 .../org/qi4j/sample/rental/domain/Booking.java  |   6 +-
 .../java/org/qi4j/sample/rental/domain/Car.java |   6 +-
 .../org/qi4j/sample/rental/domain/Period.java   |   6 +-
 .../qi4j/sample/rental/domain/RentalShop.java   |  18 +-
 .../sample/rental/domain/dev/InitialData.java   |  59 +--
 .../example/actions/HelloWorldAction.java       |   9 +-
 .../struts2/example/actions/IndexAction.java    |  11 +-
 .../example/converters/DateConverter.java       |  17 +-
 .../demo/thirtyminutes/ThirtyMinutesDocs.java   |  15 +-
 209 files changed, 2648 insertions(+), 2296 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/api/build.gradle
----------------------------------------------------------------------
diff --git a/core/api/build.gradle b/core/api/build.gradle
index ccaa0f2..0ad2cd6 100644
--- a/core/api/build.gradle
+++ b/core/api/build.gradle
@@ -3,7 +3,6 @@ jar { manifest { name = "Qi4j Core API"}}
 dependencies {
 
   compile project( ':org.qi4j.core:org.qi4j.core.io' )
-  compile libraries.jodatime
 
   testCompile project( ':org.qi4j.core:org.qi4j.core.testsupport' )
   testCompile project( ':org.qi4j.libraries:org.qi4j.library.constraints' )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/api/src/docs/valuecomposite.txt
----------------------------------------------------------------------
diff --git a/core/api/src/docs/valuecomposite.txt b/core/api/src/docs/valuecomposite.txt
index cc7166e..4a1e5b8 100644
--- a/core/api/src/docs/valuecomposite.txt
+++ b/core/api/src/docs/valuecomposite.txt
@@ -63,9 +63,6 @@ Plain Values can be one of :
     * BigInteger,
     * BigDecimal,
     * Date,
-    * DateTime (JodaTime),
-    * LocalDateTime (JodaTime),
-    * LocalDate (JodaTime).
 
 TIP: Serialization behaviour can be tuned with options.
 Every +ValueSerializer+ methods can take a +ValueSerializer.Options+ object that contains flags to change how some

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/api/src/main/java/org/qi4j/api/composite/PropertyMapper.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/composite/PropertyMapper.java b/core/api/src/main/java/org/qi4j/api/composite/PropertyMapper.java
index a47db83..87352a1 100644
--- a/core/api/src/main/java/org/qi4j/api/composite/PropertyMapper.java
+++ b/core/api/src/main/java/org/qi4j/api/composite/PropertyMapper.java
@@ -11,7 +11,6 @@ import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Date;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
@@ -22,7 +21,6 @@ import org.qi4j.api.Qi4j;
 import org.qi4j.api.property.GenericPropertyInfo;
 import org.qi4j.api.property.Property;
 import org.qi4j.api.util.Classes;
-import org.qi4j.api.util.Dates;
 import org.qi4j.api.value.ValueComposite;
 
 /**
@@ -44,7 +42,6 @@ public final class PropertyMapper
         STRATEGY.put( Character.class, new CharMapper() );
         STRATEGY.put( Float.class, new FloatMapper() );
         STRATEGY.put( Double.class, new DoubleMapper() );
-        STRATEGY.put( Date.class, new DateMapper() );
         STRATEGY.put( Boolean.class, new BooleanMapper() );
         STRATEGY.put( BigDecimal.class, new BigDecimalMapper() );
         STRATEGY.put( BigInteger.class, new BigIntegerMapper() );
@@ -427,16 +424,6 @@ public final class PropertyMapper
         }
     }
 
-    private static class DateMapper
-        implements MappingStrategy
-    {
-        @Override
-        public Object map( Composite composite, Type type, String value )
-        {
-            return Dates.fromString( value.trim() );
-        }
-    }
-
     private static class ValueCompositeMapper
         implements MappingStrategy
     {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/api/src/main/java/org/qi4j/api/type/ValueType.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/type/ValueType.java b/core/api/src/main/java/org/qi4j/api/type/ValueType.java
index 5cb4db4..2fe6697 100644
--- a/core/api/src/main/java/org/qi4j/api/type/ValueType.java
+++ b/core/api/src/main/java/org/qi4j/api/type/ValueType.java
@@ -40,7 +40,7 @@ public class ValueType
      *     counterparts are considered as Primitive Value Types.
      * </p>
      * <p>
-     *     Date, BigInteger, BigDecimal and JodaTime types are not considered as Primitive Value Types.
+     *     Date, BigInteger, BigDecimal types are not considered as Primitive Value Types.
      * </p>
      *
      * @return true if object is a primitive value or an array of primitive values

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/api/src/main/java/org/qi4j/api/unitofwork/UnitOfWork.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/unitofwork/UnitOfWork.java b/core/api/src/main/java/org/qi4j/api/unitofwork/UnitOfWork.java
index 8af1db2..0a9f095 100644
--- a/core/api/src/main/java/org/qi4j/api/unitofwork/UnitOfWork.java
+++ b/core/api/src/main/java/org/qi4j/api/unitofwork/UnitOfWork.java
@@ -15,6 +15,7 @@
  */
 package org.qi4j.api.unitofwork;
 
+import java.time.Instant;
 import org.qi4j.api.entity.EntityBuilder;
 import org.qi4j.api.entity.LifecycleException;
 import org.qi4j.api.query.Query;
@@ -85,7 +86,7 @@ public interface UnitOfWork extends MetaInfoHolder, AutoCloseable
      */
     UnitOfWorkFactory unitOfWorkFactory();
 
-    long currentTime();
+    Instant currentTime();
 
     /**
      * Get the Usecase for this UnitOfWork

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/api/src/main/java/org/qi4j/api/unitofwork/UnitOfWorkFactory.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/unitofwork/UnitOfWorkFactory.java b/core/api/src/main/java/org/qi4j/api/unitofwork/UnitOfWorkFactory.java
index a8755d4..4e9f166 100644
--- a/core/api/src/main/java/org/qi4j/api/unitofwork/UnitOfWorkFactory.java
+++ b/core/api/src/main/java/org/qi4j/api/unitofwork/UnitOfWorkFactory.java
@@ -14,6 +14,7 @@
  */
 package org.qi4j.api.unitofwork;
 
+import java.time.Instant;
 import org.qi4j.api.entity.EntityComposite;
 import org.qi4j.api.usecase.Usecase;
 
@@ -41,7 +42,7 @@ public interface UnitOfWorkFactory
      * </p>
      * @return a new UnitOfWork
      */
-    UnitOfWork newUnitOfWork( long currentTime );
+    UnitOfWork newUnitOfWork( Instant currentTime );
 
     /**
      * Create a new UnitOfWork for the given Usecase and associate it with the current thread.
@@ -61,7 +62,7 @@ public interface UnitOfWorkFactory
      *
      * @return a new UnitOfWork
      */
-    UnitOfWork newUnitOfWork( Usecase usecase, long currentTime );
+    UnitOfWork newUnitOfWork( Usecase usecase, Instant currentTime );
 
     /**
      * @return true if there is an active UnitOfWork associated with the executing thread

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/api/src/main/java/org/qi4j/api/util/Dates.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/util/Dates.java b/core/api/src/main/java/org/qi4j/api/util/Dates.java
deleted file mode 100644
index 3324df2..0000000
--- a/core/api/src/main/java/org/qi4j/api/util/Dates.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright 2009 Niclas Hedhman.
- *
- * Licensed  under the  Apache License,  Version 2.0  (the "License");
- * you may not use  this file  except in  compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed  under the  License is distributed on an "AS IS" BASIS,
- * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
- * implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.qi4j.api.util;
-
-import java.text.DateFormat;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.TimeZone;
-
-/**
- * Useful methods for handling Dates.
- */
-public final class Dates
-{
-    // Formatters are not thread-safe. Create one per thread
-    private static final ThreadLocal<DateFormat> ISO8601 = new ThreadLocal<DateFormat>()
-    {
-        @Override
-        protected DateFormat initialValue()
-        {
-            return new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss.SSSZ" );
-        }
-    };
-
-    private static final ThreadLocal<DateFormat> ISO8601_UTC = new ThreadLocal<DateFormat>()
-    {
-        @Override
-        protected DateFormat initialValue()
-        {
-            SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" );
-            dateFormat.setTimeZone( TimeZone.getTimeZone( "UTC" ) );
-            return dateFormat;
-        }
-    };
-
-    /**
-     * @param stringDate a string representing a date as either ISO8601, @millis@ or /Date() formats
-     * @return a Date
-     */
-    public static Date fromString( String stringDate )
-    {
-        try
-        {
-            Date date = ISO8601_UTC.get().parse( stringDate );
-            return date;
-        }
-        catch( ParseException e )
-        {
-            try
-            {
-                Date date = ISO8601.get().parse( stringDate );
-                return date;
-            }
-            catch( ParseException e1 )
-            {
-                // @millis@ format
-                if( stringDate.startsWith( "@" ) && stringDate.endsWith( "@" ) )
-                {
-                    long time = Long.parseLong( stringDate.substring( 1, stringDate.length() - 1 ) );
-                    Date date = new Date( time );
-                    return date;
-                }
-                else if( stringDate.startsWith( "/Date(" ) && stringDate.endsWith( ")/" ) ) // Microsoft format
-                {
-                    long time = Long.parseLong( stringDate.substring( 6, stringDate.length() - 2 ) );
-                    Date date = new Date( time );
-                    return date;
-                }
-                throw new IllegalStateException( "Illegal date:" + stringDate );
-            }
-        }
-    }
-
-    /**
-     * @param date a Date
-     * @return String representation in ISO8601 UTC
-     */
-    public static String toUtcString( Date date )
-    {
-        return ISO8601_UTC.get().format( date );
-    }
-
-    private Dates()
-    {
-    }
-}

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/api/src/main/java/org/qi4j/api/value/ValueDeserializer.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/value/ValueDeserializer.java b/core/api/src/main/java/org/qi4j/api/value/ValueDeserializer.java
index 48e1203..a6ca6a6 100644
--- a/core/api/src/main/java/org/qi4j/api/value/ValueDeserializer.java
+++ b/core/api/src/main/java/org/qi4j/api/value/ValueDeserializer.java
@@ -53,9 +53,6 @@ import org.qi4j.api.type.ValueType;
  *     <li>BigInteger,</li>
  *     <li>BigDecimal,</li>
  *     <li>Date,</li>
- *     <li>DateTime (JodaTime),</li>
- *     <li>LocalDateTime (JodaTime),</li>
- *     <li>LocalDate (JodaTime).</li>
  * </ul>
  * <p>
  *     Values of unknown types and all arrays are considered as {@link java.io.Serializable} and by so are deserialized

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/api/src/main/java/org/qi4j/api/value/ValueSerializer.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/value/ValueSerializer.java b/core/api/src/main/java/org/qi4j/api/value/ValueSerializer.java
index 06e8599..d9c8f74 100644
--- a/core/api/src/main/java/org/qi4j/api/value/ValueSerializer.java
+++ b/core/api/src/main/java/org/qi4j/api/value/ValueSerializer.java
@@ -54,9 +54,6 @@ import org.qi4j.api.composite.AmbiguousTypeException;
  *     <li>BigInteger,</li>
  *     <li>BigDecimal,</li>
  *     <li>Date,</li>
- *     <li>DateTime (JodaTime),</li>
- *     <li>LocalDateTime (JodaTime),</li>
- *     <li>LocalDate (JodaTime).</li>
  * </ul>
  * <p>
  *     Values of unknown types and all arrays are considered as {@link java.io.Serializable} and by so are serialized to

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/runtime/src/main/java/org/qi4j/runtime/injection/provider/ThisInjectionProviderFactory.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/injection/provider/ThisInjectionProviderFactory.java b/core/runtime/src/main/java/org/qi4j/runtime/injection/provider/ThisInjectionProviderFactory.java
index c927b65..267a7d6 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/injection/provider/ThisInjectionProviderFactory.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/injection/provider/ThisInjectionProviderFactory.java
@@ -91,6 +91,7 @@ public final class ThisInjectionProviderFactory
                 }
 
                 proxyConstructor = proxyClass.getConstructor( InvocationHandler.class );
+                proxyConstructor.setAccessible( true );
             }
             catch( Exception e )
             {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/runtime/src/main/java/org/qi4j/runtime/structure/ModuleInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/structure/ModuleInstance.java b/core/runtime/src/main/java/org/qi4j/runtime/structure/ModuleInstance.java
index cfbbb41..efad2f5 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/structure/ModuleInstance.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/structure/ModuleInstance.java
@@ -17,6 +17,7 @@ package org.qi4j.runtime.structure;
 
 import java.lang.reflect.AccessibleObject;
 import java.lang.reflect.Type;
+import java.time.Instant;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -509,7 +510,7 @@ public class ModuleInstance
     }
 
     @Override
-    public UnitOfWork newUnitOfWork( long currentTime )
+    public UnitOfWork newUnitOfWork( Instant currentTime )
     {
         return newUnitOfWork( Usecase.DEFAULT, currentTime );
     }
@@ -517,11 +518,11 @@ public class ModuleInstance
     @Override
     public UnitOfWork newUnitOfWork( Usecase usecase )
     {
-        return newUnitOfWork( usecase == null ? Usecase.DEFAULT : usecase, System.currentTimeMillis() );
+        return newUnitOfWork( usecase == null ? Usecase.DEFAULT : usecase, Instant.now() );
     }
 
     @Override
-    public UnitOfWork newUnitOfWork( Usecase usecase, long currentTime )
+    public UnitOfWork newUnitOfWork( Usecase usecase, Instant currentTime )
     {
         UnitOfWorkInstance unitOfWorkInstance = new UnitOfWorkInstance( usecase, currentTime, metricsProvider() );
         return new ModuleUnitOfWork( ModuleInstance.this, unitOfWorkInstance );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/runtime/src/main/java/org/qi4j/runtime/structure/ModuleUnitOfWork.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/structure/ModuleUnitOfWork.java b/core/runtime/src/main/java/org/qi4j/runtime/structure/ModuleUnitOfWork.java
index 2a333c7..b4486de 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/structure/ModuleUnitOfWork.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/structure/ModuleUnitOfWork.java
@@ -15,6 +15,7 @@
  */
 package org.qi4j.runtime.structure;
 
+import java.time.Instant;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.Map;
@@ -59,20 +60,6 @@ import static org.qi4j.functional.Iterables.first;
 public class ModuleUnitOfWork
     implements UnitOfWork
 {
-//    private static final QualifiedName IDENTITY_STATE_NAME;
-//
-//    static
-//    {
-//        try
-//        {
-//            IDENTITY_STATE_NAME = QualifiedName.fromAccessor( Identity.class.getMethod( "identity" ) );
-//        }
-//        catch( NoSuchMethodException e )
-//        {
-//            throw new InternalError( "Qi4j Core Runtime codebase is corrupted. Contact Qi4j team: ModuleUnitOfWork" );
-//        }
-//    }
-//
     private final UnitOfWorkInstance uow;
     private final ModuleInstance moduleInstance;
 
@@ -99,7 +86,7 @@ public class ModuleUnitOfWork
     }
 
     @Override
-    public long currentTime()
+    public Instant currentTime()
     {
         return uow.currentTime();
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/runtime/src/main/java/org/qi4j/runtime/unitofwork/BuilderEntityState.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/unitofwork/BuilderEntityState.java b/core/runtime/src/main/java/org/qi4j/runtime/unitofwork/BuilderEntityState.java
index fc2302d..7ab1be4 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/unitofwork/BuilderEntityState.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/unitofwork/BuilderEntityState.java
@@ -19,6 +19,7 @@
  */
 package org.qi4j.runtime.unitofwork;
 
+import java.time.Instant;
 import java.util.HashMap;
 import java.util.Map;
 import org.qi4j.api.common.QualifiedName;
@@ -62,9 +63,9 @@ public final class BuilderEntityState
     }
 
     @Override
-    public long lastModified()
+    public Instant lastModified()
     {
-        return 0;
+        return Instant.MIN;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/runtime/src/main/java/org/qi4j/runtime/unitofwork/UnitOfWorkInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/unitofwork/UnitOfWorkInstance.java b/core/runtime/src/main/java/org/qi4j/runtime/unitofwork/UnitOfWorkInstance.java
index 4919860..0311c46 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/unitofwork/UnitOfWorkInstance.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/unitofwork/UnitOfWorkInstance.java
@@ -17,6 +17,7 @@
  */
 package org.qi4j.runtime.unitofwork;
 
+import java.time.Instant;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
@@ -74,7 +75,7 @@ public final class UnitOfWorkInstance
         return current.get();
     }
 
-    private long currentTime;
+    private Instant currentTime;
     private MetricsProvider metrics;
     final HashMap<EntityReference, EntityInstance> instanceCache;
     final HashMap<EntityStore, EntityStoreUnitOfWork> storeUnitOfWork;
@@ -92,7 +93,7 @@ public final class UnitOfWorkInstance
 
     private List<UnitOfWorkCallback> callbacks;
 
-    public UnitOfWorkInstance( Usecase usecase, long currentTime, MetricsProvider metrics )
+    public UnitOfWorkInstance( Usecase usecase, Instant currentTime, MetricsProvider metrics )
     {
         this.currentTime = currentTime;
         this.open = true;
@@ -104,7 +105,7 @@ public final class UnitOfWorkInstance
         startCapture( metrics );
     }
 
-    public long currentTime()
+    public Instant currentTime()
     {
         return currentTime;
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/runtime/src/test/java/org/qi4j/regression/qi377/IssueTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/regression/qi377/IssueTest.java b/core/runtime/src/test/java/org/qi4j/regression/qi377/IssueTest.java
index e0a0cba..1bbbf99 100644
--- a/core/runtime/src/test/java/org/qi4j/regression/qi377/IssueTest.java
+++ b/core/runtime/src/test/java/org/qi4j/regression/qi377/IssueTest.java
@@ -19,6 +19,9 @@ package org.qi4j.regression.qi377;
 
 import org.junit.Test;
 import org.qi4j.api.common.UseDefaults;
+import org.qi4j.api.composite.TransientBuilder;
+import org.qi4j.api.injection.scope.This;
+import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.property.Property;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ModuleAssembly;
@@ -35,7 +38,7 @@ public class IssueTest
     public void assemble( ModuleAssembly module )
         throws AssemblyException
     {
-        module.transients( TeamMember.class );
+        module.transients( TeamMember.class, Company.class );
     }
 
     @Test
@@ -53,6 +56,20 @@ public class IssueTest
         assertThat( p.name().get(), equalTo( "Paul" ) );
     }
 
+    @Test
+    public void propertyPrivateMixinIsolationShouldWork()
+    {
+        TransientBuilder<Company> builder = module.newTransientBuilder( Company.class );
+        Person ceo = builder.prototypeFor( Person.class );
+        ceo.name().set( "Niclas" );
+        Employee secretary = builder.prototypeFor( Employee.class );
+        secretary.name().set( "Babe" );
+        Company company = builder.newInstance();
+
+        assertThat( company.secretaryName(), equalTo( "Babe" ) );
+        assertThat( company.ceoName(), equalTo( "Niclas" ) );
+    }
+
     public interface Person
     {
         @UseDefaults
@@ -70,4 +87,33 @@ public class IssueTest
     {
     }
 
+    @Mixins( Company.Impl.class )
+    public interface Company
+    {
+        String ceoName();
+
+        String secretaryName();
+
+        public abstract class Impl
+            implements Company
+        {
+            @This
+            Person ceo;
+
+            @This
+            Employee sectretary;
+
+            @Override
+            public String ceoName()
+            {
+                return ceo.name().get();
+            }
+
+            @Override
+            public String secretaryName()
+            {
+                return sectretary.name().get();
+            }
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/runtime/src/test/java/org/qi4j/runtime/property/PropertyEqualityTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/runtime/property/PropertyEqualityTest.java b/core/runtime/src/test/java/org/qi4j/runtime/property/PropertyEqualityTest.java
index 22de796..61b7763 100644
--- a/core/runtime/src/test/java/org/qi4j/runtime/property/PropertyEqualityTest.java
+++ b/core/runtime/src/test/java/org/qi4j/runtime/property/PropertyEqualityTest.java
@@ -18,10 +18,20 @@ package org.qi4j.runtime.property;
 
 import java.math.BigDecimal;
 import java.math.BigInteger;
-import java.util.Date;
-import org.joda.time.DateTime;
-import org.joda.time.LocalDate;
-import org.joda.time.LocalDateTime;
+import java.time.Duration;
+import java.time.Instant;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.MonthDay;
+import java.time.OffsetDateTime;
+import java.time.OffsetTime;
+import java.time.Period;
+import java.time.Year;
+import java.time.YearMonth;
+import java.time.ZoneId;
+import java.time.ZoneOffset;
+import java.time.ZonedDateTime;
 import org.junit.Test;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.property.Property;
@@ -36,7 +46,6 @@ import org.qi4j.test.AbstractQi4jTest;
 import static org.hamcrest.CoreMatchers.allOf;
 import static org.hamcrest.CoreMatchers.equalTo;
 import static org.hamcrest.CoreMatchers.not;
-import static org.joda.time.DateTimeZone.UTC;
 import static org.junit.Assert.assertThat;
 
 /**
@@ -97,13 +106,24 @@ public class PropertyEqualityTest
 
         Property<BigDecimal> bigDecimalProperty();
 
-        Property<Date> dateProperty();
+        Property<OffsetDateTime> offsetDateTimeProperty();
+        Property<OffsetTime> offsetTimeProperty();
 
-        Property<DateTime> dateTimeProperty();
+        Property<ZonedDateTime> zonedDateTimeProperty();
 
         Property<LocalDate> localDateProperty();
-
         Property<LocalDateTime> localDateTimeProperty();
+        Property<LocalTime> localTimeProperty();
+
+        Property<Instant> timeInstantProperty();
+        Property<Period> timePeriodProperty();
+        Property<Duration> timeDurationProperty();
+
+        Property<MonthDay> monthDayProperty();
+        Property<YearMonth> yearMonthProperty();
+        Property<Year> yearProperty();
+        Property<ZoneId> zoneIdProperty();
+        Property<ZoneOffset> zoneOffsetProperty();
     }
 
     public interface AnotherSome
@@ -330,10 +350,7 @@ public class PropertyEqualityTest
             builder.prototype().enumProperty().set( AnEnum.BAZAR );
             builder.prototype().bigIntegerProperty().set( new BigInteger( "42" ) );
             builder.prototype().bigDecimalProperty().set( new BigDecimal( "42.23" ) );
-            builder.prototype().dateProperty().set( new DateTime( "2020-03-04T13:24:35", UTC ).toDate() );
-            builder.prototype().dateTimeProperty().set( new DateTime( "2020-03-04T13:24:35", UTC ) );
-            builder.prototype().localDateProperty().set( new LocalDate( "2020-03-04" ) );
-            builder.prototype().localDateTimeProperty().set( new LocalDateTime( "2020-03-04T13:23:00", UTC ) );
+            establihDateTimes( builder );
             some = builder.newInstance();
         }
         return some;
@@ -356,10 +373,7 @@ public class PropertyEqualityTest
             builder.prototype().enumProperty().set( AnEnum.CATHEDRAL );
             builder.prototype().bigIntegerProperty().set( new BigInteger( "23" ) );
             builder.prototype().bigDecimalProperty().set( new BigDecimal( "23.42" ) );
-            builder.prototype().dateProperty().set( new DateTime( "2030-02-08T09:09:09", UTC ).toDate() );
-            builder.prototype().dateTimeProperty().set( new DateTime( "2030-02-08T09:09:09", UTC ) );
-            builder.prototype().localDateProperty().set( new LocalDate( "2030-02-08" ) );
-            builder.prototype().localDateTimeProperty().set( new LocalDateTime( "2030-02-08T09:09:09", UTC ) );
+            establihDateTimes( builder );
             some = builder.newInstance();
         }
         return some;
@@ -382,10 +396,7 @@ public class PropertyEqualityTest
             builder.prototype().enumProperty().set( AnEnum.BAZAR );
             builder.prototype().bigIntegerProperty().set( new BigInteger( "42" ) );
             builder.prototype().bigDecimalProperty().set( new BigDecimal( "42.23" ) );
-            builder.prototype().dateProperty().set( new DateTime( "2020-03-04T13:24:35", UTC ).toDate() );
-            builder.prototype().dateTimeProperty().set( new DateTime( "2020-03-04T13:24:35", UTC ) );
-            builder.prototype().localDateProperty().set( new LocalDate( "2020-03-04" ) );
-            builder.prototype().localDateTimeProperty().set( new LocalDateTime( "2020-03-04T13:23:00", UTC ) );
+            establihDateTimes( builder );
             anotherSome = builder.newInstance();
         }
         return anotherSome;
@@ -408,10 +419,7 @@ public class PropertyEqualityTest
             builder.prototype().enumProperty().set( AnEnum.CATHEDRAL );
             builder.prototype().bigIntegerProperty().set( new BigInteger( "23" ) );
             builder.prototype().bigDecimalProperty().set( new BigDecimal( "23.42" ) );
-            builder.prototype().dateProperty().set( new DateTime( "2030-02-08T09:09:09", UTC ).toDate() );
-            builder.prototype().dateTimeProperty().set( new DateTime( "2030-02-08T09:09:09", UTC ) );
-            builder.prototype().localDateProperty().set( new LocalDate( "2030-02-08" ) );
-            builder.prototype().localDateTimeProperty().set( new LocalDateTime( "2030-02-08T09:09:09", UTC ) );
+            establihDateTimes( builder );
             anotherSome = builder.newInstance();
         }
         return anotherSome;
@@ -427,4 +435,22 @@ public class PropertyEqualityTest
         }
         return other;
     }
+
+    private static void establihDateTimes( ValueBuilder<? extends Some> builder )
+    {
+        builder.prototype().offsetDateTimeProperty().set( OffsetDateTime.parse( "2020-03-04T13:24:35+01:00" ) );
+        builder.prototype().offsetTimeProperty().set( OffsetTime.parse( "13:24:35+01:00" ) );
+        builder.prototype().zonedDateTimeProperty().set( ZonedDateTime.parse( "2020-03-04T13:24:35Z" ) );
+        builder.prototype().localDateProperty().set( LocalDate.parse( "2020-03-04" ) );
+        builder.prototype().localDateTimeProperty().set( LocalDateTime.parse( "2020-03-04T13:23:00" ) );
+        builder.prototype().localTimeProperty().set( LocalTime.parse( "13:23:00" ) );
+        builder.prototype().yearProperty().set( Year.parse( "2020" ) );
+        builder.prototype().yearMonthProperty().set( YearMonth.parse( "2020-03" ) );
+        builder.prototype().monthDayProperty().set( MonthDay.parse( "--03-04" ) );
+        builder.prototype().zoneIdProperty().set( ZoneId.of( "Asia/Kuala_Lumpur" ) );
+        builder.prototype().zoneOffsetProperty().set( ZoneOffset.of( "+02:00" ) );
+        builder.prototype().timePeriodProperty().set( Period.parse( "P3y4w" ) );
+        builder.prototype().timeInstantProperty().set( Instant.parse( "2020-03-04T13:24:35Z" ) );
+        builder.prototype().timeDurationProperty().set( Duration.parse( "P3DT4H" ) );
+    }
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/runtime/src/test/java/org/qi4j/runtime/query/model/Person.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/runtime/query/model/Person.java b/core/runtime/src/test/java/org/qi4j/runtime/query/model/Person.java
index d8dab13..418a7ce 100644
--- a/core/runtime/src/test/java/org/qi4j/runtime/query/model/Person.java
+++ b/core/runtime/src/test/java/org/qi4j/runtime/query/model/Person.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.runtime.query.model;
 
-import java.util.Date;
+import java.time.LocalDate;
 import java.util.List;
 import java.util.Map;
 import org.qi4j.api.association.Association;
@@ -48,7 +48,7 @@ public interface Person
     Property<String> email();
 
     @Optional
-    Property<Map<Date, String>> datesToRemember();
+    Property<Map<LocalDate, String>> datesToRemember();
 
     @Optional
     Property<List<String>> tags();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/spi/src/main/java/org/qi4j/spi/entity/EntityState.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/qi4j/spi/entity/EntityState.java b/core/spi/src/main/java/org/qi4j/spi/entity/EntityState.java
index 2e149ca..052359b 100644
--- a/core/spi/src/main/java/org/qi4j/spi/entity/EntityState.java
+++ b/core/spi/src/main/java/org/qi4j/spi/entity/EntityState.java
@@ -19,6 +19,8 @@
  */
 package org.qi4j.spi.entity;
 
+import java.time.Instant;
+import java.time.ZonedDateTime;
 import org.qi4j.api.common.QualifiedName;
 import org.qi4j.api.entity.EntityDescriptor;
 import org.qi4j.api.entity.EntityReference;
@@ -53,7 +55,7 @@ public interface EntityState
      * </p>
      * @return last modified timestamp of the entity, as defined by System.currentTimeMillis()
      */
-    long lastModified();
+    Instant lastModified();
 
     /**
      * Remove the entity represented by this EntityState when the unit of work is completed.

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/spi/src/main/java/org/qi4j/spi/entitystore/ConcurrentModificationCheckConcern.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/qi4j/spi/entitystore/ConcurrentModificationCheckConcern.java b/core/spi/src/main/java/org/qi4j/spi/entitystore/ConcurrentModificationCheckConcern.java
index cfeead6..35a66dd 100644
--- a/core/spi/src/main/java/org/qi4j/spi/entitystore/ConcurrentModificationCheckConcern.java
+++ b/core/spi/src/main/java/org/qi4j/spi/entitystore/ConcurrentModificationCheckConcern.java
@@ -14,6 +14,7 @@
 
 package org.qi4j.spi.entitystore;
 
+import java.time.Instant;
 import org.qi4j.api.Qi4j;
 import org.qi4j.api.concern.ConcernOf;
 import org.qi4j.api.entity.EntityDescriptor;
@@ -48,7 +49,7 @@ public abstract class ConcurrentModificationCheckConcern
     private Qi4j api;
 
     @Override
-    public EntityStoreUnitOfWork newUnitOfWork( Usecase usecase, Module module, long currentTime )
+    public EntityStoreUnitOfWork newUnitOfWork( Usecase usecase, Module module, Instant currentTime )
     {
         final EntityStoreUnitOfWork uow = next.newUnitOfWork( usecase, module, currentTime );
         return new ConcurrentCheckingEntityStoreUnitOfWork( uow, api.dereference( versions ), module, currentTime );
@@ -60,7 +61,7 @@ public abstract class ConcurrentModificationCheckConcern
         private final EntityStoreUnitOfWork uow;
         private EntityStateVersions versions;
         private Module module;
-        private long currentTime;
+        private Instant currentTime;
 
         private List<EntityState> loaded = new ArrayList<EntityState>();
 
@@ -69,7 +70,7 @@ public abstract class ConcurrentModificationCheckConcern
         public ConcurrentCheckingEntityStoreUnitOfWork( EntityStoreUnitOfWork uow,
                                                         EntityStateVersions versions,
                                                         Module module,
-                                                        long currentTime
+                                                        Instant currentTime
         )
         {
             this.uow = uow;
@@ -85,7 +86,7 @@ public abstract class ConcurrentModificationCheckConcern
         }
 
         @Override
-        public long currentTime()
+        public Instant currentTime()
         {
             return uow.currentTime();
         }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/spi/src/main/java/org/qi4j/spi/entitystore/DefaultEntityStoreUnitOfWork.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/qi4j/spi/entitystore/DefaultEntityStoreUnitOfWork.java b/core/spi/src/main/java/org/qi4j/spi/entitystore/DefaultEntityStoreUnitOfWork.java
index cc93430..5e8c1aa 100644
--- a/core/spi/src/main/java/org/qi4j/spi/entitystore/DefaultEntityStoreUnitOfWork.java
+++ b/core/spi/src/main/java/org/qi4j/spi/entitystore/DefaultEntityStoreUnitOfWork.java
@@ -14,6 +14,7 @@
 
 package org.qi4j.spi.entitystore;
 
+import java.time.Instant;
 import java.util.HashMap;
 import org.qi4j.api.entity.EntityDescriptor;
 import org.qi4j.api.entity.EntityReference;
@@ -32,13 +33,13 @@ public final class DefaultEntityStoreUnitOfWork
     private Module module;
     private HashMap<EntityReference, EntityState> states = new HashMap<>();
     private Usecase usecase;
-    private long currentTime;
+    private Instant currentTime;
 
     public DefaultEntityStoreUnitOfWork( EntityStoreSPI entityStoreSPI,
                                          String identity,
                                          Module module,
                                          Usecase usecase,
-                                         long currentTime
+                                         Instant currentTime
     )
     {
         this.entityStoreSPI = entityStoreSPI;
@@ -60,7 +61,7 @@ public final class DefaultEntityStoreUnitOfWork
     }
 
     @Override
-    public long currentTime()
+    public Instant currentTime()
     {
         return currentTime;
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/spi/src/main/java/org/qi4j/spi/entitystore/EntityStateVersions.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/qi4j/spi/entitystore/EntityStateVersions.java b/core/spi/src/main/java/org/qi4j/spi/entitystore/EntityStateVersions.java
index ddf1758..9a6e5bc 100644
--- a/core/spi/src/main/java/org/qi4j/spi/entitystore/EntityStateVersions.java
+++ b/core/spi/src/main/java/org/qi4j/spi/entitystore/EntityStateVersions.java
@@ -14,6 +14,7 @@
 
 package org.qi4j.spi.entitystore;
 
+import java.time.Instant;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -36,7 +37,7 @@ public interface EntityStateVersions
 
     void rememberVersion( EntityReference identity, String version );
 
-    void checkForConcurrentModification( Iterable<EntityState> loaded, Module module, long currentTime )
+    void checkForConcurrentModification( Iterable<EntityState> loaded, Module module, Instant currentTime )
         throws ConcurrentEntityStateModificationException;
 
     /**
@@ -68,7 +69,7 @@ public interface EntityStateVersions
         @Override
         public synchronized void checkForConcurrentModification( Iterable<EntityState> loaded,
                                                                  Module module,
-                                                                 long currentTime
+                                                                 Instant currentTime
         )
             throws ConcurrentEntityStateModificationException
         {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/spi/src/main/java/org/qi4j/spi/entitystore/EntityStore.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/qi4j/spi/entitystore/EntityStore.java b/core/spi/src/main/java/org/qi4j/spi/entitystore/EntityStore.java
index fa5ac1b..8da92d0 100644
--- a/core/spi/src/main/java/org/qi4j/spi/entitystore/EntityStore.java
+++ b/core/spi/src/main/java/org/qi4j/spi/entitystore/EntityStore.java
@@ -16,6 +16,7 @@
  */
 package org.qi4j.spi.entitystore;
 
+import java.time.Instant;
 import org.qi4j.api.structure.Module;
 import org.qi4j.api.usecase.Usecase;
 import org.qi4j.io.Input;
@@ -26,7 +27,7 @@ import org.qi4j.spi.entity.EntityState;
  */
 public interface EntityStore
 {
-    EntityStoreUnitOfWork newUnitOfWork( Usecase usecase, Module module, long currentTime );
+    EntityStoreUnitOfWork newUnitOfWork( Usecase usecase, Module module, Instant currentTime );
 
     Input<EntityState, EntityStoreException> entityStates( Module module );
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/spi/src/main/java/org/qi4j/spi/entitystore/EntityStoreUnitOfWork.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/qi4j/spi/entitystore/EntityStoreUnitOfWork.java b/core/spi/src/main/java/org/qi4j/spi/entitystore/EntityStoreUnitOfWork.java
index 21655cd..3685721 100644
--- a/core/spi/src/main/java/org/qi4j/spi/entitystore/EntityStoreUnitOfWork.java
+++ b/core/spi/src/main/java/org/qi4j/spi/entitystore/EntityStoreUnitOfWork.java
@@ -14,6 +14,7 @@
 
 package org.qi4j.spi.entitystore;
 
+import java.time.Instant;
 import org.qi4j.api.entity.EntityDescriptor;
 import org.qi4j.api.entity.EntityReference;
 import org.qi4j.spi.entity.EntityState;
@@ -25,7 +26,7 @@ public interface EntityStoreUnitOfWork
 {
     String identity();
 
-    long currentTime();
+    Instant currentTime();
 
     /**
      * Create new EntityState for a given identity.

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/spi/src/main/java/org/qi4j/spi/entitystore/helpers/DefaultEntityState.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/qi4j/spi/entitystore/helpers/DefaultEntityState.java b/core/spi/src/main/java/org/qi4j/spi/entitystore/helpers/DefaultEntityState.java
index 178ecc6..2b710a1 100644
--- a/core/spi/src/main/java/org/qi4j/spi/entitystore/helpers/DefaultEntityState.java
+++ b/core/spi/src/main/java/org/qi4j/spi/entitystore/helpers/DefaultEntityState.java
@@ -19,6 +19,7 @@
  */
 package org.qi4j.spi.entitystore.helpers;
 
+import java.time.Instant;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
@@ -45,7 +46,7 @@ public final class DefaultEntityState
     private EntityStatus status;
 
     private String version;
-    private long lastModified;
+    private Instant lastModified;
     private final EntityReference identity;
     private final EntityDescriptor entityDescriptor;
 
@@ -72,7 +73,7 @@ public final class DefaultEntityState
 
     public DefaultEntityState( DefaultEntityStoreUnitOfWork unitOfWork,
                                String version,
-                               long lastModified,
+                               Instant lastModified,
                                EntityReference identity,
                                EntityStatus status,
                                EntityDescriptor entityDescriptor,
@@ -102,7 +103,7 @@ public final class DefaultEntityState
     }
 
     @Override
-    public long lastModified()
+    public Instant lastModified()
     {
         return lastModified;
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/spi/src/main/java/org/qi4j/spi/entitystore/helpers/JSONEntityState.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/qi4j/spi/entitystore/helpers/JSONEntityState.java b/core/spi/src/main/java/org/qi4j/spi/entitystore/helpers/JSONEntityState.java
index bef6229..dd72cc5 100644
--- a/core/spi/src/main/java/org/qi4j/spi/entitystore/helpers/JSONEntityState.java
+++ b/core/spi/src/main/java/org/qi4j/spi/entitystore/helpers/JSONEntityState.java
@@ -19,6 +19,7 @@
  */
 package org.qi4j.spi.entitystore.helpers;
 
+import java.time.Instant;
 import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONObject;
@@ -52,14 +53,13 @@ public final class JSONEntityState
         JSONKeys.MODIFIED
     };
 
-    private final DefaultEntityStoreUnitOfWork unitOfWork;
     private final ValueSerialization valueSerialization;
     private final String version;
     private final EntityReference identity;
     private final EntityDescriptor entityDescriptor;
 
     private EntityStatus status;
-    private long lastModified;
+    private Instant lastModified;
     private JSONObject state;
 
     /* package */ JSONEntityState( DefaultEntityStoreUnitOfWork unitOfWork,
@@ -68,8 +68,7 @@ public final class JSONEntityState
                                    EntityDescriptor entityDescriptor,
                                    JSONObject initialState )
     {
-        this( unitOfWork,
-              valueSerialization,
+        this( valueSerialization,
               "",
               unitOfWork.currentTime(),
               identity,
@@ -78,17 +77,15 @@ public final class JSONEntityState
               initialState );
     }
 
-    /* package */ JSONEntityState( DefaultEntityStoreUnitOfWork unitOfWork,
-                                   ValueSerialization valueSerialization,
+    /* package */ JSONEntityState( ValueSerialization valueSerialization,
                                    String version,
-                                   long lastModified,
+                                   Instant lastModified,
                                    EntityReference identity,
                                    EntityStatus status,
                                    EntityDescriptor entityDescriptor,
                                    JSONObject state
     )
     {
-        this.unitOfWork = unitOfWork;
         this.valueSerialization = valueSerialization;
         this.version = version;
         this.lastModified = lastModified;
@@ -106,7 +103,7 @@ public final class JSONEntityState
     }
 
     @Override
-    public long lastModified()
+    public Instant lastModified()
     {
         return lastModified;
     }
@@ -201,10 +198,9 @@ public final class JSONEntityState
                 return null;
             }
 
-            EntityReference value = jsonValue == JSONObject.NULL
+            return jsonValue == JSONObject.NULL
                                     ? null
                                     : EntityReference.parseEntityReference( (String) jsonValue );
-            return value;
         }
         catch( JSONException e )
         {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/spi/src/main/java/org/qi4j/spi/entitystore/helpers/JSONMapEntityStoreMixin.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/qi4j/spi/entitystore/helpers/JSONMapEntityStoreMixin.java b/core/spi/src/main/java/org/qi4j/spi/entitystore/helpers/JSONMapEntityStoreMixin.java
index d64617a..e36e9be 100644
--- a/core/spi/src/main/java/org/qi4j/spi/entitystore/helpers/JSONMapEntityStoreMixin.java
+++ b/core/spi/src/main/java/org/qi4j/spi/entitystore/helpers/JSONMapEntityStoreMixin.java
@@ -25,6 +25,7 @@ import java.io.ObjectInput;
 import java.io.ObjectOutput;
 import java.io.Reader;
 import java.io.Writer;
+import java.time.Instant;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.UUID;
@@ -143,7 +144,7 @@ public class JSONMapEntityStoreMixin
     // EntityStore
 
     @Override
-    public EntityStoreUnitOfWork newUnitOfWork( Usecase usecaseMetaInfo, Module module, long currentTime )
+    public EntityStoreUnitOfWork newUnitOfWork( Usecase usecaseMetaInfo, Module module, Instant currentTime )
     {
         return new DefaultEntityStoreUnitOfWork( entityStoreSpi, newUnitOfWorkId(), module, usecaseMetaInfo, currentTime );
     }
@@ -292,7 +293,7 @@ public class JSONMapEntityStoreMixin
                             newUnitOfWorkId(),
                             module,
                             usecase,
-                            System.currentTimeMillis() );
+                            Instant.now() );
 
                         final List<EntityState> migrated = new ArrayList<>();
 
@@ -376,14 +377,14 @@ public class JSONMapEntityStoreMixin
         return uuid + Integer.toHexString( count++ );
     }
 
-    protected void writeEntityState( JSONEntityState state, Writer writer, String identity, long lastModified )
+    protected void writeEntityState( JSONEntityState state, Writer writer, String identity, Instant lastModified )
         throws EntityStoreException
     {
         try
         {
             JSONObject jsonState = state.state();
             jsonState.put( JSONKeys.VERSION, identity );
-            jsonState.put( JSONKeys.MODIFIED, lastModified );
+            jsonState.put( JSONKeys.MODIFIED, lastModified.toEpochMilli() );
             writer.append( jsonState.toString() );
         }
         catch( JSONException | IOException e )
@@ -441,10 +442,9 @@ public class JSONMapEntityStoreMixin
                 throw new EntityTypeNotFoundException( type );
             }
 
-            return new JSONEntityState( unitOfWork,
-                                        valueSerialization,
+            return new JSONEntityState( valueSerialization,
                                         version,
-                                        modified,
+                                        Instant.ofEpochMilli(modified),
                                         EntityReference.parseEntityReference( identity ),
                                         status,
                                         entityDescriptor,

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/spi/src/main/java/org/qi4j/spi/entitystore/helpers/MapEntityStoreMixin.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/qi4j/spi/entitystore/helpers/MapEntityStoreMixin.java b/core/spi/src/main/java/org/qi4j/spi/entitystore/helpers/MapEntityStoreMixin.java
index b4abf53..8c4c64c 100644
--- a/core/spi/src/main/java/org/qi4j/spi/entitystore/helpers/MapEntityStoreMixin.java
+++ b/core/spi/src/main/java/org/qi4j/spi/entitystore/helpers/MapEntityStoreMixin.java
@@ -22,6 +22,7 @@ package org.qi4j.spi.entitystore.helpers;
 import java.io.IOException;
 import java.io.Reader;
 import java.io.Writer;
+import java.time.Instant;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
@@ -117,7 +118,7 @@ public class MapEntityStoreMixin
 
     // EntityStore
     @Override
-    public EntityStoreUnitOfWork newUnitOfWork( Usecase usecaseMetaInfo, Module module, long currentTime )
+    public EntityStoreUnitOfWork newUnitOfWork( Usecase usecaseMetaInfo, Module module, Instant currentTime )
     {
         return new DefaultEntityStoreUnitOfWork( entityStoreSpi, newUnitOfWorkId(), module, usecaseMetaInfo, currentTime );
     }
@@ -221,7 +222,7 @@ public class MapEntityStoreMixin
                             newUnitOfWorkId(),
                             module,
                             usecase,
-                            System.currentTimeMillis() );
+                            Instant.now() );
 
                         final List<EntityState> migrated = new ArrayList<>();
 
@@ -305,7 +306,7 @@ public class MapEntityStoreMixin
         return uuid + Integer.toHexString( count++ );
     }
 
-    protected void writeEntityState( DefaultEntityState state, Writer writer, String version, long lastModified )
+    protected void writeEntityState( DefaultEntityState state, Writer writer, String version, Instant lastModified )
         throws EntityStoreException
     {
         try
@@ -316,7 +317,7 @@ public class MapEntityStoreMixin
                 key( JSONKeys.APPLICATION_VERSION ).value( application.version() ).
                 key( JSONKeys.TYPE ).value( first( state.entityDescriptor().types() ).getName() ).
                 key( JSONKeys.VERSION ).value( version ).
-                key( JSONKeys.MODIFIED ).value( lastModified ).
+                key( JSONKeys.MODIFIED ).value( lastModified.toEpochMilli() ).
                 key( JSONKeys.PROPERTIES ).object();
             EntityDescriptor entityType = state.entityDescriptor();
             for( PropertyDescriptor persistentProperty : entityType.state().properties() )
@@ -392,7 +393,7 @@ public class MapEntityStoreMixin
             EntityStatus status = EntityStatus.LOADED;
 
             String version = jsonObject.getString( JSONKeys.VERSION );
-            long modified = jsonObject.getLong( JSONKeys.MODIFIED );
+            Instant modified = Instant.ofEpochMilli( jsonObject.getLong( JSONKeys.MODIFIED ) );
             String identity = jsonObject.getString( JSONKeys.IDENTITY );
 
             // Check if version is correct

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/spi/src/main/java/org/qi4j/spi/value/ValueDeserializerAdapter.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/qi4j/spi/value/ValueDeserializerAdapter.java b/core/spi/src/main/java/org/qi4j/spi/value/ValueDeserializerAdapter.java
index ce01787..4993654 100644
--- a/core/spi/src/main/java/org/qi4j/spi/value/ValueDeserializerAdapter.java
+++ b/core/spi/src/main/java/org/qi4j/spi/value/ValueDeserializerAdapter.java
@@ -22,10 +22,23 @@ import java.io.InputStream;
 import java.io.ObjectInputStream;
 import java.math.BigDecimal;
 import java.math.BigInteger;
+import java.time.Duration;
+import java.time.Instant;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.MonthDay;
+import java.time.OffsetDateTime;
+import java.time.OffsetTime;
+import java.time.Period;
+import java.time.Year;
+import java.time.YearMonth;
+import java.time.ZoneId;
+import java.time.ZoneOffset;
+import java.time.ZonedDateTime;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Date;
 import java.util.HashMap;
 import java.util.LinkedHashSet;
 import java.util.List;
@@ -34,9 +47,6 @@ import java.util.Scanner;
 import java.util.Set;
 import java.util.function.BiFunction;
 import java.util.function.Function;
-import org.joda.time.DateTime;
-import org.joda.time.LocalDate;
-import org.joda.time.LocalDateTime;
 import org.qi4j.api.association.AssociationDescriptor;
 import org.qi4j.api.entity.EntityReference;
 import org.qi4j.api.injection.scope.Service;
@@ -51,7 +61,6 @@ import org.qi4j.api.type.MapType;
 import org.qi4j.api.type.ValueCompositeType;
 import org.qi4j.api.type.ValueType;
 import org.qi4j.api.util.Base64Encoder;
-import org.qi4j.api.util.Dates;
 import org.qi4j.api.value.ValueBuilder;
 import org.qi4j.api.value.ValueDescriptor;
 import org.qi4j.api.value.ValueDeserializer;
@@ -86,9 +95,6 @@ import static org.qi4j.functional.Iterables.first;
  * <ul>
  *     <li>BigInteger and BigDecimal depends on {@link org.qi4j.api.value.ValueSerializer.Options};</li>
  *     <li>Date as String in ISO-8601, {@literal @millis@} or {@literal /Date(..)} Microsoft format;</li>
- *     <li>DateTime (JodaTime) as a ISO-8601 String with optional timezone offset;</li>
- *     <li>LocalDateTime (JodaTime) as whatever {@link LocalDateTime#LocalDateTime(java.lang.Object)} accept as {@literal instant};</li>
- *     <li>LocalDate (JodaTime) as whatever {@link LocalDate#LocalDate(java.lang.Object)} accept as {@literal instant};</li>
  * </ul>
  *
  * @param <InputType> Implementor pull-parser type
@@ -260,21 +266,28 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
             }
         } );
 
-        // Date types
-        registerDeserializer( Date.class, new Function<Object, Date>()
+        registerDeserializer( ZonedDateTime.class, new Function<Object, ZonedDateTime>()
         {
             @Override
-            public Date apply( Object input )
+            public ZonedDateTime apply( Object input )
             {
-                return Dates.fromString( input.toString() );
+                return ZonedDateTime.parse( input.toString() );
             }
         } );
-        registerDeserializer( DateTime.class, new Function<Object, DateTime>()
+        registerDeserializer( OffsetDateTime.class, new Function<Object, OffsetDateTime>()
         {
             @Override
-            public DateTime apply( Object input )
+            public OffsetDateTime apply( Object input )
             {
-                return DateTime.parse( input.toString() );
+                return OffsetDateTime.parse( input.toString() );
+            }
+        } );
+        registerDeserializer( OffsetTime.class, new Function<Object, OffsetTime>()
+        {
+            @Override
+            public OffsetTime apply( Object input )
+            {
+                return OffsetTime.parse( input.toString() );
             }
         } );
         registerDeserializer( LocalDateTime.class, new Function<Object, LocalDateTime>()
@@ -282,7 +295,15 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
             @Override
             public LocalDateTime apply( Object input )
             {
-                return new LocalDateTime( input );
+                return LocalDateTime.parse( input.toString() );
+            }
+        } );
+        registerDeserializer( LocalTime.class, new Function<Object, LocalTime>()
+        {
+            @Override
+            public LocalTime apply( Object input )
+            {
+                return LocalTime.parse( input.toString() );
             }
         } );
         registerDeserializer( LocalDate.class, new Function<Object, LocalDate>()
@@ -290,7 +311,71 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
             @Override
             public LocalDate apply( Object input )
             {
-                return new LocalDate( input );
+                return LocalDate.parse( input.toString() );
+            }
+        } );
+        registerDeserializer( Duration.class, new Function<Object, Duration>()
+        {
+            @Override
+            public Duration apply( Object input )
+            {
+                return Duration.parse( input.toString() );
+            }
+        } );
+        registerDeserializer( Instant.class, new Function<Object, Instant>()
+        {
+            @Override
+            public Instant apply( Object input )
+            {
+                return Instant.parse( input.toString() );
+            }
+        } );
+        registerDeserializer( MonthDay.class, new Function<Object, MonthDay>()
+        {
+            @Override
+            public MonthDay apply( Object input )
+            {
+                return MonthDay.parse( input.toString() );
+            }
+        } );
+        registerDeserializer( Period.class, new Function<Object, Period>()
+        {
+            @Override
+            public Period apply( Object input )
+            {
+                return Period.parse( input.toString() );
+            }
+        } );
+        registerDeserializer( Year.class, new Function<Object, Year>()
+        {
+            @Override
+            public Year apply( Object input )
+            {
+                return Year.parse( input.toString() );
+            }
+        } );
+        registerDeserializer( YearMonth.class, new Function<Object, YearMonth>()
+        {
+            @Override
+            public YearMonth apply( Object input )
+            {
+                return YearMonth.parse( input.toString() );
+            }
+        } );
+        registerDeserializer( ZoneId.class, new Function<Object, ZoneId>()
+        {
+            @Override
+            public ZoneId apply( Object input )
+            {
+                return ZoneId.of( input.toString() );
+            }
+        } );
+        registerDeserializer( ZoneOffset.class, new Function<Object, ZoneOffset>()
+        {
+            @Override
+            public ZoneOffset apply( Object input )
+            {
+                return ZoneOffset.of( input.toString() );
             }
         } );
 
@@ -483,8 +568,13 @@ public abstract class ValueDeserializerAdapter<InputType, InputNodeType>
     private <T> T doDeserialize( ValueType valueType, InputType input )
         throws Exception
     {
-        final Class<?> type = first( valueType.types() );
+        Class<?> type = first( valueType.types() );
         // Registered deserializers
+        if( ( !type.equals( ZoneOffset.class ) ) && ZoneId.class.isAssignableFrom( type ) )
+        {
+            type = ZoneId.class;
+        }
+
         if( deserializers.get( type ) != null )
         {
             Object value = readPlainValue( input );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/spi/src/main/java/org/qi4j/spi/value/ValueSerializerAdapter.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/qi4j/spi/value/ValueSerializerAdapter.java b/core/spi/src/main/java/org/qi4j/spi/value/ValueSerializerAdapter.java
index 5a1cfea..ce2bc6a 100644
--- a/core/spi/src/main/java/org/qi4j/spi/value/ValueSerializerAdapter.java
+++ b/core/spi/src/main/java/org/qi4j/spi/value/ValueSerializerAdapter.java
@@ -22,14 +22,24 @@ import java.io.ObjectOutputStream;
 import java.io.OutputStream;
 import java.math.BigDecimal;
 import java.math.BigInteger;
-import java.util.Date;
+import java.time.Duration;
+import java.time.Instant;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.MonthDay;
+import java.time.OffsetDateTime;
+import java.time.OffsetTime;
+import java.time.Period;
+import java.time.Year;
+import java.time.YearMonth;
+import java.time.ZoneId;
+import java.time.ZoneOffset;
+import java.time.ZonedDateTime;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.function.BiFunction;
 import java.util.function.Function;
-import org.joda.time.DateTime;
-import org.joda.time.LocalDate;
-import org.joda.time.LocalDateTime;
 import org.qi4j.api.Qi4j;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.association.AssociationDescriptor;
@@ -43,7 +53,6 @@ import org.qi4j.api.entity.Identity;
 import org.qi4j.api.property.Property;
 import org.qi4j.api.property.PropertyDescriptor;
 import org.qi4j.api.util.Base64Encoder;
-import org.qi4j.api.util.Dates;
 import org.qi4j.api.value.ValueComposite;
 import org.qi4j.api.value.ValueDescriptor;
 import org.qi4j.api.value.ValueSerializationException;
@@ -57,29 +66,26 @@ import static org.qi4j.functional.Iterables.first;
  * Adapter for pull-parsing capable ValueSerializers.
  *
  * <p>
- *     Among Plain values (see {@link ValueSerializer}) some are considered primitives to underlying serialization
- *     mechanisms and by so handed/come without conversion to/from implementations. Primitive values can be one of:
+ * Among Plain values (see {@link ValueSerializer}) some are considered primitives to underlying serialization
+ * mechanisms and by so handed/come without conversion to/from implementations. Primitive values can be one of:
  * </p>
  * <ul>
- *     <li>String,</li>
- *     <li>Character or char,</li>
- *     <li>Boolean or boolean,</li>
- *     <li>Integer or int,</li>
- *     <li>Long or long,</li>
- *     <li>Short or short,</li>
- *     <li>Byte or byte,</li>
- *     <li>Float or float,</li>
- *     <li>Double or double.</li>
+ * <li>String,</li>
+ * <li>Character or char,</li>
+ * <li>Boolean or boolean,</li>
+ * <li>Integer or int,</li>
+ * <li>Long or long,</li>
+ * <li>Short or short,</li>
+ * <li>Byte or byte,</li>
+ * <li>Float or float,</li>
+ * <li>Double or double.</li>
  * </ul>
  * <p>
- *     Some other Plain values are transformed before being handed to implementations:
+ * Some other Plain values are transformed before being handed to implementations:
  * </p>
  * <ul>
- *     <li>BigInteger and BigDecimal depends on ValueSerializer.{@link Options};</li>
- *     <li>Date as a ISO-8601 UTC String;</li>
- *     <li>DateTime (JodaTime) as a ISO-8601 String with timezone offset or Z for UTC;</li>
- *     <li>LocalDateTime (JodaTime) as a ISO-8601 String with no timezone offset;</li>
- *     <li>LocalDate (JodaTime) as a ISO-8601 String with no time info;</li>
+ * <li>BigInteger and BigDecimal depends on ValueSerializer.{@link Options};</li>
+ * <li>Date as a ISO-8601 UTC String;</li>
  * </ul>
  *
  * @param <OutputType> Implementor output type
@@ -115,11 +121,11 @@ public abstract class ValueSerializerAdapter<OutputType>
     /**
      * Register a Plain Value type serialization Function.
      *
-     * @param <T> Plain Value parametrized Type
-     * @param type Plain Value Type
+     * @param <T>        Plain Value parametrized Type
+     * @param type       Plain Value Type
      * @param serializer Serialization Function
      */
-    @SuppressWarnings( "unchecked" )
+    @SuppressWarnings("unchecked")
     protected final <T> void registerSerializer( Class<T> type, BiFunction<Options, T, Object> serializer )
     {
         serializers.put( type, (BiFunction<Options, Object, Object>) serializer );
@@ -128,11 +134,11 @@ public abstract class ValueSerializerAdapter<OutputType>
     /**
      * Register a Complex Value type serialization Function.
      *
-     * @param <T> Complex Value parametrized Type
-     * @param type Complex Value Type
+     * @param <T>        Complex Value parametrized Type
+     * @param type       Complex Value Type
      * @param serializer Serialization Function
      */
-    @SuppressWarnings( "unchecked" )
+    @SuppressWarnings("unchecked")
     protected final <T> void registerComplexSerializer( Class<T> type, ComplexSerializer<T, OutputType> serializer )
     {
         complexSerializers.put( type, (ComplexSerializer<Object, OutputType>) serializer );
@@ -170,28 +176,28 @@ public abstract class ValueSerializerAdapter<OutputType>
         } );
 
         // Date types
-        registerSerializer( Date.class, new BiFunction<Options, Date, Object>()
+        registerSerializer( ZonedDateTime.class, new BiFunction<Options, ZonedDateTime, Object>()
         {
             @Override
-            public Object apply( Options options, Date date )
+            public Object apply( Options options, ZonedDateTime dateTime )
             {
-                return Dates.toUtcString( date );
+                return dateTime.toString();
             }
         } );
-        registerSerializer( DateTime.class, new BiFunction<Options, DateTime, Object>()
+        registerSerializer( LocalDateTime.class, new BiFunction<Options, LocalDateTime, Object>()
         {
             @Override
-            public Object apply( Options options, DateTime date )
+            public Object apply( Options options, LocalDateTime dateTime )
             {
-                return date.toString();
+                return dateTime.toString();
             }
         } );
-        registerSerializer( LocalDateTime.class, new BiFunction<Options, LocalDateTime, Object>()
+        registerSerializer( LocalTime.class, new BiFunction<Options, LocalTime, Object>()
         {
             @Override
-            public Object apply( Options options, LocalDateTime date )
+            public Object apply( Options options, LocalTime time )
             {
-                return date.toString();
+                return time.toString();
             }
         } );
         registerSerializer( LocalDate.class, new BiFunction<Options, LocalDate, Object>()
@@ -202,6 +208,86 @@ public abstract class ValueSerializerAdapter<OutputType>
                 return date.toString();
             }
         } );
+        registerSerializer( OffsetDateTime.class, new BiFunction<Options, OffsetDateTime, Object>()
+        {
+            @Override
+            public Object apply( Options options, OffsetDateTime time )
+            {
+                return time.toString();
+            }
+        } );
+        registerSerializer( OffsetTime.class, new BiFunction<Options, OffsetTime, Object>()
+        {
+            @Override
+            public Object apply( Options options, OffsetTime time )
+            {
+                return time.toString();
+            }
+        } );
+        registerSerializer( Duration.class, new BiFunction<Options, Duration, Object>()
+        {
+            @Override
+            public Object apply( Options options, Duration time )
+            {
+                return time.toString();
+            }
+        } );
+        registerSerializer( Period.class, new BiFunction<Options, Period, Object>()
+        {
+            @Override
+            public Object apply( Options options, Period time )
+            {
+                return time.toString();
+            }
+        } );
+        registerSerializer( Instant.class, new BiFunction<Options, Instant, Object>()
+        {
+            @Override
+            public Object apply( Options options, Instant time )
+            {
+                return time.toString();
+            }
+        } );
+        registerSerializer( MonthDay.class, new BiFunction<Options, MonthDay, Object>()
+        {
+            @Override
+            public Object apply( Options options, MonthDay monthDay )
+            {
+                return monthDay.toString();
+            }
+        } );
+        registerSerializer( Year.class, new BiFunction<Options, Year, Object>()
+        {
+            @Override
+            public Object apply( Options options, Year year )
+            {
+                return year.toString();
+            }
+        } );
+        registerSerializer( YearMonth.class, new BiFunction<Options, YearMonth, Object>()
+        {
+            @Override
+            public Object apply( Options options, YearMonth yearMonth )
+            {
+                return yearMonth.toString();
+            }
+        } );
+        registerSerializer( ZoneId.class, new BiFunction<Options, ZoneId, Object>()
+        {
+            @Override
+            public Object apply( Options options, ZoneId id )
+            {
+                return id.toString();
+            }
+        } );
+        registerSerializer( ZoneOffset.class, new BiFunction<Options, ZoneOffset, Object>()
+        {
+            @Override
+            public Object apply( Options options, ZoneOffset offset )
+            {
+                return offset.toString();
+            }
+        } );
 
         // Other supported types
         registerSerializer( EntityReference.class, new BiFunction<Options, EntityReference, Object>()
@@ -361,54 +447,53 @@ public abstract class ValueSerializerAdapter<OutputType>
     private void doSerialize( Options options, Object object, OutputType output, boolean rootPass )
         throws Exception
     {
-        // Null
         if( object == null )
         {
             LOG.trace( "Null object -> onValue( null )" );
             onValue( output, null );
+            return;
+        }
+
+        Class<?> type = object.getClass();
+        if( ( !type.equals( ZoneOffset.class ) ) && ZoneId.class.isAssignableFrom( type ) )
+        {
+            type = ZoneId.class;
         }
-        else // Registered serializer
-        if( serializers.get( object.getClass() ) != null )
+        if( serializers.get( type ) != null )
         {
             LOG.trace( "Registered serializer matches -> onValue( serialized )" );
-            onValue( output, serializers.get( object.getClass() ).apply( options, object ) );
+            onValue( output, serializers.get( type ).apply( options, object ) );
         }
-        else if( complexSerializers.get( object.getClass() ) != null )
+        else if( complexSerializers.get( type ) != null )
         {
-            complexSerializers.get( object.getClass() ).serialize( options, object, output );
+            complexSerializers.get( type ).serialize( options, object, output );
         }
-        else // ValueComposite
-        if( ValueComposite.class.isAssignableFrom( object.getClass() ) )
+        else if( ValueComposite.class.isAssignableFrom( type ) )
         {
             LOG.trace( "ValueComposite assignable -> serializeValueComposite( object )" );
             serializeValueComposite( options, object, output, rootPass );
         }
-        else // EntityComposite
-        if( EntityComposite.class.isAssignableFrom( object.getClass() ) )
+        else if( EntityComposite.class.isAssignableFrom( type ) )
         {
             LOG.trace( "EntityComposite assignable -> serializeEntityComposite( object )" );
             serializeEntityComposite( object, output );
         }
-        else // Collection - Iterable
-        if( Iterable.class.isAssignableFrom( object.getClass() ) )
+        else if( Iterable.class.isAssignableFrom( type ) )
         {
             LOG.trace( "Iterable assignable -> serializeIterable( object )" );
             serializeIterable( options, object, output );
         }
-        else // Array - QUID Remove this and use java serialization for arrays?
-        if( object.getClass().isArray() )
+        else if( type.isArray() )
         {
             LOG.trace( "Object isArray -> serializeBase64Serializable( object )" );
             serializeBase64Serializable( object, output );
         }
-        else // Map
-        if( Map.class.isAssignableFrom( object.getClass() ) )
+        else if( Map.class.isAssignableFrom( type ) )
         {
             LOG.trace( "Map assignable -> serializeMap( object )" );
             serializeMap( options, object, output );
         }
-        else // Enum
-        if( object.getClass().isEnum() )
+        else if( type.isEnum() )
         {
             LOG.trace( "Object is an enum -> onValue( object.toString() )" );
             onValue( output, object.toString() );
@@ -511,7 +596,7 @@ public abstract class ValueSerializerAdapter<OutputType>
     private void serializeIterable( Options options, Object object, OutputType output )
         throws Exception
     {
-        @SuppressWarnings( "unchecked" )
+        @SuppressWarnings("unchecked")
         Iterable<Object> collection = (Iterable<Object>) object;
         onArrayStart( output );
         for( Object item : collection )
@@ -526,7 +611,7 @@ public abstract class ValueSerializerAdapter<OutputType>
     private void serializeMap( Options options, Object object, OutputType output )
         throws Exception
     {
-        @SuppressWarnings( "unchecked" )
+        @SuppressWarnings("unchecked")
         Map<Object, Object> map = (Map<Object, Object>) object;
         onArrayStart( output );
         for( Map.Entry<Object, Object> entry : map.entrySet() )
@@ -560,7 +645,7 @@ public abstract class ValueSerializerAdapter<OutputType>
         throws Exception
     {
         ByteArrayOutputStream bout = new ByteArrayOutputStream();
-        try( ObjectOutputStream out = new ObjectOutputStream( bout ) )
+        try (ObjectOutputStream out = new ObjectOutputStream( bout ))
         {
             out.writeUnshared( object );
         }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/spi/src/test/java/org/qi4j/spi/entitystore/helpers/JSONManyAssociationStateTest.java
----------------------------------------------------------------------
diff --git a/core/spi/src/test/java/org/qi4j/spi/entitystore/helpers/JSONManyAssociationStateTest.java b/core/spi/src/test/java/org/qi4j/spi/entitystore/helpers/JSONManyAssociationStateTest.java
index 1fd4613..ebb4bad 100644
--- a/core/spi/src/test/java/org/qi4j/spi/entitystore/helpers/JSONManyAssociationStateTest.java
+++ b/core/spi/src/test/java/org/qi4j/spi/entitystore/helpers/JSONManyAssociationStateTest.java
@@ -15,6 +15,7 @@
  */
 package org.qi4j.spi.entitystore.helpers;
 
+import java.time.Instant;
 import java.util.List;
 import java.util.function.Function;
 import org.json.JSONArray;
@@ -45,9 +46,8 @@ public class JSONManyAssociationStateTest
         state.put( JSONKeys.MANY_ASSOCIATIONS, new JSONObject() );
         state.put( JSONKeys.NAMED_ASSOCIATIONS, new JSONObject() );
         JSONEntityState entityState = new JSONEntityState( null,
-                                                           null,
                                                            "0",
-                                                           System.currentTimeMillis(),
+                                                           Instant.now(),
                                                            EntityReference.parseEntityReference( "123" ),
                                                            EntityStatus.NEW,
                                                            null,
@@ -71,9 +71,8 @@ public class JSONManyAssociationStateTest
         state.put( JSONKeys.MANY_ASSOCIATIONS, new JSONObject() );
         state.put( JSONKeys.NAMED_ASSOCIATIONS, new JSONObject() );
         JSONEntityState entityState = new JSONEntityState( null,
-                                                           null,
                                                            "0",
-                                                           System.currentTimeMillis(),
+                                                           Instant.now(),
                                                            EntityReference.parseEntityReference( "123" ),
                                                            EntityStatus.NEW,
                                                            null,


[29/50] [abbrv] zest-qi4j git commit: Replaced Joda Time with Java 8 Time API.

Posted by ni...@apache.org.
http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/struts2Hello/src/main/java/org/qi4j/library/struts2/example/actions/IndexAction.java
----------------------------------------------------------------------
diff --git a/samples/struts2Hello/src/main/java/org/qi4j/library/struts2/example/actions/IndexAction.java b/samples/struts2Hello/src/main/java/org/qi4j/library/struts2/example/actions/IndexAction.java
index 49a0c52..15495ad 100644
--- a/samples/struts2Hello/src/main/java/org/qi4j/library/struts2/example/actions/IndexAction.java
+++ b/samples/struts2Hello/src/main/java/org/qi4j/library/struts2/example/actions/IndexAction.java
@@ -20,12 +20,11 @@ package org.qi4j.library.struts2.example.actions;
 import com.opensymphony.xwork2.ActionSupport;
 import com.opensymphony.xwork2.conversion.annotations.Conversion;
 import com.opensymphony.xwork2.conversion.annotations.TypeConversion;
+import java.time.Instant;
 import org.apache.struts2.config.Result;
 import org.qi4j.api.injection.scope.Structure;
 import org.qi4j.api.structure.Module;
 
-import java.util.Date;
-
 @Conversion
 @Result( value = "/jsp/index.jsp" )
 public class IndexAction
@@ -37,15 +36,15 @@ public class IndexAction
     @Structure
     private Module module;
 
-    private Date now;
+    private Instant now;
 
     public IndexAction()
     {
-        now = new Date();
+        now = Instant.now();
     }
 
     @TypeConversion( converter = "org.qi4j.library.struts2.example.converters.DateConverter" )
-    public Date getDateNow()
+    public Instant getDateNow()
     {
         return now;
     }
@@ -59,7 +58,7 @@ public class IndexAction
     public String execute()
         throws Exception
     {
-        now = new Date();
+        now = Instant.now();
         return SUCCESS;
     }
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/struts2Hello/src/main/java/org/qi4j/library/struts2/example/converters/DateConverter.java
----------------------------------------------------------------------
diff --git a/samples/struts2Hello/src/main/java/org/qi4j/library/struts2/example/converters/DateConverter.java b/samples/struts2Hello/src/main/java/org/qi4j/library/struts2/example/converters/DateConverter.java
index 1a28fb3..f5cbb06 100644
--- a/samples/struts2Hello/src/main/java/org/qi4j/library/struts2/example/converters/DateConverter.java
+++ b/samples/struts2Hello/src/main/java/org/qi4j/library/struts2/example/converters/DateConverter.java
@@ -17,12 +17,9 @@
  */
 package org.qi4j.library.struts2.example.converters;
 
-import org.apache.struts2.util.StrutsTypeConverter;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
+import java.time.ZonedDateTime;
 import java.util.Map;
+import org.apache.struts2.util.StrutsTypeConverter;
 
 public class DateConverter
     extends StrutsTypeConverter
@@ -32,12 +29,11 @@ public class DateConverter
     {
         if( values != null && values.length > 0 && values[ 0 ] != null && values[ 0 ].length() > 0 )
         {
-            SimpleDateFormat sdf = new SimpleDateFormat( "yyyy/MM/dd" );
             try
             {
-                return sdf.parse( values[ 0 ] );
+                return ZonedDateTime.parse( values[ 0 ] );
             }
-            catch( ParseException e )
+            catch( RuntimeException e )
             {
                 throw new IllegalArgumentException( "Parse [" + values[ 0 ] + "] do date fail.", e );
             }
@@ -48,10 +44,9 @@ public class DateConverter
     @Override
     public String convertToString( Map context, Object o )
     {
-        if( o instanceof Date )
+        if( o instanceof ZonedDateTime )
         {
-            SimpleDateFormat sdf = new SimpleDateFormat( "yyyy/MM/dd" );
-            return sdf.format( (Date) o );
+            return o.toString();
         }
         return "";
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/tutorials/introduction/thirtyminutes/src/main/java/org/qi4j/demo/thirtyminutes/ThirtyMinutesDocs.java
----------------------------------------------------------------------
diff --git a/tutorials/introduction/thirtyminutes/src/main/java/org/qi4j/demo/thirtyminutes/ThirtyMinutesDocs.java b/tutorials/introduction/thirtyminutes/src/main/java/org/qi4j/demo/thirtyminutes/ThirtyMinutesDocs.java
index e125b6d..3221847 100644
--- a/tutorials/introduction/thirtyminutes/src/main/java/org/qi4j/demo/thirtyminutes/ThirtyMinutesDocs.java
+++ b/tutorials/introduction/thirtyminutes/src/main/java/org/qi4j/demo/thirtyminutes/ThirtyMinutesDocs.java
@@ -2,8 +2,7 @@ package org.qi4j.demo.thirtyminutes;
 
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Method;
-import java.util.Calendar;
-import java.util.Date;
+import java.time.LocalDate;
 import java.util.Iterator;
 import java.util.List;
 import org.qi4j.api.common.Optional;
@@ -81,10 +80,7 @@ public class ThirtyMinutesDocs
 // START SNIPPET: 7
         QueryBuilder<Order> builder = module.newQueryBuilder( Order.class );
 
-        Calendar cal = Calendar.getInstance();
-        cal.setTime( new Date() );
-        cal.roll( Calendar.DAY_OF_MONTH, -90 );
-        Date last90days = cal.getTime();
+        LocalDate last90days = LocalDate.now().minusDays( 90 );
         Order template = templateFor( Order.class );
         builder.where( gt( template.createdDate(), last90days ) );
         Query<Order> query = uow.newQuery(builder);
@@ -103,10 +99,7 @@ public class ThirtyMinutesDocs
 // START SNIPPET: 8
         QueryBuilder<HasCustomer> builder = module.newQueryBuilder( HasCustomer.class );
 
-        Calendar cal = Calendar.getInstance();
-        cal.setTime( new Date() );
-        cal.roll( Calendar.MONTH, -1 );
-        Date lastMonth = cal.getTime();
+        LocalDate lastMonth = LocalDate.now().minusMonths( 1 );
         Order template1 = templateFor( Order.class );
         builder.where( gt( template1.createdDate(), lastMonth ) );
         Query<HasCustomer> query = uow.newQuery(builder);
@@ -127,7 +120,7 @@ public class ThirtyMinutesDocs
 
         void completed();
 
-        Property<Date> createdDate();
+        Property<LocalDate> createdDate();
     }
 
 


[02/50] [abbrv] zest-qi4j git commit: Build System, minor: sorted test dependencies in libraries.gradle

Posted by ni...@apache.org.
Build System, minor: sorted test dependencies in libraries.gradle


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/1acd4032
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/1acd4032
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/1acd4032

Branch: refs/heads/3.0
Commit: 1acd403233832a9fbed5904da57016722b668140
Parents: b049e9b
Author: Paul Merlin <pa...@nosphere.org>
Authored: Thu Feb 20 22:16:10 2014 +0100
Committer: Paul Merlin <pa...@nosphere.org>
Committed: Thu Feb 20 22:16:10 2014 +0100

----------------------------------------------------------------------
 libraries.gradle | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/1acd4032/libraries.gradle
----------------------------------------------------------------------
diff --git a/libraries.gradle b/libraries.gradle
index bf4f9b2..d0b8047 100644
--- a/libraries.gradle
+++ b/libraries.gradle
@@ -70,11 +70,13 @@ def wsdl4jVersion = '1.6.3'
 def yammerMetricsVersion = '2.2.0'
 
 def antVersion = '1.9.2'
-def junitVersion = '4.11'
-def testNgVersion = '6.8.7'
+def awaitilityVersion = '1.5.0'
+def easyMockVersion = '3.2'
 def jmockVersion = '2.6.0'
+def junitVersion = '4.11'
 def mockitoVersion = '1.9.5'
-def easyMockVersion = '3.2'
+def testNgVersion = '6.8.7'
+def restAssuredVersion= '2.3.0'
 def xmlunitVersion = '1.5'
 
 // build a map of the dependency artifacts to use.  Allows centralized definition of the version of artifacts to
@@ -260,19 +262,23 @@ rootProject.ext {
           prefuse: "de.sciss:prefuse-core:$prefuseVersion",
           spymemcached: "net.spy:spymemcached:$spymemcachedVersion",
 
-          // testing
+          // Testing
+          junit: "junit:junit:$junitVersion",
+          awaitility: "com.jayway.awaitility:awaitility:$awaitilityVersion",
+          easymock: "org.easymock:easymock:$easyMockVersion",
+          jmock: "org.jmock:jmock:$jmockVersion",
+          mockito: "org.mockito:mockito-core:$mockitoVersion",
+          rest_assured: "com.jayway.restassured:rest-assured:$restAssuredVersion",
+          testng: "org.testng:testng:$testNgVersion",
+          xmlunit: "xmlunit:xmlunit:$xmlunitVersion",
+          
+          // Tests dependencies
           derby: "org.apache.derby:derby:$derbyVersion",
           derbyclient: "org.apache.derby:derbyclient:$derbyVersion",
           derbynet: "org.apache.derby:derbynet:$derbyVersion",
           postgres: "org.postgresql:postgresql:$postgresqlVersion",
           mysql_connector: "mysql:mysql-connector-java:$mysqlVersion",
           sqlite: "org.xerial:sqlite-jdbc:$sqliteVersion",
-          junit: "junit:junit:$junitVersion",
-          easymock: "org.easymock:easymock:$easyMockVersion",
-          mockito: "org.mockito:mockito-core:$mockitoVersion",
-          jmock: "org.jmock:jmock:$jmockVersion",
-          testng: "org.testng:testng:$testNgVersion",
-          xmlunit: "xmlunit:xmlunit:$xmlunitVersion"
   ]
 }
 


[18/50] [abbrv] zest-qi4j git commit: Merge branch 'develop' of github.com:Qi4j/qi4j-sdk into develop

Posted by ni...@apache.org.
Merge branch 'develop' of github.com:Qi4j/qi4j-sdk into develop


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/6ea04570
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/6ea04570
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/6ea04570

Branch: refs/heads/3.0
Commit: 6ea045707bc904286b3b795a396401bfac1698a5
Parents: ccab7ae d7af915
Author: Niclas Hedhman <ni...@hedhman.org>
Authored: Mon Aug 25 21:34:53 2014 +0800
Committer: Niclas Hedhman <ni...@hedhman.org>
Committed: Mon Aug 25 21:34:53 2014 +0800

----------------------------------------------------------------------
 build.gradle                                    |   4 +-
 .../bootstrap/builder/ApplicationBuilder.java   |   1 +
 .../runtime/composite/FragmentClassLoader.java  |  65 +++++--
 .../runtime/composite/TransientClassLoader.java |  34 ++--
 .../qi4j/runtime/composite/MapOverrideTest.java |  71 ++++----
 .../runtime/composite/TransientAsClassTest.java |  40 +++++
 .../hazelcast/HazelcastEntityStoreMixin.java    |   6 +-
 extensions/entitystore-jclouds/build.gradle     |   2 -
 .../jclouds/JCloudsMapEntityStoreMixin.java     | 175 ++++++++++---------
 .../mongodb/MongoEntityStoreConfiguration.java  |   2 -
 .../mongodb/MongoMapEntityStoreMixin.java       |  27 ++-
 .../jackson/JacksonValueDeserializer.java       |  16 +-
 .../jackson/JacksonValueSerializer.java         |   8 +-
 gradle/wrapper/gradle-wrapper.jar               | Bin 51106 -> 51348 bytes
 gradle/wrapper/gradle-wrapper.properties        |   4 +-
 libraries.gradle                                |  90 +++++-----
 16 files changed, 312 insertions(+), 233 deletions(-)
----------------------------------------------------------------------



[11/50] [abbrv] zest-qi4j git commit: JClouds EntityStore now use JClouds 1.7.3

Posted by ni...@apache.org.
JClouds EntityStore now use JClouds 1.7.3


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/b28f2c41
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/b28f2c41
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/b28f2c41

Branch: refs/heads/3.0
Commit: b28f2c41761aae92838571edb2d3a90425c60488
Parents: a4cf8c7
Author: Paul Merlin <pa...@nosphere.org>
Authored: Thu Jun 12 14:56:47 2014 +0200
Committer: Paul Merlin <pa...@nosphere.org>
Committed: Thu Jun 12 14:56:47 2014 +0200

----------------------------------------------------------------------
 extensions/entitystore-jclouds/build.gradle     |   2 -
 .../jclouds/JCloudsMapEntityStoreMixin.java     | 175 ++++++++++---------
 libraries.gradle                                |   4 +-
 3 files changed, 98 insertions(+), 83 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b28f2c41/extensions/entitystore-jclouds/build.gradle
----------------------------------------------------------------------
diff --git a/extensions/entitystore-jclouds/build.gradle b/extensions/entitystore-jclouds/build.gradle
index 7b5e1e9..413503b 100644
--- a/extensions/entitystore-jclouds/build.gradle
+++ b/extensions/entitystore-jclouds/build.gradle
@@ -6,13 +6,11 @@ dependencies {
 
     compile project( ":org.qi4j.core:org.qi4j.core.bootstrap" )
     compile project( ":org.qi4j.libraries:org.qi4j.library.locking" )
-    compile libraries.guava
     compile libraries.jclouds_core
     compile libraries.jclouds_blobstore
 
     testCompile project( ":org.qi4j.core:org.qi4j.core.testsupport" )
     testCompile(project(":org.qi4j.extensions:org.qi4j.extension.valueserialization-orgjson"))
-    testCompile libraries.jclouds_filesystem
 
     testRuntime project( ":org.qi4j.core:org.qi4j.core.runtime" )
     testRuntime libraries.logback

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b28f2c41/extensions/entitystore-jclouds/src/main/java/org/qi4j/entitystore/jclouds/JCloudsMapEntityStoreMixin.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-jclouds/src/main/java/org/qi4j/entitystore/jclouds/JCloudsMapEntityStoreMixin.java b/extensions/entitystore-jclouds/src/main/java/org/qi4j/entitystore/jclouds/JCloudsMapEntityStoreMixin.java
index 6b22463..c250dcd 100644
--- a/extensions/entitystore-jclouds/src/main/java/org/qi4j/entitystore/jclouds/JCloudsMapEntityStoreMixin.java
+++ b/extensions/entitystore-jclouds/src/main/java/org/qi4j/entitystore/jclouds/JCloudsMapEntityStoreMixin.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Paul Merlin. All Rights Reserved.
+ * Copyright (c) 2012-2014, Paul Merlin. All Rights Reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@ package org.qi4j.entitystore.jclouds;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Maps;
+import com.google.common.io.ByteSource;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
@@ -54,6 +55,7 @@ import org.qi4j.spi.entitystore.helpers.MapEntityStore;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static com.google.common.base.Charsets.UTF_8;
 import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.collect.Iterables.contains;
 import static org.qi4j.api.entity.EntityReference.parseEntityReference;
@@ -73,13 +75,19 @@ public class JCloudsMapEntityStoreMixin
 
     private static final Logger LOGGER = LoggerFactory.getLogger( "org.qi4j.entitystore.jclouds" );
 
-    private static final Map<String, ApiMetadata> allApis = Maps.uniqueIndex( Apis.viewableAs( BlobStoreContext.class ), Apis
-        .idFunction() );
+    private static final Map<String, ApiMetadata> allApis = Maps.uniqueIndex(
+        Apis.viewableAs( BlobStoreContext.class ),
+        Apis.idFunction()
+    );
 
-    private static final Map<String, ProviderMetadata> appProviders = Maps.uniqueIndex( Providers.viewableAs( BlobStoreContext.class ), Providers
-        .idFunction() );
+    private static final Map<String, ProviderMetadata> appProviders = Maps.uniqueIndex(
+        Providers.viewableAs( BlobStoreContext.class ),
+        Providers.idFunction()
+    );
 
-    private static final Set<String> allKeys = ImmutableSet.copyOf( Iterables.concat( appProviders.keySet(), allApis.keySet() ) );
+    private static final Set<String> allKeys = ImmutableSet.copyOf(
+        Iterables.concat( appProviders.keySet(), allApis.keySet() )
+    );
 
     @This
     private Configuration<JCloudsMapEntityStoreConfiguration> configuration;
@@ -165,9 +173,10 @@ public class JCloudsMapEntityStoreMixin
         {
             throw new EntityNotFoundException( entityReference );
         }
-        InputStream input = payload.getInput();
+        InputStream input = null;
         try
         {
+            input = payload.openStream();
             ByteArrayOutputStream baos = new ByteArrayOutputStream();
             Inputs.byteBuffer( input, 4096 ).transferTo( Outputs.byteBuffer( baos ) );
             return new StringReader( baos.toString( "UTF-8" ) );
@@ -178,12 +187,15 @@ public class JCloudsMapEntityStoreMixin
         }
         finally
         {
-            try
-            {
-                input.close();
-            }
-            catch( IOException ignored )
+            if( input != null )
             {
+                try
+                {
+                    input.close();
+                }
+                catch( IOException ignored )
+                {
+                }
             }
         }
     }
@@ -193,61 +205,63 @@ public class JCloudsMapEntityStoreMixin
         throws IOException
     {
         final BlobStore blobStore = storeContext.getBlobStore();
-
-        changes.visitMap( new MapChanger()
-        {
-
-            @Override
-            public Writer newEntity( final EntityReference ref, EntityDescriptor entityDescriptor )
-                throws IOException
+        changes.visitMap(
+            new MapChanger()
             {
-                return new StringWriter()
+                @Override
+                public Writer newEntity( final EntityReference ref, EntityDescriptor entityDescriptor )
+                    throws IOException
                 {
-
-                    @Override
-                    public void close()
-                        throws IOException
+                    return new StringWriter()
                     {
-                        super.close();
-                        Blob blob = blobStore.blobBuilder( ref.identity() ).payload( toString() ).build();
-                        blobStore.putBlob( container, blob );
-                    }
-                };
-            }
-
-            @Override
-            public Writer updateEntity( final EntityReference ref, EntityDescriptor entityDescriptor )
-                throws IOException
-            {
-                if( !blobStore.blobExists( container, ref.identity() ) )
-                {
-                    throw new EntityNotFoundException( ref );
+                        @Override
+                        public void close()
+                        throws IOException
+                        {
+                            super.close();
+                            Blob blob = blobStore.blobBuilder( ref.identity() )
+                                .payload( ByteSource.wrap( toString().getBytes( UTF_8 ) ) )
+                                .build();
+                            blobStore.putBlob( container, blob );
+                        }
+                    };
                 }
-                return new StringWriter()
-                {
 
-                    @Override
-                    public void close()
-                        throws IOException
+                @Override
+                public Writer updateEntity( final EntityReference ref, EntityDescriptor entityDescriptor )
+                    throws IOException
+                {
+                    if( !blobStore.blobExists( container, ref.identity() ) )
                     {
-                        super.close();
-                        Blob blob = blobStore.blobBuilder( ref.identity() ).payload( toString() ).build();
-                        blobStore.putBlob( container, blob );
+                        throw new EntityNotFoundException( ref );
                     }
-                };
-            }
+                    return new StringWriter()
+                    {
+                        @Override
+                        public void close()
+                        throws IOException
+                        {
+                            super.close();
+                            Blob blob = blobStore.blobBuilder( ref.identity() )
+                                .payload( ByteSource.wrap( toString().getBytes( UTF_8 ) ) )
+                                .build();
+                            blobStore.putBlob( container, blob );
+                        }
+                    };
+                }
 
-            @Override
-            public void removeEntity( EntityReference ref, EntityDescriptor entityDescriptor )
-                throws EntityNotFoundException
-            {
-                if( !blobStore.blobExists( container, ref.identity() ) )
+                @Override
+                public void removeEntity( EntityReference ref, EntityDescriptor entityDescriptor )
+                    throws EntityNotFoundException
                 {
-                    throw new EntityNotFoundException( ref );
+                    if( !blobStore.blobExists( container, ref.identity() ) )
+                    {
+                        throw new EntityNotFoundException( ref );
+                    }
+                    blobStore.removeBlob( container, ref.identity() );
                 }
-                blobStore.removeBlob( container, ref.identity() );
             }
-        } );
+        );
     }
 
     @Override
@@ -255,45 +269,48 @@ public class JCloudsMapEntityStoreMixin
     {
         return new Input<Reader, IOException>()
         {
-
             @Override
             public <ReceiverThrowableType extends Throwable> void transferTo( Output<? super Reader, ReceiverThrowableType> output )
                 throws IOException, ReceiverThrowableType
             {
-                output.receiveFrom( new Sender<Reader, IOException>()
-                {
-
-                    @Override
-                    public <ReceiverThrowableType extends Throwable> void sendTo( Receiver<? super Reader, ReceiverThrowableType> receiver )
-                        throws ReceiverThrowableType, IOException
+                output.receiveFrom(
+                    new Sender<Reader, IOException>()
                     {
-                        for( StorageMetadata stored : storeContext.getBlobStore().list() )
+                        @Override
+                        public <ReceiverThrowableType extends Throwable> void sendTo( Receiver<? super Reader, ReceiverThrowableType> receiver )
+                            throws ReceiverThrowableType, IOException
                         {
-                            Payload payload = storeContext.getBlobStore().getBlob( container, stored.getName() ).getPayload();
-                            if( payload == null )
-                            {
-                                throw new EntityNotFoundException( parseEntityReference( stored.getName() ) );
-                            }
-                            InputStream input = payload.getInput();
-                            try
-                            {
-                                receiver.receive( new InputStreamReader( input, "UTF-8" ) );
-                            }
-                            finally
+                            for( StorageMetadata stored : storeContext.getBlobStore().list() )
                             {
+                                Payload payload = storeContext.getBlobStore().getBlob( container, stored.getName() ).getPayload();
+                                if( payload == null )
+                                {
+                                    throw new EntityNotFoundException( parseEntityReference( stored.getName() ) );
+                                }
+                                InputStream input = null;
                                 try
                                 {
-                                    input.close();
+                                    input = payload.openStream();
+                                    receiver.receive( new InputStreamReader( input, "UTF-8" ) );
                                 }
-                                catch( IOException ignored )
+                                finally
                                 {
+                                    if( input != null )
+                                    {
+                                        try
+                                        {
+                                            input.close();
+                                        }
+                                        catch( IOException ignored )
+                                        {
+                                        }
+                                    }
                                 }
                             }
                         }
                     }
-                } );
+                );
             }
         };
     }
-
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b28f2c41/libraries.gradle
----------------------------------------------------------------------
diff --git a/libraries.gradle b/libraries.gradle
index f162e44..b2a3391a 100644
--- a/libraries.gradle
+++ b/libraries.gradle
@@ -23,7 +23,7 @@ def httpClientVersion = '4.2.2' // 4.3.4 exists
 def jacksonVersion = '2.4.0'
 def javascriptVersion = '1.7R4'
 def javasqlgeneratorVersion = '0.3.2'
-def jcloudsVersion = '1.7.0'
+def jcloudsVersion = '1.7.3'
 def jdbmVersion = '2.4'
 def jdomVersion = '2.0.2'
 def jedisVersion = '2.5.1'
@@ -208,7 +208,7 @@ rootProject.ext {
           h2: "com.h2database:h2:$h2Version",
           hazelcast: "com.hazelcast:hazelcast:$hazelcastVersion",
           jclouds_core: "org.apache.jclouds:jclouds-core:$jcloudsVersion",
-          jclouds_blobstore: "org.apache.jclouds:jclouds-blobstore:$jcloudsVersion",
+          jclouds_blobstore: "org.apache.jclouds:jclouds-allblobstore:$jcloudsVersion",
           jclouds_filesystem: "org.apache.jclouds.api:filesystem:$jcloudsVersion",
           jdbm: "jdbm:jdbm:$jdbmVersion",
           jedis: "redis.clients:jedis:$jedisVersion",


[17/50] [abbrv] zest-qi4j git commit: Merge branch 'master' of github.com:Qi4j/qi4j-sdk into develop

Posted by ni...@apache.org.
Merge branch 'master' of github.com:Qi4j/qi4j-sdk into develop


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/ccab7ae7
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/ccab7ae7
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/ccab7ae7

Branch: refs/heads/3.0
Commit: ccab7ae796f221fca468040ee14b3b6cee264b43
Parents: 116fa08 a675e78
Author: Niclas Hedhman <ni...@hedhman.org>
Authored: Mon Aug 25 21:34:20 2014 +0800
Committer: Niclas Hedhman <ni...@hedhman.org>
Committed: Mon Aug 25 21:34:20 2014 +0800

----------------------------------------------------------------------
 .../samples/cargo/app1/model/cargo/Cargo.java   | 201 +++++++++++++++++++
 .../niclas2/ConcernsOnPropertyTest.java         | 115 +++++++++++
 2 files changed, 316 insertions(+)
----------------------------------------------------------------------



[32/50] [abbrv] zest-qi4j git commit: Replaced Joda Time with Java 8 Time API.

Posted by ni...@apache.org.
http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/test/java/org/qi4j/sample/dcicargo/sample_a/context/shipping/booking/BuildDeliverySnapshotTest.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/test/java/org/qi4j/sample/dcicargo/sample_a/context/shipping/booking/BuildDeliverySnapshotTest.java b/samples/dci-cargo/dcisample_a/src/test/java/org/qi4j/sample/dcicargo/sample_a/context/shipping/booking/BuildDeliverySnapshotTest.java
index bb5c1e2..7b646cc 100644
--- a/samples/dci-cargo/dcisample_a/src/test/java/org/qi4j/sample/dcicargo/sample_a/context/shipping/booking/BuildDeliverySnapshotTest.java
+++ b/samples/dci-cargo/dcisample_a/src/test/java/org/qi4j/sample/dcicargo/sample_a/context/shipping/booking/BuildDeliverySnapshotTest.java
@@ -17,7 +17,8 @@
  */
 package org.qi4j.sample.dcicargo.sample_a.context.shipping.booking;
 
-import java.util.Date;
+import java.time.LocalTime;
+import java.time.ZonedDateTime;
 import org.junit.Before;
 import org.junit.Test;
 import org.qi4j.api.unitofwork.UnitOfWork;
@@ -37,9 +38,16 @@ import org.qi4j.sample.dcicargo.sample_a.data.shipping.itinerary.Itinerary;
 import org.qi4j.sample.dcicargo.sample_a.data.shipping.location.Location;
 import org.qi4j.sample.dcicargo.sample_a.data.shipping.voyage.Voyage;
 
-import static org.hamcrest.CoreMatchers.*;
-import static org.junit.Assert.*;
-import static org.qi4j.sample.dcicargo.sample_a.data.shipping.handling.HandlingEventType.*;
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.not;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+import static org.qi4j.sample.dcicargo.sample_a.data.shipping.handling.HandlingEventType.CLAIM;
+import static org.qi4j.sample.dcicargo.sample_a.data.shipping.handling.HandlingEventType.CUSTOMS;
+import static org.qi4j.sample.dcicargo.sample_a.data.shipping.handling.HandlingEventType.LOAD;
+import static org.qi4j.sample.dcicargo.sample_a.data.shipping.handling.HandlingEventType.UNLOAD;
 
 /**
  * Tests of the Build Delivery Snapshot subfunction use case.
@@ -53,9 +61,9 @@ import static org.qi4j.sample.dcicargo.sample_a.data.shipping.handling.HandlingE
  * FIXME: Test methods call each other to allow ordered execution, ie. tests are not indepedants !
  */
 public class BuildDeliverySnapshotTest
-      extends TestApplication
+    extends TestApplication
 {
-    final Date TODAY = new Date();
+    final ZonedDateTime TODAY = ZonedDateTime.now().with( LocalTime.MIDNIGHT );
 
     private Location HONGKONG;
     private Location STOCKHOLM;
@@ -105,51 +113,55 @@ public class BuildDeliverySnapshotTest
             leg( V200T, NEWYORK, DALLAS, day( 9 ), day( 12 ) ),
             leg( V300A, DALLAS, STOCKHOLM, day( 13 ), day( 16 ) )
         );
-
-
     }
 
     // DERIVE WITH ROUTE SPECIFICATION ==============================================================================
 
-    @Test( expected = RouteException.class )
-    public void deviation_2a_InvalidRouteSpecification_sameLocations() throws Exception
+    @Test(expected = RouteException.class)
+    public void deviation_2a_InvalidRouteSpecification_sameLocations()
+        throws Exception
     {
         RouteSpecification routeSpec = routeSpecification( HONGKONG, HONGKONG, day( 20 ) );
         new BuildDeliverySnapshot( routeSpec ).get();
     }
 
-    @Test( expected = RouteException.class )
-    public void deviation_2b_InvalidRouteSpecification_tooEarlyDeadline() throws Exception
+    @Test(expected = RouteException.class)
+    public void deviation_2b_InvalidRouteSpecification_tooEarlyDeadline()
+        throws Exception
     {
         RouteSpecification routeSpec = routeSpecification( HONGKONG, STOCKHOLM, TODAY );
         new BuildDeliverySnapshot( routeSpec ).get();
     }
 
     @Test
-    public void deviation_2c_ItineraryIsUnknown_buildFromRouteSpecification() throws Exception
+    public void deviation_2c_ItineraryIsUnknown_buildFromRouteSpecification()
+        throws Exception
     {
         RouteSpecification routeSpec = routeSpecification( HONGKONG, STOCKHOLM, day( 20 ) );
         Delivery delivery = new BuildDeliverySnapshot( routeSpec ).get();
 
-        assertThat( delivery.timestamp().get().after( TODAY ), is( equalTo( true ) ) ); // TODAY is set first
-        assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.NOT_ROUTED ) ) );
-        assertThat( delivery.transportStatus().get(), is( equalTo( TransportStatus.NOT_RECEIVED ) ) );
-        assertThat( delivery.nextExpectedHandlingEvent().get().handlingEventType().get(), is( equalTo( HandlingEventType.RECEIVE ) ) );
-        assertThat( delivery.nextExpectedHandlingEvent().get().location().get(), is( equalTo( HONGKONG ) ) );
-        assertThat( delivery.nextExpectedHandlingEvent().get().voyage().get(), is( equalTo( null ) ) );
-        assertThat( delivery.lastHandlingEvent().get(), is( equalTo( null ) ) );
-        assertThat( delivery.lastKnownLocation().get(), is( equalTo( null ) ) );
-        assertThat( delivery.currentVoyage().get(), is( equalTo( null ) ) );
-        assertThat( delivery.eta().get(), is( equalTo( null ) ) );
-        assertThat( delivery.isMisdirected().get(), is( equalTo( false ) ) );
-        assertThat( delivery.isUnloadedAtDestination().get(), is( equalTo( false ) ) );
+        assertThat( delivery.timestamp().get().isAfter( TODAY.toInstant() ), equalTo( true ) ); // TODAY is set first
+        assertThat( delivery.routingStatus().get(), equalTo( RoutingStatus.NOT_ROUTED ) );
+        assertThat( delivery.transportStatus().get(), equalTo( TransportStatus.NOT_RECEIVED ) );
+        assertThat( delivery.nextExpectedHandlingEvent()
+                        .get()
+                        .handlingEventType()
+                        .get(), equalTo( HandlingEventType.RECEIVE ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get().location().get(), equalTo( HONGKONG ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get().voyage().get(), nullValue() );
+        assertThat( delivery.lastHandlingEvent().get(), nullValue() );
+        assertThat( delivery.lastKnownLocation().get(), nullValue() );
+        assertThat( delivery.currentVoyage().get(), nullValue() );
+        assertThat( delivery.eta().get(), nullValue() );
+        assertThat( delivery.isMisdirected().get(), equalTo( false ) );
+        assertThat( delivery.isUnloadedAtDestination().get(), equalTo( false ) );
     }
 
-
     // DERIVE WITH NON-ROUTED CARGO ==============================================================================
 
     @Test
-    public void deviation_2c_ItineraryIsUnknown_buildFromNonRoutedCargo() throws Exception
+    public void deviation_2c_ItineraryIsUnknown_buildFromNonRoutedCargo()
+        throws Exception
     {
         deviation_2c_ItineraryIsUnknown_buildFromRouteSpecification();
 
@@ -160,25 +172,28 @@ public class BuildDeliverySnapshotTest
         Cargo cargo = CARGOS.createCargo( routeSpec, delivery, "ABCD" );
 
         // Same as previous test (just build from cargo instead)
-        assertThat( delivery.timestamp().get().after( TODAY ), is( equalTo( true ) ) ); // TODAY is set first
-        assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.NOT_ROUTED ) ) );
-        assertThat( delivery.transportStatus().get(), is( equalTo( TransportStatus.NOT_RECEIVED ) ) );
-        assertThat( delivery.nextExpectedHandlingEvent().get().handlingEventType().get(), is( equalTo( HandlingEventType.RECEIVE ) ) );
-        assertThat( delivery.nextExpectedHandlingEvent().get().location().get(), is( equalTo( HONGKONG ) ) );
-        assertThat( delivery.nextExpectedHandlingEvent().get().voyage().get(), is( equalTo( null ) ) );
-        assertThat( delivery.lastHandlingEvent().get(), is( equalTo( null ) ) );
-        assertThat( delivery.lastKnownLocation().get(), is( equalTo( null ) ) );
-        assertThat( delivery.currentVoyage().get(), is( equalTo( null ) ) );
-        assertThat( delivery.eta().get(), is( equalTo( null ) ) );
-        assertThat( delivery.isMisdirected().get(), is( equalTo( false ) ) );
-        assertThat( delivery.isUnloadedAtDestination().get(), is( equalTo( false ) ) );
+        assertThat( delivery.timestamp().get().isAfter( TODAY.toInstant() ), equalTo( true ) ); // TODAY is set first
+        assertThat( delivery.routingStatus().get(), equalTo( RoutingStatus.NOT_ROUTED ) );
+        assertThat( delivery.transportStatus().get(), equalTo( TransportStatus.NOT_RECEIVED ) );
+        assertThat( delivery.nextExpectedHandlingEvent()
+                        .get()
+                        .handlingEventType()
+                        .get(), equalTo( HandlingEventType.RECEIVE ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get().location().get(), equalTo( HONGKONG ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get().voyage().get(), nullValue() );
+        assertThat( delivery.lastHandlingEvent().get(), nullValue() );
+        assertThat( delivery.lastKnownLocation().get(), nullValue() );
+        assertThat( delivery.currentVoyage().get(), nullValue() );
+        assertThat( delivery.eta().get(), nullValue() );
+        assertThat( delivery.isMisdirected().get(), equalTo( false ) );
+        assertThat( delivery.isUnloadedAtDestination().get(), equalTo( false ) );
     }
 
-
     // DERIVE WITH ROUTE SPECIFICATION + ITINERARY (Routed cargo) ==============================================
 
     @Test
-    public void deviation_2d_UnsatisfyingItinerary_wrongOrigin() throws Exception
+    public void deviation_2d_UnsatisfyingItinerary_wrongOrigin()
+        throws Exception
     {
         deviation_2c_ItineraryIsUnknown_buildFromNonRoutedCargo();
 
@@ -195,12 +210,13 @@ public class BuildDeliverySnapshotTest
         Delivery delivery = new BuildDeliverySnapshot( cargo ).get();
 
         // Route specification not satisfied by itinerary
-        assertThat( itinerary.firstLeg().loadLocation().get(), is( not( equalTo( routeSpec.origin().get() ) ) ) );
-        assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.MISROUTED ) ) );
+        assertThat( itinerary.firstLeg().loadLocation().get(), not( equalTo( routeSpec.origin().get() ) ) );
+        assertThat( delivery.routingStatus().get(), equalTo( RoutingStatus.MISROUTED ) );
     }
 
     @Test
-    public void deviation_2d_UnsatisfyingItinerary_wrongDestination() throws Exception
+    public void deviation_2d_UnsatisfyingItinerary_wrongDestination()
+        throws Exception
     {
         deviation_2d_UnsatisfyingItinerary_wrongOrigin();
 
@@ -210,12 +226,13 @@ public class BuildDeliverySnapshotTest
         Delivery delivery = new BuildDeliverySnapshot( cargo ).get();
 
         // Route specification not satisfied by itinerary
-        assertThat( itinerary.lastLeg().unloadLocation().get(), is( not( equalTo( routeSpec.destination().get() ) ) ) );
-        assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.MISROUTED ) ) );
+        assertThat( itinerary.lastLeg().unloadLocation().get(), not( equalTo( routeSpec.destination().get() ) ) );
+        assertThat( delivery.routingStatus().get(), equalTo( RoutingStatus.MISROUTED ) );
     }
 
     @Test
-    public void deviation_2d_UnsatisfyingItinerary_missedDeadline() throws Exception
+    public void deviation_2d_UnsatisfyingItinerary_missedDeadline()
+        throws Exception
     {
         deviation_2d_UnsatisfyingItinerary_wrongDestination();
 
@@ -225,46 +242,50 @@ public class BuildDeliverySnapshotTest
         Delivery delivery = new BuildDeliverySnapshot( cargo ).get();
 
         // Route specification not satisfied by itinerary
-        assertFalse( routeSpec.arrivalDeadline().get().after( itinerary.finalArrivalDate() ) );
-        assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.MISROUTED ) ) );
+        assertFalse( routeSpec.arrivalDeadline().get().isAfter( itinerary.finalArrivalDate() ) );
+        assertThat( delivery.routingStatus().get(), equalTo( RoutingStatus.MISROUTED ) );
     }
 
     @Test
-    public void deviation_3a_CargoHasNoHandlingHistory() throws Exception
+    public void deviation_3a_CargoHasNoHandlingHistory()
+        throws Exception
     {
         deviation_2d_UnsatisfyingItinerary_missedDeadline();
 
-        Date arrival = day( 16 );
-        Date deadline = day( 20 );
+        ZonedDateTime arrival = day( 16 );
+        ZonedDateTime deadline = day( 20 );
         // Itinerary will satisfy route specification
         RouteSpecification routeSpec = routeSpecification( HONGKONG, STOCKHOLM, deadline );
         cargo.routeSpecification().set( routeSpec );
         Delivery delivery = new BuildDeliverySnapshot( cargo ).get();
 
         // Route specification satisfied by itinerary
-        assertThat( itinerary.firstLeg().loadLocation().get(), is( equalTo( routeSpec.origin().get() ) ) );
-        assertThat( itinerary.lastLeg().unloadLocation().get(), is( equalTo( routeSpec.destination().get() ) ) );
-        assertTrue( routeSpec.arrivalDeadline().get().after( itinerary.finalArrivalDate() ) );
-        assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.ROUTED ) ) );
-
-        assertThat( delivery.timestamp().get().after( TODAY ), is( equalTo( true ) ) ); // TODAY is set first
-        assertThat( delivery.transportStatus().get(), is( equalTo( TransportStatus.NOT_RECEIVED ) ) );
-        assertThat( delivery.nextExpectedHandlingEvent().get().handlingEventType().get(), is( equalTo( HandlingEventType.RECEIVE ) ) );
-        assertThat( delivery.nextExpectedHandlingEvent().get().location().get(), is( equalTo( HONGKONG ) ) );
-        assertThat( delivery.nextExpectedHandlingEvent().get().voyage().get(), is( equalTo( null ) ) );
-        assertThat( delivery.lastHandlingEvent().get(), is( equalTo( null ) ) );
-        assertThat( delivery.lastKnownLocation().get(), is( equalTo( null ) ) );
-        assertThat( delivery.currentVoyage().get(), is( equalTo( null ) ) );
-        assertThat( delivery.eta().get(), is( equalTo( arrival ) ) );
-        assertThat( delivery.isMisdirected().get(), is( equalTo( false ) ) );
-        assertThat( delivery.isUnloadedAtDestination().get(), is( equalTo( false ) ) );
+        assertThat( itinerary.firstLeg().loadLocation().get(), equalTo( routeSpec.origin().get() ) );
+        assertThat( itinerary.lastLeg().unloadLocation().get(), equalTo( routeSpec.destination().get() ) );
+        assertTrue( routeSpec.arrivalDeadline().get().isAfter( itinerary.finalArrivalDate() ) );
+        assertThat( delivery.routingStatus().get(), equalTo( RoutingStatus.ROUTED ) );
+
+        assertThat( delivery.timestamp().get().isAfter( TODAY.toInstant() ), equalTo( true ) ); // TODAY is set first
+        assertThat( delivery.transportStatus().get(), equalTo( TransportStatus.NOT_RECEIVED ) );
+        assertThat( delivery.nextExpectedHandlingEvent()
+                        .get()
+                        .handlingEventType()
+                        .get(), equalTo( HandlingEventType.RECEIVE ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get().location().get(), equalTo( HONGKONG ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get().voyage().get(), nullValue() );
+        assertThat( delivery.lastHandlingEvent().get(), nullValue() );
+        assertThat( delivery.lastKnownLocation().get(), nullValue() );
+        assertThat( delivery.currentVoyage().get(), nullValue() );
+        assertThat( delivery.eta().get(), equalTo( arrival ) );
+        assertThat( delivery.isMisdirected().get(), equalTo( false ) );
+        assertThat( delivery.isUnloadedAtDestination().get(), equalTo( false ) );
     }
 
-
     // DERIVE WITH ROUTE SPECIFICATION + ITINERARY + LAST HANDLING EVENT ============================================
 
     @Test
-    public void deviation_4a_RECEIVE_1a_UnexpectedPort() throws Exception
+    public void deviation_4a_RECEIVE_1a_UnexpectedPort()
+        throws Exception
     {
         deviation_3a_CargoHasNoHandlingHistory();
 
@@ -275,22 +296,23 @@ public class BuildDeliverySnapshotTest
         Delivery delivery = new BuildDeliverySnapshot( cargo, handlingEvent ).get();
 
         // We don't know what's next for a misdirected cargo
-        assertThat( delivery.isMisdirected().get(), is( equalTo( true ) ) );
-        assertThat( delivery.nextExpectedHandlingEvent().get(), is( equalTo( null ) ) );
-        assertThat( delivery.eta().get(), is( equalTo( null ) ) );
+        assertThat( delivery.isMisdirected().get(), equalTo( true ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get(), nullValue() );
+        assertThat( delivery.eta().get(), nullValue() );
 
-        assertThat( delivery.transportStatus().get(), is( equalTo( TransportStatus.IN_PORT ) ) );
-        assertThat( delivery.lastHandlingEvent().get(), is( equalTo( handlingEvent ) ) );
-        assertThat( delivery.lastKnownLocation().get(), is( equalTo( SHANGHAI ) ) );
+        assertThat( delivery.transportStatus().get(), equalTo( TransportStatus.IN_PORT ) );
+        assertThat( delivery.lastHandlingEvent().get(), equalTo( handlingEvent ) );
+        assertThat( delivery.lastKnownLocation().get(), equalTo( SHANGHAI ) );
 
         // Cargo is still routed - but it should be re-routed according to new (unexpected) location.
-        assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.ROUTED ) ) );
-        assertThat( delivery.currentVoyage().get(), is( equalTo( null ) ) );
-        assertThat( delivery.isUnloadedAtDestination().get(), is( equalTo( false ) ) );
+        assertThat( delivery.routingStatus().get(), equalTo( RoutingStatus.ROUTED ) );
+        assertThat( delivery.currentVoyage().get(), nullValue() );
+        assertThat( delivery.isUnloadedAtDestination().get(), equalTo( false ) );
     }
 
     @Test
-    public void deviation_4a_RECEIVE_1b_ExpectedPort() throws Exception
+    public void deviation_4a_RECEIVE_1b_ExpectedPort()
+        throws Exception
     {
         deviation_4a_RECEIVE_1a_UnexpectedPort();
 
@@ -300,21 +322,21 @@ public class BuildDeliverySnapshotTest
         HandlingEvent handlingEvent = HANDLING_EVENTS.createHandlingEvent( day( 1 ), day( 1 ), trackingId, HandlingEventType.RECEIVE, HONGKONG, null );
         Delivery delivery = new BuildDeliverySnapshot( cargo, handlingEvent ).get();
 
-        assertThat( delivery.isMisdirected().get(), is( equalTo( false ) ) );
-        assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.ROUTED ) ) );
-        assertThat( delivery.transportStatus().get(), is( equalTo( TransportStatus.IN_PORT ) ) );
-        assertThat( delivery.lastHandlingEvent().get(), is( equalTo( handlingEvent ) ) );
-        assertThat( delivery.lastKnownLocation().get(), is( equalTo( HONGKONG ) ) );
+        assertThat( delivery.isMisdirected().get(), equalTo( false ) );
+        assertThat( delivery.routingStatus().get(), equalTo( RoutingStatus.ROUTED ) );
+        assertThat( delivery.transportStatus().get(), equalTo( TransportStatus.IN_PORT ) );
+        assertThat( delivery.lastHandlingEvent().get(), equalTo( handlingEvent ) );
+        assertThat( delivery.lastKnownLocation().get(), equalTo( HONGKONG ) );
 
         // We expect the cargo to be loaded on voyage V100S in Hong Kong
-        assertThat( delivery.nextExpectedHandlingEvent().get().handlingEventType().get(), is( equalTo( LOAD ) ) );
-        assertThat( delivery.nextExpectedHandlingEvent().get().location().get(), is( equalTo( HONGKONG ) ) );
-        assertThat( delivery.nextExpectedHandlingEvent().get().voyage().get(), is( equalTo( V100S ) ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get().handlingEventType().get(), equalTo( LOAD ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get().location().get(), equalTo( HONGKONG ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get().voyage().get(), equalTo( V100S ) );
     }
 
-
     @Test
-    public void deviation_4b_LOAD_2a_UnexpectedPort() throws Exception
+    public void deviation_4b_LOAD_2a_UnexpectedPort()
+        throws Exception
     {
         deviation_4a_RECEIVE_1b_ExpectedPort();
 
@@ -324,19 +346,20 @@ public class BuildDeliverySnapshotTest
         HandlingEvent handlingEvent = HANDLING_EVENTS.createHandlingEvent( day( 1 ), day( 1 ), trackingId, LOAD, TOKYO, V100S );
         Delivery delivery = new BuildDeliverySnapshot( cargo, handlingEvent ).get();
 
-        assertThat( delivery.isMisdirected().get(), is( equalTo( true ) ) );
-        assertThat( delivery.nextExpectedHandlingEvent().get(), is( equalTo( null ) ) );
-        assertThat( delivery.eta().get(), is( equalTo( null ) ) );
+        assertThat( delivery.isMisdirected().get(), equalTo( true ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get(), nullValue() );
+        assertThat( delivery.eta().get(), nullValue() );
 
-        assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.ROUTED ) ) );
-        assertThat( delivery.transportStatus().get(), is( equalTo( TransportStatus.ONBOARD_CARRIER ) ) );
-        assertThat( delivery.lastHandlingEvent().get(), is( equalTo( handlingEvent ) ) );
-        assertThat( delivery.lastKnownLocation().get(), is( equalTo( TOKYO ) ) );
-        assertThat( delivery.currentVoyage().get(), is( equalTo( V100S ) ) );
+        assertThat( delivery.routingStatus().get(), equalTo( RoutingStatus.ROUTED ) );
+        assertThat( delivery.transportStatus().get(), equalTo( TransportStatus.ONBOARD_CARRIER ) );
+        assertThat( delivery.lastHandlingEvent().get(), equalTo( handlingEvent ) );
+        assertThat( delivery.lastKnownLocation().get(), equalTo( TOKYO ) );
+        assertThat( delivery.currentVoyage().get(), equalTo( V100S ) );
     }
 
     @Test
-    public void deviation_4b_LOAD_2b_ExpectedPort() throws Exception
+    public void deviation_4b_LOAD_2b_ExpectedPort()
+        throws Exception
     {
         deviation_4b_LOAD_2a_UnexpectedPort();
 
@@ -346,21 +369,22 @@ public class BuildDeliverySnapshotTest
         HandlingEvent handlingEvent = HANDLING_EVENTS.createHandlingEvent( day( 1 ), day( 1 ), trackingId, LOAD, HONGKONG, V100S );
         Delivery delivery = new BuildDeliverySnapshot( cargo, handlingEvent ).get();
 
-        assertThat( delivery.isMisdirected().get(), is( equalTo( false ) ) );
-        assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.ROUTED ) ) );
-        assertThat( delivery.transportStatus().get(), is( equalTo( TransportStatus.ONBOARD_CARRIER ) ) );
-        assertThat( delivery.lastHandlingEvent().get(), is( equalTo( handlingEvent ) ) );
-        assertThat( delivery.lastKnownLocation().get(), is( equalTo( HONGKONG ) ) );
-        assertThat( delivery.currentVoyage().get(), is( equalTo( V100S ) ) );
+        assertThat( delivery.isMisdirected().get(), equalTo( false ) );
+        assertThat( delivery.routingStatus().get(), equalTo( RoutingStatus.ROUTED ) );
+        assertThat( delivery.transportStatus().get(), equalTo( TransportStatus.ONBOARD_CARRIER ) );
+        assertThat( delivery.lastHandlingEvent().get(), equalTo( handlingEvent ) );
+        assertThat( delivery.lastKnownLocation().get(), equalTo( HONGKONG ) );
+        assertThat( delivery.currentVoyage().get(), equalTo( V100S ) );
 
         // We expect the cargo to be unloaded from voyage V100S in New York
-        assertThat( delivery.nextExpectedHandlingEvent().get().handlingEventType().get(), is( equalTo( UNLOAD ) ) );
-        assertThat( delivery.nextExpectedHandlingEvent().get().location().get(), is( equalTo( NEWYORK ) ) );
-        assertThat( delivery.nextExpectedHandlingEvent().get().voyage().get(), is( equalTo( V100S ) ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get().handlingEventType().get(), equalTo( UNLOAD ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get().location().get(), equalTo( NEWYORK ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get().voyage().get(), equalTo( V100S ) );
     }
 
     @Test
-    public void deviation_4b_LOAD_2c_UnexpectedVoyageNotFromItinerary() throws Exception
+    public void deviation_4b_LOAD_2c_UnexpectedVoyageNotFromItinerary()
+        throws Exception
     {
         deviation_4b_LOAD_2b_ExpectedPort();
 
@@ -370,19 +394,20 @@ public class BuildDeliverySnapshotTest
         HandlingEvent handlingEvent = HANDLING_EVENTS.createHandlingEvent( day( 1 ), day( 1 ), trackingId, LOAD, HONGKONG, V400S );
         Delivery delivery = new BuildDeliverySnapshot( cargo, handlingEvent ).get();
 
-        assertThat( delivery.isMisdirected().get(), is( equalTo( true ) ) );
-        assertThat( delivery.nextExpectedHandlingEvent().get(), is( equalTo( null ) ) );
-        assertThat( delivery.eta().get(), is( equalTo( null ) ) );
+        assertThat( delivery.isMisdirected().get(), equalTo( true ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get(), nullValue() );
+        assertThat( delivery.eta().get(), nullValue() );
 
-        assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.ROUTED ) ) );
-        assertThat( delivery.transportStatus().get(), is( equalTo( TransportStatus.ONBOARD_CARRIER ) ) );
-        assertThat( delivery.lastHandlingEvent().get(), is( equalTo( handlingEvent ) ) );
-        assertThat( delivery.lastKnownLocation().get(), is( equalTo( HONGKONG ) ) );
-        assertThat( delivery.currentVoyage().get(), is( equalTo( V400S ) ) );
+        assertThat( delivery.routingStatus().get(), equalTo( RoutingStatus.ROUTED ) );
+        assertThat( delivery.transportStatus().get(), equalTo( TransportStatus.ONBOARD_CARRIER ) );
+        assertThat( delivery.lastHandlingEvent().get(), equalTo( handlingEvent ) );
+        assertThat( delivery.lastKnownLocation().get(), equalTo( HONGKONG ) );
+        assertThat( delivery.currentVoyage().get(), equalTo( V400S ) );
     }
 
     @Test
-    public void deviation_4b_LOAD_2c_ExpectedButLaterVoyageInItinerary() throws Exception
+    public void deviation_4b_LOAD_2c_ExpectedButLaterVoyageInItinerary()
+        throws Exception
     {
         deviation_4b_LOAD_2c_UnexpectedVoyageNotFromItinerary();
 
@@ -395,23 +420,23 @@ public class BuildDeliverySnapshotTest
         Delivery delivery = new BuildDeliverySnapshot( cargo, handlingEvent ).get();
 
         // Should have been true, but we accept it for now...
-        assertThat( delivery.isMisdirected().get(), is( equalTo( false ) ) );
+        assertThat( delivery.isMisdirected().get(), equalTo( false ) );
 
-        assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.ROUTED ) ) );
-        assertThat( delivery.transportStatus().get(), is( equalTo( TransportStatus.ONBOARD_CARRIER ) ) );
-        assertThat( delivery.lastHandlingEvent().get(), is( equalTo( handlingEvent ) ) );
-        assertThat( delivery.lastKnownLocation().get(), is( equalTo( NEWYORK ) ) );
-        assertThat( delivery.currentVoyage().get(), is( equalTo( V200T ) ) );
+        assertThat( delivery.routingStatus().get(), equalTo( RoutingStatus.ROUTED ) );
+        assertThat( delivery.transportStatus().get(), equalTo( TransportStatus.ONBOARD_CARRIER ) );
+        assertThat( delivery.lastHandlingEvent().get(), equalTo( handlingEvent ) );
+        assertThat( delivery.lastKnownLocation().get(), equalTo( NEWYORK ) );
+        assertThat( delivery.currentVoyage().get(), equalTo( V200T ) );
 
         // We expect the cargo to be unloaded from voyage V200T in Dallas
-        assertThat( delivery.nextExpectedHandlingEvent().get().handlingEventType().get(), is( equalTo( UNLOAD ) ) );
-        assertThat( delivery.nextExpectedHandlingEvent().get().location().get(), is( equalTo( DALLAS ) ) );
-        assertThat( delivery.nextExpectedHandlingEvent().get().voyage().get(), is( equalTo( V200T ) ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get().handlingEventType().get(), equalTo( UNLOAD ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get().location().get(), equalTo( DALLAS ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get().voyage().get(), equalTo( V200T ) );
     }
 
-
     @Test
-    public void deviation_4c_UNLOAD_1a_UnexpectedPort() throws Exception
+    public void deviation_4c_UNLOAD_1a_UnexpectedPort()
+        throws Exception
     {
         deviation_4b_LOAD_2c_ExpectedButLaterVoyageInItinerary();
 
@@ -423,18 +448,18 @@ public class BuildDeliverySnapshotTest
         Delivery delivery = new BuildDeliverySnapshot( cargo, handlingEvent ).get();
         cargo.delivery().set( delivery );
 
-        assertThat( delivery.isMisdirected().get(), is( equalTo( true ) ) );
-        assertThat( delivery.nextExpectedHandlingEvent().get(), is( equalTo( null ) ) );
-        assertThat( delivery.eta().get(), is( equalTo( null ) ) );
+        assertThat( delivery.isMisdirected().get(), equalTo( true ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get(), nullValue() );
+        assertThat( delivery.eta().get(), nullValue() );
 
-        assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.ROUTED ) ) );
-        assertThat( delivery.transportStatus().get(), is( equalTo( TransportStatus.IN_PORT ) ) );
-        assertThat( delivery.lastHandlingEvent().get(), is( equalTo( handlingEvent ) ) );
-        assertThat( delivery.lastHandlingEvent().get().handlingEventType().get(), is( equalTo( UNLOAD ) ) );
-        assertThat( delivery.lastHandlingEvent().get().voyage().get(), is( equalTo( V100S ) ) );
-        assertThat( delivery.lastKnownLocation().get(), is( equalTo( TOKYO ) ) );
-        assertThat( delivery.currentVoyage().get(), is( equalTo( null ) ) );
-        assertThat( delivery.isUnloadedAtDestination().get(), is( equalTo( false ) ) );
+        assertThat( delivery.routingStatus().get(), equalTo( RoutingStatus.ROUTED ) );
+        assertThat( delivery.transportStatus().get(), equalTo( TransportStatus.IN_PORT ) );
+        assertThat( delivery.lastHandlingEvent().get(), equalTo( handlingEvent ) );
+        assertThat( delivery.lastHandlingEvent().get().handlingEventType().get(), equalTo( UNLOAD ) );
+        assertThat( delivery.lastHandlingEvent().get().voyage().get(), equalTo( V100S ) );
+        assertThat( delivery.lastKnownLocation().get(), equalTo( TOKYO ) );
+        assertThat( delivery.currentVoyage().get(), nullValue() );
+        assertThat( delivery.isUnloadedAtDestination().get(), equalTo( false ) );
 
         // Cargo needs to be rerouted
 
@@ -445,34 +470,34 @@ public class BuildDeliverySnapshotTest
         cargo.delivery().set( delivery );
 
         // Old itinerary will not satisfy new route specification
-        assertThat( itinerary.firstLeg().loadLocation().get(), is( not( equalTo( routeSpec.origin().get() ) ) ) );
-        assertThat( itinerary.lastLeg().unloadLocation().get(), is( equalTo( routeSpec.destination().get() ) ) );
-        assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.MISROUTED ) ) );
+        assertThat( itinerary.firstLeg().loadLocation().get(), not( equalTo( routeSpec.origin().get() ) ) );
+        assertThat( itinerary.lastLeg().unloadLocation().get(), equalTo( routeSpec.destination().get() ) );
+        assertThat( delivery.routingStatus().get(), equalTo( RoutingStatus.MISROUTED ) );
 
         // Old planned arrival time is still satisfying new deadline
-        assertTrue( routeSpec.arrivalDeadline().get().after( itinerary.finalArrivalDate() ) );
+        assertTrue( routeSpec.arrivalDeadline().get().isAfter( itinerary.finalArrivalDate() ) );
 
         // We don't know what's next before a new itinerary has been chosen
-        assertThat( delivery.nextExpectedHandlingEvent().get(), is( equalTo( null ) ) );
-        assertThat( delivery.eta().get(), is( equalTo( null ) ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get(), equalTo( null ) );
+        assertThat( delivery.eta().get(), equalTo( null ) );
 
         // Cargo is still misdirected (in unexpected location) according to old itinerary
-        assertThat( delivery.isMisdirected().get(), is( equalTo( true ) ) );
+        assertThat( delivery.isMisdirected().get(), equalTo( true ) );
 
         // Last known data
-        assertThat( delivery.transportStatus().get(), is( equalTo( TransportStatus.IN_PORT ) ) );
-        assertThat( delivery.lastHandlingEvent().get(), is( equalTo( handlingEvent ) ) );
-        assertThat( delivery.lastHandlingEvent().get().handlingEventType().get(), is( equalTo( UNLOAD ) ) );
-        assertThat( delivery.lastHandlingEvent().get().voyage().get(), is( equalTo( V100S ) ) );
-        assertThat( delivery.lastKnownLocation().get(), is( equalTo( TOKYO ) ) );
-        assertThat( delivery.currentVoyage().get(), is( equalTo( null ) ) );
-        assertThat( delivery.isUnloadedAtDestination().get(), is( equalTo( false ) ) );
+        assertThat( delivery.transportStatus().get(), equalTo( TransportStatus.IN_PORT ) );
+        assertThat( delivery.lastHandlingEvent().get(), equalTo( handlingEvent ) );
+        assertThat( delivery.lastHandlingEvent().get().handlingEventType().get(), equalTo( UNLOAD ) );
+        assertThat( delivery.lastHandlingEvent().get().voyage().get(), equalTo( V100S ) );
+        assertThat( delivery.lastKnownLocation().get(), equalTo( TOKYO ) );
+        assertThat( delivery.currentVoyage().get(), equalTo( null ) );
+        assertThat( delivery.isUnloadedAtDestination().get(), equalTo( false ) );
 
         // New itinerary that satisfy the new route specification. New origin departure from Tokyo.
-        Date arrival= day( 19 );
+        ZonedDateTime arrival = day( 19 );
         itinerary = itinerary(
-              leg( V400S, TOKYO, HAMBURG, day( 9 ), day( 16 ) ),
-              leg( V500S, HAMBURG, STOCKHOLM, day( 17 ), arrival  )
+            leg( V400S, TOKYO, HAMBURG, day( 9 ), day( 16 ) ),
+            leg( V500S, HAMBURG, STOCKHOLM, day( 17 ), arrival )
         );
 
         // Customer reroutes cargo. This is a possible step in the cargo booking process.
@@ -480,31 +505,32 @@ public class BuildDeliverySnapshotTest
         delivery = cargo.delivery().get();
 
         // Cargo is on track again
-        assertThat( delivery.isMisdirected().get(), is( equalTo( false ) ) );
-        assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.ROUTED ) ) );
-        assertThat( delivery.transportStatus().get(), is( equalTo( TransportStatus.IN_PORT ) ) );
-        assertThat( delivery.lastHandlingEvent().get(), is( equalTo( handlingEvent ) ) );
-        assertThat( delivery.lastHandlingEvent().get().handlingEventType().get(), is( equalTo( UNLOAD ) ) );
-        assertThat( delivery.lastHandlingEvent().get().voyage().get(), is( equalTo( V100S ) ) );
-        assertThat( delivery.lastKnownLocation().get(), is( equalTo( TOKYO ) ) );
-        assertThat( delivery.currentVoyage().get(), is( equalTo( null ) ) );
-        assertThat( delivery.eta().get(), is( equalTo( arrival ) ) );
-        assertThat( delivery.isUnloadedAtDestination().get(), is( equalTo( false ) ) );
+        assertThat( delivery.isMisdirected().get(), equalTo( false ) );
+        assertThat( delivery.routingStatus().get(), equalTo( RoutingStatus.ROUTED ) );
+        assertThat( delivery.transportStatus().get(), equalTo( TransportStatus.IN_PORT ) );
+        assertThat( delivery.lastHandlingEvent().get(), equalTo( handlingEvent ) );
+        assertThat( delivery.lastHandlingEvent().get().handlingEventType().get(), equalTo( UNLOAD ) );
+        assertThat( delivery.lastHandlingEvent().get().voyage().get(), equalTo( V100S ) );
+        assertThat( delivery.lastKnownLocation().get(), equalTo( TOKYO ) );
+        assertThat( delivery.currentVoyage().get(), equalTo( null ) );
+        assertThat( delivery.eta().get(), equalTo( arrival ) );
+        assertThat( delivery.isUnloadedAtDestination().get(), equalTo( false ) );
 
         // When a cargo is rerouted the (often misdirected) last handling event is flagged as disregarded
         // since it doesn't have to be part of the new itinerary (this isn't in the Citerus version).
 
         // We now expect the cargo to be loaded onto voyage V400S in Tokyo heading to Hamburg
-        assertThat( delivery.isMisdirected().get(), is( equalTo( false ) ) );
-        assertThat( delivery.nextExpectedHandlingEvent().get().handlingEventType().get(), is( equalTo( LOAD ) ) );
-        assertThat( delivery.nextExpectedHandlingEvent().get().location().get(), is( equalTo( TOKYO ) ) );
-        assertThat( delivery.nextExpectedHandlingEvent().get().voyage().get(), is( equalTo( V400S ) ) );
+        assertThat( delivery.isMisdirected().get(), equalTo( false ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get().handlingEventType().get(), equalTo( LOAD ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get().location().get(), equalTo( TOKYO ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get().voyage().get(), equalTo( V400S ) );
 
         // Cargo is not misdirected anymore according to new itinerary. Cargo location is now expected to be in Tokyo.
     }
 
     @Test
-    public void deviation_4c_UNLOAD_1b_ExpectedMidpointLocation() throws Exception
+    public void deviation_4c_UNLOAD_1b_ExpectedMidpointLocation()
+        throws Exception
     {
         deviation_4c_UNLOAD_1a_UnexpectedPort();
 
@@ -515,22 +541,23 @@ public class BuildDeliverySnapshotTest
         HandlingEvent handlingEvent = HANDLING_EVENTS.createHandlingEvent( day( 8 ), day( 8 ), trackingId, UNLOAD, HAMBURG, V400S );
         Delivery delivery = new BuildDeliverySnapshot( cargo, handlingEvent ).get();
 
-        assertThat( delivery.isMisdirected().get(), is( equalTo( false ) ) );
-        assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.ROUTED ) ) );
-        assertThat( delivery.transportStatus().get(), is( equalTo( TransportStatus.IN_PORT ) ) );
-        assertThat( delivery.lastHandlingEvent().get(), is( equalTo( handlingEvent ) ) );
-        assertThat( delivery.lastKnownLocation().get(), is( equalTo( HAMBURG ) ) );
-        assertThat( delivery.currentVoyage().get(), is( equalTo( null ) ) );
-        assertThat( delivery.isUnloadedAtDestination().get(), is( equalTo( false ) ) );
+        assertThat( delivery.isMisdirected().get(), equalTo( false ) );
+        assertThat( delivery.routingStatus().get(), equalTo( RoutingStatus.ROUTED ) );
+        assertThat( delivery.transportStatus().get(), equalTo( TransportStatus.IN_PORT ) );
+        assertThat( delivery.lastHandlingEvent().get(), equalTo( handlingEvent ) );
+        assertThat( delivery.lastKnownLocation().get(), equalTo( HAMBURG ) );
+        assertThat( delivery.currentVoyage().get(), nullValue() );
+        assertThat( delivery.isUnloadedAtDestination().get(), equalTo( false ) );
 
         // We expect the cargo to be loaded onto voyage V200T in New York heading for Dallas
-        assertThat( delivery.nextExpectedHandlingEvent().get().handlingEventType().get(), is( equalTo( LOAD ) ) );
-        assertThat( delivery.nextExpectedHandlingEvent().get().location().get(), is( equalTo( HAMBURG ) ) );
-        assertThat( delivery.nextExpectedHandlingEvent().get().voyage().get(), is( equalTo( V500S ) ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get().handlingEventType().get(), equalTo( LOAD ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get().location().get(), equalTo( HAMBURG ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get().voyage().get(), equalTo( V500S ) );
     }
 
     @Test
-    public void deviation_4c_UNLOAD_1c_Destination() throws Exception
+    public void deviation_4c_UNLOAD_1c_Destination()
+        throws Exception
     {
         deviation_4c_UNLOAD_1b_ExpectedMidpointLocation();
 
@@ -541,25 +568,25 @@ public class BuildDeliverySnapshotTest
         HandlingEvent handlingEvent = HANDLING_EVENTS.createHandlingEvent( day( 16 ), day( 16 ), trackingId, UNLOAD, STOCKHOLM, V500S );
         Delivery delivery = new BuildDeliverySnapshot( cargo, handlingEvent ).get();
 
-        assertThat( delivery.isMisdirected().get(), is( equalTo( false ) ) );
-        assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.ROUTED ) ) );
-        assertThat( delivery.transportStatus().get(), is( equalTo( TransportStatus.IN_PORT ) ) );
-        assertThat( delivery.lastHandlingEvent().get(), is( equalTo( handlingEvent ) ) );
-        assertThat( delivery.lastKnownLocation().get(), is( equalTo( STOCKHOLM ) ) );
-        assertThat( delivery.currentVoyage().get(), is( equalTo( null ) ) );
+        assertThat( delivery.isMisdirected().get(), equalTo( false ) );
+        assertThat( delivery.routingStatus().get(), equalTo( RoutingStatus.ROUTED ) );
+        assertThat( delivery.transportStatus().get(), equalTo( TransportStatus.IN_PORT ) );
+        assertThat( delivery.lastHandlingEvent().get(), equalTo( handlingEvent ) );
+        assertThat( delivery.lastKnownLocation().get(), equalTo( STOCKHOLM ) );
+        assertThat( delivery.currentVoyage().get(), equalTo( null ) );
 
         // Cargo has arrived at destination location
-        assertThat( delivery.isUnloadedAtDestination().get(), is( equalTo( true ) ) );
+        assertThat( delivery.isUnloadedAtDestination().get(), equalTo( true ) );
 
         // We expect the cargo to be claimed by customer
-        assertThat( delivery.nextExpectedHandlingEvent().get().handlingEventType().get(), is( equalTo( CLAIM ) ) );
-        assertThat( delivery.nextExpectedHandlingEvent().get().location().get(), is( equalTo( STOCKHOLM ) ) );
-        assertThat( delivery.nextExpectedHandlingEvent().get().voyage().get(), is( equalTo( null ) ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get().handlingEventType().get(), equalTo( CLAIM ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get().location().get(), equalTo( STOCKHOLM ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get().voyage().get(), equalTo( null ) );
     }
 
-
     @Test
-    public void deviation_4d_CUSTOMS_1a_CargoIsInDestinationPort() throws Exception
+    public void deviation_4d_CUSTOMS_1a_CargoIsInDestinationPort()
+        throws Exception
     {
         deviation_4c_UNLOAD_1c_Destination();
 
@@ -570,23 +597,23 @@ public class BuildDeliverySnapshotTest
         HandlingEvent handlingEvent = HANDLING_EVENTS.createHandlingEvent( day( 16 ), day( 16 ), trackingId, CUSTOMS, STOCKHOLM, null );
         Delivery delivery = new BuildDeliverySnapshot( cargo, handlingEvent ).get();
 
-        assertThat( delivery.isMisdirected().get(), is( equalTo( false ) ) );
-        assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.ROUTED ) ) );
-        assertThat( delivery.transportStatus().get(), is( equalTo( TransportStatus.IN_PORT ) ) );
-        assertThat( delivery.lastHandlingEvent().get(), is( equalTo( handlingEvent ) ) );
-        assertThat( delivery.lastKnownLocation().get(), is( equalTo( STOCKHOLM ) ) );
-        assertThat( delivery.currentVoyage().get(), is( equalTo( null ) ) );
+        assertThat( delivery.isMisdirected().get(), equalTo( false ) );
+        assertThat( delivery.routingStatus().get(), equalTo( RoutingStatus.ROUTED ) );
+        assertThat( delivery.transportStatus().get(), equalTo( TransportStatus.IN_PORT ) );
+        assertThat( delivery.lastHandlingEvent().get(), equalTo( handlingEvent ) );
+        assertThat( delivery.lastKnownLocation().get(), equalTo( STOCKHOLM ) );
+        assertThat( delivery.currentVoyage().get(), equalTo( null ) );
 
         // Cargo might be at destination, but the last handling event wasn't unloading
-        assertThat( delivery.isUnloadedAtDestination().get(), is( equalTo( true ) ) );
+        assertThat( delivery.isUnloadedAtDestination().get(), equalTo( true ) );
 
         // Shouldn't we expect the cargo to be claimed by the customer now ?
-        assertThat( delivery.nextExpectedHandlingEvent().get(), is( equalTo( null ) ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get(), equalTo( null ) );
     }
 
-
     @Test
-    public void deviation_4e_CLAIM_1a_CargoIsNotInDestinationPort() throws Exception
+    public void deviation_4e_CLAIM_1a_CargoIsNotInDestinationPort()
+        throws Exception
     {
         deviation_4d_CUSTOMS_1a_CargoIsInDestinationPort();
 
@@ -597,22 +624,23 @@ public class BuildDeliverySnapshotTest
         HandlingEvent handlingEvent = HANDLING_EVENTS.createHandlingEvent( day( 1 ), day( 16 ), trackingId, CLAIM, HELSINKI, null );
         Delivery delivery = new BuildDeliverySnapshot( cargo, handlingEvent ).get();
 
-        assertThat( delivery.isMisdirected().get(), is( equalTo( true ) ) );
-        assertThat( delivery.nextExpectedHandlingEvent().get(), is( equalTo( null ) ) );
-        assertThat( delivery.eta().get(), is( equalTo( null ) ) );
+        assertThat( delivery.isMisdirected().get(), equalTo( true ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get(), equalTo( null ) );
+        assertThat( delivery.eta().get(), equalTo( null ) );
 
-        assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.ROUTED ) ) );
-        assertThat( delivery.transportStatus().get(), is( equalTo( TransportStatus.CLAIMED ) ) );
-        assertThat( delivery.lastHandlingEvent().get(), is( equalTo( handlingEvent ) ) );
-        assertThat( delivery.lastKnownLocation().get(), is( equalTo( HELSINKI ) ) );
-        assertThat( delivery.currentVoyage().get(), is( equalTo( null ) ) );
+        assertThat( delivery.routingStatus().get(), equalTo( RoutingStatus.ROUTED ) );
+        assertThat( delivery.transportStatus().get(), equalTo( TransportStatus.CLAIMED ) );
+        assertThat( delivery.lastHandlingEvent().get(), equalTo( handlingEvent ) );
+        assertThat( delivery.lastKnownLocation().get(), equalTo( HELSINKI ) );
+        assertThat( delivery.currentVoyage().get(), equalTo( null ) );
 
         // Cargo is claimed but has not arrived yet in destination port
-        assertThat( delivery.isUnloadedAtDestination().get(), is( equalTo( false ) ) );
+        assertThat( delivery.isUnloadedAtDestination().get(), equalTo( false ) );
     }
 
     @Test
-    public void deviation_4e_CLAIM_1b_CargoIsInDestinationPort() throws Exception
+    public void deviation_4e_CLAIM_1b_CargoIsInDestinationPort()
+        throws Exception
     {
         deviation_4e_CLAIM_1a_CargoIsNotInDestinationPort();
 
@@ -623,17 +651,17 @@ public class BuildDeliverySnapshotTest
         HandlingEvent handlingEvent = HANDLING_EVENTS.createHandlingEvent( day( 16 ), day( 16 ), trackingId, CLAIM, STOCKHOLM, null );
         Delivery delivery = new BuildDeliverySnapshot( cargo, handlingEvent ).get();
 
-        assertThat( delivery.isMisdirected().get(), is( equalTo( false ) ) );
-        assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.ROUTED ) ) );
-        assertThat( delivery.transportStatus().get(), is( equalTo( TransportStatus.CLAIMED ) ) );
-        assertThat( delivery.lastHandlingEvent().get(), is( equalTo( handlingEvent ) ) );
-        assertThat( delivery.lastKnownLocation().get(), is( equalTo( STOCKHOLM ) ) );
-        assertThat( delivery.currentVoyage().get(), is( equalTo( null ) ) );
+        assertThat( delivery.isMisdirected().get(), equalTo( false ) );
+        assertThat( delivery.routingStatus().get(), equalTo( RoutingStatus.ROUTED ) );
+        assertThat( delivery.transportStatus().get(), equalTo( TransportStatus.CLAIMED ) );
+        assertThat( delivery.lastHandlingEvent().get(), equalTo( handlingEvent ) );
+        assertThat( delivery.lastKnownLocation().get(), equalTo( STOCKHOLM ) );
+        assertThat( delivery.currentVoyage().get(), equalTo( null ) );
 
         // Cargo is claimed in destination port
-        assertThat( delivery.isUnloadedAtDestination().get(), is( equalTo( true ) ) );
+        assertThat( delivery.isUnloadedAtDestination().get(), equalTo( true ) );
 
         // No more expected handling events
-        assertThat( delivery.nextExpectedHandlingEvent().get(), is( equalTo( null ) ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get(), equalTo( null ) );
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/test/java/org/qi4j/sample/dcicargo/sample_a/context/shipping/handling/RegisterHandlingEventTest.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/test/java/org/qi4j/sample/dcicargo/sample_a/context/shipping/handling/RegisterHandlingEventTest.java b/samples/dci-cargo/dcisample_a/src/test/java/org/qi4j/sample/dcicargo/sample_a/context/shipping/handling/RegisterHandlingEventTest.java
index fba4edc..964b299 100644
--- a/samples/dci-cargo/dcisample_a/src/test/java/org/qi4j/sample/dcicargo/sample_a/context/shipping/handling/RegisterHandlingEventTest.java
+++ b/samples/dci-cargo/dcisample_a/src/test/java/org/qi4j/sample/dcicargo/sample_a/context/shipping/handling/RegisterHandlingEventTest.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_a.context.shipping.handling;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.junit.Before;
 import org.junit.Test;
 import org.qi4j.api.unitofwork.UnitOfWork;
@@ -35,7 +35,6 @@ import org.qi4j.sample.dcicargo.sample_a.data.shipping.location.Location;
 import org.qi4j.sample.dcicargo.sample_a.data.shipping.voyage.Voyage;
 
 import static org.hamcrest.CoreMatchers.equalTo;
-import static org.hamcrest.CoreMatchers.is;
 import static org.junit.Assert.assertThat;
 import static org.qi4j.sample.dcicargo.sample_a.data.shipping.handling.HandlingEventType.UNLOAD;
 
@@ -45,12 +44,12 @@ import static org.qi4j.sample.dcicargo.sample_a.data.shipping.handling.HandlingE
  * Test method names describe the test purpose. The prefix refers to the step in the use case.
  */
 public class RegisterHandlingEventTest
-      extends TestApplication
+    extends TestApplication
 {
-    Date time;
+    ZonedDateTime time;
     String trackId;
     String msg;
-    private Date arrival;
+    private ZonedDateTime arrival;
     private Cargo cargo;
     private TrackingId trackingId;
     private Cargos CARGOS;
@@ -63,9 +62,11 @@ public class RegisterHandlingEventTest
     private Voyage V300A;
 
     @Before
-    public void beforeEachTest() throws Exception {
+    public void beforeEachTest()
+        throws Exception
+    {
         UnitOfWork uow = module.currentUnitOfWork();
-        CARGOS = uow.get(Cargos.class,  CargosEntity.CARGOS_ID );
+        CARGOS = uow.get( Cargos.class, CargosEntity.CARGOS_ID );
         HONGKONG = uow.get( Location.class, CNHKG.code().get() );
         STOCKHOLM = uow.get( Location.class, SESTO.code().get() );
         NEWYORK = uow.get( Location.class, USNYC.code().get() );
@@ -76,10 +77,10 @@ public class RegisterHandlingEventTest
         trackingId = new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, day( 17 ) ).createCargo( "ABC" );
         cargo = uow.get( Cargo.class, trackingId.id().get() );
         Itinerary itinerary = itinerary(
-              leg( V100S, HONGKONG, NEWYORK, day( 1 ), day( 8 ) ),
-              leg( V200T, NEWYORK, DALLAS, day( 9 ), day( 12 ) ),
-              leg( V300A, DALLAS, STOCKHOLM, day( 13 ),
-                   arrival = day( 16 ) )
+            leg( V100S, HONGKONG, NEWYORK, day( 1 ), day( 8 ) ),
+            leg( V200T, NEWYORK, DALLAS, day( 9 ), day( 12 ) ),
+            leg( V300A, DALLAS, STOCKHOLM, day( 13 ),
+                 arrival = day( 16 ) )
         );
         new BookNewCargo( cargo, itinerary ).assignCargoToRoute();
         time = day( 1 );
@@ -89,147 +90,165 @@ public class RegisterHandlingEventTest
     // INPUT EXISTENCE VALIDATION ==================================================================
 
     @Test
-    public void deviation_2a_MissingRegistrationTime() throws Exception
+    public void deviation_2a_MissingRegistrationTime()
+        throws Exception
     {
         msg = register( null, time, trackId, "RECEIVE", "CNHKG", null );
-        assertThat( msg, is( equalTo( "Registration time was null. All parameters have to be passed." ) ) );
+        assertThat( msg, equalTo( "Registration time was null. All parameters have to be passed." ) );
     }
+
     @Test
-    public void deviation_2a_MissingCompletionTime() throws Exception
+    public void deviation_2a_MissingCompletionTime()
+        throws Exception
     {
         msg = register( time, null, trackId, "RECEIVE", "CNHKG", null );
-        assertThat( msg, is( equalTo( "Completion time was null. All parameters have to be passed." ) ) );
+        assertThat( msg, equalTo( "Completion time was null. All parameters have to be passed." ) );
     }
 
     @Test
-    public void deviation_2a_MissingTrackingId() throws Exception
+    public void deviation_2a_MissingTrackingId()
+        throws Exception
     {
         msg = register( time, time, null, "RECEIVE", "CNHKG", null );
-        assertThat( msg, is( equalTo( "Tracking id was null. All parameters have to be passed." ) ) );
+        assertThat( msg, equalTo( "Tracking id was null. All parameters have to be passed." ) );
     }
 
     @Test
-    public void deviation_2a_EmptyTrackingId() throws Exception
+    public void deviation_2a_EmptyTrackingId()
+        throws Exception
     {
         msg = register( time, time, "", "RECEIVE", "CNHKG", null );
-        assertThat( msg, is( equalTo( "Tracking id cannot be empty." ) ) );
+        assertThat( msg, equalTo( "Tracking id cannot be empty." ) );
     }
 
     @Test
-    public void deviation_2a_MissingEventType() throws Exception
+    public void deviation_2a_MissingEventType()
+        throws Exception
     {
         msg = register( time, time, trackId, null, "CNHKG", null );
-        assertThat( msg, is( equalTo( "Event type was null. All parameters have to be passed." ) ) );
+        assertThat( msg, equalTo( "Event type was null. All parameters have to be passed." ) );
     }
 
     @Test
-    public void deviation_2a_EmptyEventType() throws Exception
+    public void deviation_2a_EmptyEventType()
+        throws Exception
     {
         msg = register( time, time, trackId, "", "CNHKG", null );
-        assertThat( msg, is( equalTo( "Event type cannot be empty." ) ) );
+        assertThat( msg, equalTo( "Event type cannot be empty." ) );
     }
 
     @Test
-    public void deviation_2a_MissingUnlocode() throws Exception
+    public void deviation_2a_MissingUnlocode()
+        throws Exception
     {
         msg = register( time, time, trackId, "RECEIVE", null, null );
-        assertThat( msg, is( equalTo( "UnLocode was null. All parameters have to be passed." ) ) );
+        assertThat( msg, equalTo( "UnLocode was null. All parameters have to be passed." ) );
     }
 
     @Test
-    public void deviation_2a_EmptyUnlocode() throws Exception
+    public void deviation_2a_EmptyUnlocode()
+        throws Exception
     {
         msg = register( time, time, trackId, "RECEIVE", "", null );
-        assertThat( msg, is( equalTo( "UnLocode cannot be empty." ) ) );
+        assertThat( msg, equalTo( "UnLocode cannot be empty." ) );
     }
 
     @Test
-    public void step_2_CompleteData__Receive_in_Hong_Kong() throws Exception
+    public void step_2_CompleteData__Receive_in_Hong_Kong()
+        throws Exception
     {
         new RegisterHandlingEvent( time, time, trackId, "RECEIVE", "CNHKG", null ).register();
     }
 
-
     // INPUT VALIDATION ==================================================================
 
     @Test
-    public void deviation_3a_HandlingTypeNotRecognized() throws Exception
+    public void deviation_3a_HandlingTypeNotRecognized()
+        throws Exception
     {
         msg = register( time, time, trackId, "RECEIPT", "CNHKG", null );
-        assertThat( msg, is( equalTo(
-              "'RECEIPT' is not a valid handling event type. Valid types are: [RECEIVE, LOAD, UNLOAD, CUSTOMS, CLAIM]" ) ) );
+        assertThat( msg, equalTo(
+            "'RECEIPT' is not a valid handling event type. Valid types are: [RECEIVE, LOAD, UNLOAD, CUSTOMS, CLAIM]" ) );
     }
 
     @Test
-    public void deviation_3b_NoCargoWithTrackingId() throws Exception
+    public void deviation_3b_NoCargoWithTrackingId()
+        throws Exception
     {
         msg = register( time, time, "XXX", "RECEIVE", "CNHKG", null );
-        assertThat( msg, is( equalTo( "Found no cargo with tracking id 'XXX'." ) ) );
+        assertThat( msg, equalTo( "Found no cargo with tracking id 'XXX'." ) );
     }
 
     @Test
-    public void deviation_3c_CargoNotRoutedYet() throws Exception
+    public void deviation_3c_CargoNotRoutedYet()
+        throws Exception
     {
         TrackingId nonRoutedTrackingId = new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, day( 17 ) ).createCargo( "NonRoutedCargo" );
         String nonRouted = nonRoutedTrackingId.id().get();
 
         msg = register( time, time, nonRouted, "RECEIVE", "CNHKG", null );
-        assertThat( msg, is( equalTo( "Can't create handling event for non-routed cargo '" + nonRouted + "'." ) ) );
+        assertThat( msg, equalTo( "Can't create handling event for non-routed cargo '" + nonRouted + "'." ) );
     }
 
     @Test
-    public void deviation_3d_NoLocationWithUnlocode() throws Exception
+    public void deviation_3d_NoLocationWithUnlocode()
+        throws Exception
     {
         msg = register( time, time, trackId, "RECEIVE", "ZZZZZ", null );
-        assertThat( msg, is( equalTo( "Unknown location: ZZZZZ" ) ) );
+        assertThat( msg, equalTo( "Unknown location: ZZZZZ" ) );
     }
 
     @Test
-    public void deviation_3e_1a_MissingVoyageNumber() throws Exception
+    public void deviation_3e_1a_MissingVoyageNumber()
+        throws Exception
     {
         msg = register( time, time, trackId, "LOAD", "CNHKG", null );
-        assertThat( msg, is( equalTo( "Handling event LOAD requires a voyage. No voyage number submitted." ) ) );
+        assertThat( msg, equalTo( "Handling event LOAD requires a voyage. No voyage number submitted." ) );
     }
 
     @Test
-    public void deviation_3e_1b_MissingVoyage() throws Exception
+    public void deviation_3e_1b_MissingVoyage()
+        throws Exception
     {
         msg = register( time, time, trackId, "LOAD", "CNHKG", "V600S" );
-        assertThat( msg, is( equalTo( "Found no voyage with voyage number 'V600S'." ) ) );
+        assertThat( msg, equalTo( "Found no voyage with voyage number 'V600S'." ) );
     }
 
     @Test
-    public void deviation_3f_SkipVoyageNumberSilentlyWhenProhibited() throws Exception
+    public void deviation_3f_SkipVoyageNumberSilentlyWhenProhibited()
+        throws Exception
     {
         new RegisterHandlingEvent( time, time, trackId, "RECEIVE", "CNHKG", "V100S" ).register();
-        assertThat( cargo.delivery().get().currentVoyage().get(), is( equalTo( null ) ) );
+        assertThat( cargo.delivery().get().currentVoyage().get(), equalTo( null ) );
     }
 
     @Test
-    public void step_3_to_5_ValidRegistration__Load_in_Hong_Kong() throws Exception
+    public void step_3_to_5_ValidRegistration__Load_in_Hong_Kong()
+        throws Exception
     {
         new RegisterHandlingEvent( time, time, trackId, "LOAD", "CNHKG", "V100S" ).register();
 
         Delivery delivery = cargo.delivery().get();
-        assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.ROUTED ) ) );
-        assertThat( delivery.transportStatus().get(), is( equalTo( TransportStatus.ONBOARD_CARRIER ) ) );
-        assertThat( delivery.nextExpectedHandlingEvent().get().handlingEventType().get(), is( equalTo( UNLOAD ) ) );
-        assertThat( delivery.nextExpectedHandlingEvent().get().location().get(), is( equalTo( NEWYORK ) ) );
-        assertThat( delivery.nextExpectedHandlingEvent().get().voyage().get(), is( equalTo( V100S ) ) );
-        assertThat( delivery.lastKnownLocation().get(), is( equalTo( HONGKONG ) ) );
-        assertThat( delivery.currentVoyage().get(), is( equalTo( V100S ) ) );
-        assertThat( delivery.eta().get(), is( equalTo( arrival ) ) );
-        assertThat( delivery.isMisdirected().get(), is( equalTo( false ) ) );
-        assertThat( delivery.isUnloadedAtDestination().get(), is( equalTo( false ) ) );
+        assertThat( delivery.routingStatus().get(), equalTo( RoutingStatus.ROUTED ) );
+        assertThat( delivery.transportStatus().get(), equalTo( TransportStatus.ONBOARD_CARRIER ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get().handlingEventType().get(), equalTo( UNLOAD ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get().location().get(), equalTo( NEWYORK ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get().voyage().get(), equalTo( V100S ) );
+        assertThat( delivery.lastKnownLocation().get(), equalTo( HONGKONG ) );
+        assertThat( delivery.currentVoyage().get(), equalTo( V100S ) );
+        assertThat( delivery.eta().get(), equalTo( arrival ) );
+        assertThat( delivery.isMisdirected().get(), equalTo( false ) );
+        assertThat( delivery.isUnloadedAtDestination().get(), equalTo( false ) );
     }
 
-
-    private String register( Date registrationTime,
-                             Date completionTime,
+    private String register( ZonedDateTime registrationTime,
+                             ZonedDateTime completionTime,
                              String trackingIdString,
                              String eventTypeString,
                              String unLocodeString,
-                             String voyageNumberString ) throws Exception
+                             String voyageNumberString
+    )
+        throws Exception
     {
         try
         {
@@ -240,7 +259,7 @@ public class RegisterHandlingEventTest
                                        unLocodeString,
                                        voyageNumberString ).register();
         }
-        catch (IllegalArgumentException e)
+        catch( IllegalArgumentException e )
         {
             return e.getMessage();
         }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/pathfinder_b/api/GraphTraversalService.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/pathfinder_b/api/GraphTraversalService.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/pathfinder_b/api/GraphTraversalService.java
index 7fc9dbf..6918b12 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/pathfinder_b/api/GraphTraversalService.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/pathfinder_b/api/GraphTraversalService.java
@@ -19,7 +19,8 @@ package org.qi4j.sample.dcicargo.pathfinder_b.api;
 
 import java.rmi.Remote;
 import java.rmi.RemoteException;
-import java.util.Date;
+import java.time.LocalDate;
+import java.time.ZonedDateTime;
 import java.util.List;
 
 /**
@@ -38,7 +39,7 @@ public interface GraphTraversalService extends Remote
      *
      * @throws RemoteException RMI problem
      */
-    List<TransitPath> findShortestPath( Date departureDate, String originUnLocode, String destinationUnLocode )
+    List<TransitPath> findShortestPath( ZonedDateTime departureDate, String originUnLocode, String destinationUnLocode )
         throws RemoteException;
 
     List<TransitPath> getVoyages()

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/pathfinder_b/api/TransitEdge.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/pathfinder_b/api/TransitEdge.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/pathfinder_b/api/TransitEdge.java
index 111c941..8adee9d 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/pathfinder_b/api/TransitEdge.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/pathfinder_b/api/TransitEdge.java
@@ -18,7 +18,8 @@
 package org.qi4j.sample.dcicargo.pathfinder_b.api;
 
 import java.io.Serializable;
-import java.util.Date;
+import java.time.LocalDate;
+import java.time.ZonedDateTime;
 
 /**
  * Represents an edge in a path through a graph,
@@ -30,8 +31,8 @@ public final class TransitEdge implements Serializable
     private final String voyageNumber;
     private final String fromUnLocode;
     private final String toUnLocode;
-    private final Date fromDate;
-    private final Date toDate;
+    private final ZonedDateTime fromDate;
+    private final ZonedDateTime toDate;
 
     /**
      * Constructor.
@@ -45,8 +46,8 @@ public final class TransitEdge implements Serializable
     public TransitEdge( final String voyageNumber,
                         final String fromUnLocode,
                         final String toUnLocode,
-                        final Date fromDate,
-                        final Date toDate
+                        final ZonedDateTime fromDate,
+                        final ZonedDateTime toDate
     )
     {
         this.voyageNumber = voyageNumber;
@@ -71,12 +72,12 @@ public final class TransitEdge implements Serializable
         return toUnLocode;
     }
 
-    public Date getFromDate()
+    public ZonedDateTime getFromDate()
     {
         return fromDate;
     }
 
-    public Date getToDate()
+    public ZonedDateTime getToDate()
     {
         return toDate;
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/pathfinder_b/internal/GraphDAO.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/pathfinder_b/internal/GraphDAO.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/pathfinder_b/internal/GraphDAO.java
index 15e86ea..d5c450b 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/pathfinder_b/internal/GraphDAO.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/pathfinder_b/internal/GraphDAO.java
@@ -17,10 +17,11 @@
  */
 package org.qi4j.sample.dcicargo.pathfinder_b.internal;
 
+import java.time.LocalDate;
+import java.time.ZonedDateTime;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
-import java.util.Date;
 import java.util.List;
 import java.util.Random;
 import org.qi4j.sample.dcicargo.pathfinder_b.api.TransitEdge;
@@ -50,7 +51,7 @@ public class GraphDAO
             return voyages;
         }
 
-        Date departureDate = new Date();
+        ZonedDateTime departureDate = ZonedDateTime.now();
         for( int i = 0; i < 50; i++ )
         {
             List<String> locations = getRandomChunkOfLocations( listLocations() );
@@ -61,9 +62,9 @@ public class GraphDAO
             String from = locations.remove( 0 );
             String destination = locations.remove( 0 );
 
-            Date date = nextDate( departureDate );
-            Date fromDate;
-            Date toDate;
+            ZonedDateTime date = nextDate( departureDate );
+            ZonedDateTime fromDate;
+            ZonedDateTime toDate;
 
             // Carrier movements
             for( final String to : locations )
@@ -92,9 +93,9 @@ public class GraphDAO
         return voyages;
     }
 
-    private Date nextDate( Date date )
+    private ZonedDateTime nextDate( ZonedDateTime date )
     {
-        return new Date( date.getTime() + ONE_DAY_MS + ( random.nextInt( 1000 ) - 500 ) * ONE_MIN_MS );
+        return date.plusDays( 1 + random.nextInt( 30 ) );
     }
 
     private List<String> getRandomChunkOfLocations( List<String> allLocations )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/pathfinder_b/internal/GraphTraversalServiceImpl.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/pathfinder_b/internal/GraphTraversalServiceImpl.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/pathfinder_b/internal/GraphTraversalServiceImpl.java
index 2c59c53..3f87839 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/pathfinder_b/internal/GraphTraversalServiceImpl.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/pathfinder_b/internal/GraphTraversalServiceImpl.java
@@ -18,9 +18,9 @@
 package org.qi4j.sample.dcicargo.pathfinder_b.internal;
 
 import java.rmi.RemoteException;
+import java.time.ZonedDateTime;
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Date;
 import java.util.List;
 import java.util.Random;
 import org.qi4j.sample.dcicargo.pathfinder_b.api.GraphTraversalService;
@@ -40,7 +40,7 @@ public class GraphTraversalServiceImpl
     }
 
     // Combine existing voyages to create a route.
-    public List<TransitPath> findShortestPath( final Date departureDate,
+    public List<TransitPath> findShortestPath( final ZonedDateTime departureDate,
                                                final String originUnLocode,
                                                final String destinationUnLocode
     )
@@ -54,7 +54,7 @@ public class GraphTraversalServiceImpl
         do
         {
             String expectedDeparture = originUnLocode;
-            Date lastArrivalTime = departureDate;
+            ZonedDateTime lastArrivalTime = departureDate;
 
             // Transit edges (itinerary legs)
             final List<TransitEdge> routeEdges = new ArrayList<TransitEdge>();
@@ -83,13 +83,13 @@ public class GraphTraversalServiceImpl
 
                     final String departure = voyageEdge.getFromUnLocode();
                     final String arrival = voyageEdge.getToUnLocode();
-                    final Date departureTime = voyageEdge.getFromDate();
-                    final Date arrivalTime = voyageEdge.getToDate();
+                    final ZonedDateTime departureTime = voyageEdge.getFromDate();
+                    final ZonedDateTime arrivalTime = voyageEdge.getToDate();
 
                     boolean expectsDeparture = departure.equals( expectedDeparture );
                     boolean uniqueDeparture = !oldDepartures.contains( departure );
                     boolean uniqueArrival = !oldDepartures.contains( arrival );
-                    boolean afterLastArrivalTime = departureTime.after( lastArrivalTime );
+                    boolean afterLastArrivalTime = departureTime.isAfter( lastArrivalTime );
 
                     if( expectsDeparture && uniqueDeparture && uniqueArrival && afterLastArrivalTime )
                     {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/bootstrap/DCISampleApplication_b.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/bootstrap/DCISampleApplication_b.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/bootstrap/DCISampleApplication_b.java
index 4e5a36f..262bbbc 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/bootstrap/DCISampleApplication_b.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/bootstrap/DCISampleApplication_b.java
@@ -17,7 +17,6 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.bootstrap;
 
-import java.util.Date;
 import org.apache.wicket.ConverterLocator;
 import org.apache.wicket.Page;
 import org.apache.wicket.datetime.PatternDateConverter;
@@ -54,9 +53,6 @@ public class DCISampleApplication_b
 
         // Show/hide wicket tags in html code
         getMarkupSettings().setStripWicketTags( true );
-
-        // Default date format (we don't care for now about the hour of the day)
-        ( (ConverterLocator) getConverterLocator() ).set( Date.class, new PatternDateConverter( "yyyy-MM-dd", true ) );
     }
 
     private void mountPages()

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/bootstrap/sampledata/BaseData.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/bootstrap/sampledata/BaseData.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/bootstrap/sampledata/BaseData.java
index dc2c669..1cba6bf 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/bootstrap/sampledata/BaseData.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/bootstrap/sampledata/BaseData.java
@@ -17,9 +17,11 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.bootstrap.sampledata;
 
+import java.time.Instant;
+import java.time.LocalDate;
+import java.time.ZonedDateTime;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Date;
 import java.util.List;
 import org.qi4j.api.structure.Module;
 import org.qi4j.api.value.ValueBuilder;
@@ -71,7 +73,7 @@ public abstract class BaseData
         return unlocode.newInstance();
     }
 
-    protected CarrierMovement carrierMovement( Location depLoc, Location arrLoc, Date depTime, Date arrTime )
+    protected CarrierMovement carrierMovement( Location depLoc, Location arrLoc, ZonedDateTime depTime, ZonedDateTime arrTime )
     {
         ValueBuilder<CarrierMovement> carrierMovement = module.newValueBuilder( CarrierMovement.class );
         carrierMovement.prototype().departureLocation().set( depLoc );
@@ -90,7 +92,7 @@ public abstract class BaseData
         return schedule.newInstance();
     }
 
-    protected Leg leg( Voyage voyage, Location load, Location unload, Date loadTime, Date unloadTime )
+    protected Leg leg( Voyage voyage, Location load, Location unload, ZonedDateTime loadTime, ZonedDateTime unloadTime )
     {
         ValueBuilder<Leg> leg = module.newValueBuilder( Leg.class );
         leg.prototype().voyage().set( voyage );
@@ -116,13 +118,13 @@ public abstract class BaseData
         Boolean isUnloadedAtDestination,
         RoutingStatus routingStatus,
         Boolean isMisdirected,
-        Date eta,
+        ZonedDateTime eta,
         Integer itineraryProgressIndex,
         NextHandlingEvent nextHandlingEvent
     )
     {
         ValueBuilder<Delivery> delivery = module.newValueBuilder( Delivery.class );
-        delivery.prototype().timestamp().set( new Date() );
+        delivery.prototype().timestamp().set( Instant.now() );
         delivery.prototype().lastHandlingEvent().set( lastHandlingEvent );
         delivery.prototype().transportStatus().set( transportStatus );
         delivery.prototype().isUnloadedAtDestination().set( isUnloadedAtDestination );
@@ -135,7 +137,7 @@ public abstract class BaseData
     }
 
     // Delivery with only mandatory values
-    protected Delivery delivery( Date date,
+    protected Delivery delivery( Instant date,
                                  TransportStatus transportStatus,
                                  RoutingStatus routingStatus,
                                  Integer itineraryProgressIndex
@@ -151,7 +153,7 @@ public abstract class BaseData
 
     protected NextHandlingEvent nextHandlingEvent( HandlingEventType handlingEventType,
                                                    Location location,
-                                                   Date time,
+                                                   ZonedDateTime time,
                                                    Voyage voyage
     )
     {
@@ -163,8 +165,8 @@ public abstract class BaseData
         return nextHandlingEvent.newInstance();
     }
 
-    protected ParsedHandlingEventData parsedHandlingEventData( Date registrationTime,
-                                                               Date completionTime,
+    protected ParsedHandlingEventData parsedHandlingEventData( ZonedDateTime registrationTime,
+                                                               ZonedDateTime completionTime,
                                                                String trackingIdString,
                                                                HandlingEventType handlingEventType,
                                                                String unLocodeString,
@@ -182,11 +184,4 @@ public abstract class BaseData
 
         return attempt.newInstance();
     }
-
-    protected static Date day( int days )
-    {
-        Date today = new Date();
-        long aDay = 24 * 60 * 60 * 1000;
-        return new Date( today.getTime() + days * aDay );
-    }
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/bootstrap/sampledata/SampleDataService.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/bootstrap/sampledata/SampleDataService.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/bootstrap/sampledata/SampleDataService.java
index 753e232..fd2d57d 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/bootstrap/sampledata/SampleDataService.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/bootstrap/sampledata/SampleDataService.java
@@ -17,14 +17,12 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.bootstrap.sampledata;
 
+import java.time.LocalDate;
+import java.time.ZonedDateTime;
 import java.util.ArrayList;
-import java.util.Date;
 import java.util.List;
 import java.util.Random;
 import java.util.UUID;
-import org.joda.time.DateTime;
-import org.joda.time.LocalDate;
-import org.joda.time.LocalTime;
 import org.qi4j.api.activation.ActivatorAdapter;
 import org.qi4j.api.activation.Activators;
 import org.qi4j.api.injection.scope.Service;
@@ -133,7 +131,7 @@ public interface SampleDataService
                     routeSpec.print();
 
                     NextHandlingEvent nextEvent = null;
-                    Date time = null;
+                    ZonedDateTime time = null;
                     String port = null;
                     String voyageNumber = null;
                     Voyage voyage;
@@ -168,8 +166,7 @@ public interface SampleDataService
                         }
 
                         final RouteSpecification unsatisfiedRouteSpec =
-                            routeSpecFactory.build( origin, badDest, new Date(), new DateTime().plusDays( 25 )
-                                .toDate() );
+                            routeSpecFactory.build( origin, badDest, ZonedDateTime.now(), ZonedDateTime.now().plusDays( 25 ) );
                         cargo.routeSpecification().set( unsatisfiedRouteSpec );
 
                         new InspectUnhandledCargo( cargo ).inspect();
@@ -180,7 +177,7 @@ public interface SampleDataService
                     {
                         nextEvent = cargo.delivery().get().nextHandlingEvent().get();
                         port = nextEvent.location().get().getCode();
-                        final Date mockTime = new Date();
+                        final ZonedDateTime mockTime = ZonedDateTime.now();
                         registerEvent( mockTime, mockTime, trackingId, RECEIVE, port, null );
                     }
 
@@ -358,7 +355,7 @@ public interface SampleDataService
             Location origin;
             Location destination;
             Random random = new Random();
-            Date deadline;
+            ZonedDateTime deadline;
             String uuid;
             String id;
             try
@@ -374,9 +371,7 @@ public interface SampleDataService
                     }
                     while( destination.equals( origin ) );
 
-                    deadline = new LocalDate().plusDays( 35 + random.nextInt( 10 ) )
-                        .toDateTime( new LocalTime() )
-                        .toDate();
+                    deadline = ZonedDateTime.now().plusDays( 35 + random.nextInt( 10 ) );
 
                     // Build sortable random tracking ids
                     uuid = UUID.randomUUID().toString().toUpperCase();
@@ -393,8 +388,8 @@ public interface SampleDataService
             }
         }
 
-        private void registerEvent( Date registrationTime,
-                                    Date completionTime,
+        private void registerEvent( ZonedDateTime registrationTime,
+                                    ZonedDateTime completionTime,
                                     String trackingIdString,
                                     HandlingEventType handlingEventType,
                                     String unLocodeString,

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/query/dto/HandlingEventDTO.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/query/dto/HandlingEventDTO.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/query/dto/HandlingEventDTO.java
index 08a9ea2..6386e16 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/query/dto/HandlingEventDTO.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/query/dto/HandlingEventDTO.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.communication.query.dto;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.property.Property;
 import org.qi4j.library.conversion.values.Unqualified;
@@ -37,7 +37,7 @@ import org.qi4j.sample.dcicargo.sample_b.infrastructure.conversion.DTO;
 @Unqualified
 public interface HandlingEventDTO extends DTO
 {
-    Property<Date> completionTime();
+    Property<ZonedDateTime> completionTime();
 
     Property<TrackingId> trackingId();
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/booking/BookNewCargoPage.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/booking/BookNewCargoPage.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/booking/BookNewCargoPage.java
index 8c71905..c75ff8a 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/booking/BookNewCargoPage.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/booking/BookNewCargoPage.java
@@ -17,7 +17,8 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.communication.web.booking;
 
-import java.util.Date;
+import java.time.LocalDate;
+import java.time.ZonedDateTime;
 import java.util.List;
 import org.apache.wicket.Session;
 import org.apache.wicket.ajax.AjaxRequestTarget;
@@ -27,7 +28,6 @@ import org.apache.wicket.markup.html.form.Form;
 import org.apache.wicket.markup.html.panel.ComponentFeedbackPanel;
 import org.apache.wicket.markup.html.panel.FeedbackPanel;
 import org.apache.wicket.request.mapper.parameter.PageParameters;
-import org.joda.time.LocalDate;
 import org.qi4j.sample.dcicargo.sample_b.communication.query.CommonQueries;
 import org.qi4j.sample.dcicargo.sample_b.context.interaction.booking.BookNewCargo;
 import org.qi4j.sample.dcicargo.sample_b.data.structure.tracking.TrackingId;
@@ -57,7 +57,7 @@ public class BookNewCargoPage extends BookingBasePage
     {
         // Set by Wicket property resolvers:
         private String origin, destination;
-        private Date deadline;
+        private ZonedDateTime deadline;
 
         public BookNewCargoForm()
         {
@@ -107,7 +107,7 @@ public class BookNewCargoPage extends BookingBasePage
 
             // Deadline
             final DateTextFieldWithPicker deadlineField = new DateTextFieldWithPicker( "deadline", "Arrival deadline", this );
-            deadlineField.earliestDate( new LocalDate().plusDays( 1 ) );
+            deadlineField.earliestDate( LocalDate.now().plusDays( 1 ) );
 
             final ComponentFeedbackPanel deadlineFeedback = new ComponentFeedbackPanel(
                 "deadlineFeedback", deadlineField );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/booking/CargoDetailsPage.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/booking/CargoDetailsPage.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/booking/CargoDetailsPage.java
index eafd5fe..7067bbc 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/booking/CargoDetailsPage.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/booking/CargoDetailsPage.java
@@ -161,14 +161,16 @@ public class CargoDetailsPage extends BookingBasePage
                     Leg leg = item.getModelObject();
 
                     item.add( new Label( "loadLocation", leg.loadLocation().get().getCode() ) );
-                    item.add( new Label( "loadTime", new Model<Date>( leg.loadTime().get() ) ) );
+                    Date loadTime = new Date( leg.loadTime().get().toInstant().toEpochMilli() );
+                    item.add( new Label( "loadTime", new Model<Date>( loadTime ) ) );
                     item.add( new Label( "voyage", leg.voyage().get().voyageNumber().get().number().get() ) );
 
                     Boolean isMisrouted = routingStatus == MISROUTED && item.getIndex() == ( getList().size() - 1 );
                     item.add( new Label( "unloadLocation", leg.unloadLocation().get().getCode() )
                                   .add( new ErrorColor( isMisrouted ) ) );
 
-                    item.add( new Label( "unloadTime", new Model<Date>( leg.unloadTime().get() ) ) );
+                    Date unloadTime = new Date( leg.unloadTime().get().toInstant().toEpochMilli() );
+                    item.add( new Label( "unloadTime", new Model<Date>( unloadTime ) ) );
                 }
             } );
         }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/booking/CargoListPage.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/booking/CargoListPage.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/booking/CargoListPage.java
index dc569bb..65ac141 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/booking/CargoListPage.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/communication/web/booking/CargoListPage.java
@@ -72,7 +72,7 @@ public class CargoListPage extends BookingBasePage
                 // Route specification
                 RouteSpecification routeSpec = cargo.routeSpecification().get();
                 String destination = routeSpec.destination().get().getCode();
-                Date deadline = routeSpec.arrivalDeadline().get();
+                Date deadline = new Date( routeSpec.arrivalDeadline().get().toInstant().toEpochMilli() );
 
                 // Routing status
                 Delivery delivery = cargo.delivery().get();


[21/50] [abbrv] zest-qi4j git commit: Fixed all JavaDoc ERRORS reported by DocLint in Java 8.

Posted by ni...@apache.org.
Fixed all JavaDoc ERRORS reported by DocLint in Java 8.


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/3bf71dfe
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/3bf71dfe
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/3bf71dfe

Branch: refs/heads/3.0
Commit: 3bf71dfea23dad90b449e271e24308edc0127e6f
Parents: 6ea0457
Author: Niclas Hedhman <ni...@hedhman.org>
Authored: Tue Aug 26 12:24:16 2014 +0800
Committer: Niclas Hedhman <ni...@hedhman.org>
Committed: Tue Aug 26 12:24:16 2014 +0800

----------------------------------------------------------------------
 .../java/org/qi4j/api/activation/Activator.java |  2 +-
 .../qi4j/api/activation/ActivatorAdapter.java   |  2 +-
 .../api/association/AssociationDescriptor.java  | 17 ++++++--
 .../java/org/qi4j/api/common/AppliesTo.java     |  2 +-
 .../org/qi4j/api/common/AppliesToFilter.java    |  4 +-
 .../main/java/org/qi4j/api/common/MetaInfo.java | 11 +++---
 .../java/org/qi4j/api/common/UseDefaults.java   | 10 ++---
 .../api/composite/AmbiguousTypeException.java   |  4 +-
 .../java/org/qi4j/api/composite/Composite.java  |  6 ++-
 .../qi4j/api/composite/CompositeInvoker.java    | 10 +++--
 .../org/qi4j/api/composite/DecoratorMixin.java  |  3 +-
 .../java/org/qi4j/api/concern/ConcernOf.java    |  6 ++-
 .../qi4j/api/concern/internal/ConcernFor.java   | 13 ++++---
 .../qi4j/api/configuration/Configuration.java   | 22 +++++------
 .../ConstraintViolationException.java           | 19 +++++----
 .../org/qi4j/api/constraint/Constraints.java    |  3 +-
 .../main/java/org/qi4j/api/entity/Identity.java |  4 +-
 .../java/org/qi4j/api/entity/Lifecycle.java     | 20 +++++-----
 .../qi4j/api/injection/scope/Invocation.java    |  4 +-
 .../org/qi4j/api/injection/scope/Service.java   | 13 ++++---
 .../org/qi4j/api/injection/scope/State.java     |  8 ++--
 .../org/qi4j/api/injection/scope/Structure.java |  7 ++--
 .../java/org/qi4j/api/injection/scope/This.java |  6 ++-
 .../qi4j/api/metrics/MetricsCounterFactory.java |  2 -
 .../api/metrics/MetricsHealthCheckFactory.java  |  1 -
 .../api/metrics/MetricsHistogramFactory.java    |  1 -
 .../qi4j/api/metrics/MetricsTimerFactory.java   |  1 -
 .../main/java/org/qi4j/api/mixin/Mixins.java    | 21 ++++++----
 .../qi4j/api/property/PropertyDescriptor.java   |  8 ++--
 .../src/main/java/org/qi4j/api/query/Query.java |  5 ++-
 .../org/qi4j/api/service/ServiceFinder.java     | 14 +++++--
 .../org/qi4j/api/service/qualifier/Active.java  | 10 +++--
 .../qi4j/api/service/qualifier/Available.java   |  4 +-
 .../qi4j/api/service/qualifier/HasMetaInfo.java | 21 ++++++----
 .../api/service/qualifier/IdentifiedBy.java     |  2 +-
 .../api/service/qualifier/ServiceQualifier.java | 14 +++++--
 .../org/qi4j/api/service/qualifier/Tagged.java  |  4 +-
 .../org/qi4j/api/service/qualifier/package.html | 12 +++---
 .../org/qi4j/api/sideeffect/SideEffectOf.java   |  6 ++-
 .../org/qi4j/api/sideeffect/SideEffects.java    |  1 -
 .../api/sideeffect/internal/SideEffectFor.java  | 19 ++++-----
 .../org/qi4j/api/unitofwork/UnitOfWork.java     |  8 +++-
 .../qi4j/api/unitofwork/UnitOfWorkFactory.java  | 27 ++++++-------
 .../qi4j/api/unitofwork/UnitOfWorkOptions.java  |  7 +++-
 .../unitofwork/concern/UnitOfWorkDiscardOn.java | 20 ++++++----
 .../concern/UnitOfWorkPropagation.java          | 10 ++---
 .../main/java/org/qi4j/api/util/Classes.java    |  9 +++--
 .../org/qi4j/api/value/ValueDeserializer.java   |  2 +-
 .../main/java/org/qi4j/bootstrap/Assembler.java |  4 +-
 .../org/qi4j/bootstrap/AssemblerCollection.java |  3 +-
 .../org/qi4j/bootstrap/AssemblyVisitor.java     |  9 +++--
 .../qi4j/bootstrap/AssociationDeclarations.java |  2 +-
 .../java/org/qi4j/bootstrap/ClassScanner.java   | 13 +++----
 .../java/org/qi4j/bootstrap/Energy4Java.java    |  9 +++--
 .../org/qi4j/bootstrap/EntityDeclaration.java   |  8 ++--
 .../bootstrap/ManyAssociationDeclarations.java  |  2 +-
 .../java/org/qi4j/bootstrap/ModuleAssembly.java | 15 ++++---
 .../bootstrap/NamedAssociationDeclarations.java |  2 +-
 .../org/qi4j/bootstrap/SingletonAssembler.java  |  2 +-
 .../org/qi4j/bootstrap/StateDeclarations.java   |  2 +-
 .../main/java/org/qi4j/functional/ForEach.java  |  5 ++-
 .../java/org/qi4j/functional/Functions.java     |  5 +--
 core/io/src/main/java/org/qi4j/io/Input.java    |  3 +-
 core/io/src/main/java/org/qi4j/io/Outputs.java  |  8 ++--
 .../qi4j/runtime/injection/DependencyModel.java | 21 +++++++---
 .../ImportedServiceReferenceInstance.java       |  4 +-
 .../service/ServiceReferenceInstance.java       | 10 +++--
 .../test/composite/CleanStackTraceTest.java     |  3 +-
 .../java/org/qi4j/spi/entity/EntityState.java   |  8 ++--
 .../ConcurrentModificationCheckConcern.java     |  3 +-
 .../spi/entitystore/EntityStoreUnitOfWork.java  |  4 +-
 .../spi/entitystore/helpers/MapEntityStore.java |  1 +
 .../spi/value/ValueDeserializerAdapter.java     |  2 +-
 .../org/qi4j/test/AbstractQi4jBaseTest.java     |  4 +-
 .../org/qi4j/test/AbstractQi4jScenarioTest.java | 10 +++--
 .../file/FileEntityStoreConfiguration.java      |  3 +-
 .../entitystore/jdbm/JdbmConfiguration.java     |  4 +-
 .../prefs/PreferencesEntityStoreService.java    | 16 +++++---
 .../index/sql/SQLIndexingEngineService.java     |  3 +-
 .../org/qi4j/library/alarm/AlarmHistory.java    |  4 +-
 .../org/qi4j/library/alarm/AlarmNameFormat.java |  4 +-
 .../java/org/qi4j/library/alarm/AlarmPoint.java | 34 +++++++++-------
 .../alarm/ExtendedAlarmModelService.java        |  9 ++---
 .../library/alarm/SimpleAlarmModelService.java  |  6 +--
 .../alarm/StandardAlarmModelService.java        |  7 ++--
 .../rest/server/DomainEventSourceResource.java  |  8 +++-
 .../application/api/ApplicationEvent.java       | 11 ++++--
 .../source/ApplicationEventSource.java          | 21 ++++++----
 .../helper/ApplicationTransactionTracker.java   |  9 +++--
 .../domain/api/DomainEventValue.java            |  8 ++--
 .../domain/source/EventSource.java              |  6 ++-
 .../source/helper/DomainEventTracker.java       |  8 +++-
 .../library/fileconfig/FileConfiguration.java   |  3 +-
 .../library/http/SecureJettyConfiguration.java  | 12 +++---
 .../ReturnCachedValueOnExceptionConcern.java    |  3 +-
 .../qi4j/library/jmx/JMXConnectorService.java   |  8 +++-
 .../org/qi4j/lang/beanshell/BeanShellMixin.java |  5 ++-
 .../java/org/qi4j/lang/groovy/GroovyMixin.java  |  5 ++-
 .../qi4j/lang/javascript/JavaScriptMixin.java   |  5 ++-
 .../java/org/qi4j/lang/jruby/JRubyMixin.java    |  5 ++-
 .../main/java/org/qi4j/logging/trace/Trace.java | 13 +++++--
 .../org/qi4j/logging/trace/TraceAllConcern.java |  4 +-
 .../org/qi4j/logging/trace/TraceConcern.java    |  7 ++--
 .../org/qi4j/library/osgi/FallbackStrategy.java |  4 +-
 .../library/rest/client/api/ErrorHandler.java   |  2 +-
 .../api/constraint/InteractionValidation.java   | 15 +++++--
 .../library/rest/admin/EntitiesResource.java    |  3 +-
 .../org/qi4j/library/scheduler/Scheduler.java   |  2 +-
 .../bootstrap/Qi4jApplicationBootstrap.java     | 29 +++++++-------
 .../library/sql/common/SQLConfiguration.java    |  2 +-
 .../library/uowfile/singular/HasUoWFile.java    |  1 +
 .../infrastructure/WicketQi4jApplication.java   |  4 +-
 .../testing/ExpectedException.java              | 25 ++++++++----
 .../moneytransfer/context/PayBillsContext.java  | 41 +++++++++++++-------
 .../moneytransfer/context/PayBillsContext2.java | 37 +++++++++++++-----
 .../samples/cargo/app1/model/cargo/Cargo.java   | 37 +++++++++++-------
 .../PostgreSQLEntityStorePerformanceTest.java   |  6 ++-
 .../composite/InvocationPerformanceTest.java    |  6 ++-
 .../PropertyMixinInvocationPerformanceTest.java |  3 +-
 .../org/qi4j/envisage/tree/TreeModelPane.java   |  8 ++--
 .../org/qi4j/tutorials/composites/package.html  |  6 ++-
 .../tutorials/composites/tutorial1/package.html | 12 ++++--
 .../tutorial10/HelloWorldComposite.java         |  6 +--
 .../tutorials/composites/tutorial2/package.html |  9 +++--
 .../tutorial3/HelloWorldComposite.java          |  6 +--
 .../tutorials/composites/tutorial3/package.html |  6 ++-
 .../tutorial4/HelloWorldBehaviour.java          |  6 +--
 .../tutorial4/HelloWorldBehaviourMixin.java     |  6 +--
 .../tutorial4/HelloWorldComposite.java          |  3 +-
 .../tutorials/composites/tutorial4/package.html | 15 ++++---
 .../tutorial5/HelloWorldBehaviour.java          |  3 +-
 .../tutorial5/HelloWorldBehaviourMixin.java     |  3 +-
 .../tutorial5/HelloWorldComposite.java          |  3 +-
 .../composites/tutorial5/HelloWorldState.java   |  3 +-
 .../tutorials/composites/tutorial5/package.html | 22 +++++++----
 .../tutorial6/HelloWorldBehaviour.java          |  3 +-
 .../tutorial6/HelloWorldBehaviourMixin.java     |  3 +-
 .../tutorial6/HelloWorldComposite.java          |  3 +-
 .../composites/tutorial6/HelloWorldState.java   |  3 +-
 .../tutorials/composites/tutorial6/package.html | 15 ++++---
 .../tutorial7/HelloWorldBehaviourMixin.java     |  3 +-
 .../tutorial7/HelloWorldComposite.java          |  3 +-
 .../composites/tutorial7/HelloWorldState.java   |  3 +-
 .../tutorials/composites/tutorial7/package.html | 22 ++++++++---
 .../tutorial8/HelloWorldBehaviourMixin.java     |  3 +-
 .../composites/tutorial8/HelloWorldState.java   |  3 +-
 .../tutorials/composites/tutorial8/package.html | 15 ++++---
 .../tutorial9/HelloWorldComposite.java          |  3 +-
 .../composites/tutorial9/HelloWorldState.java   |  3 +-
 .../tutorials/composites/tutorial9/package.html | 15 ++++---
 .../composites/src/main/javadoc/overview.html   | 11 +++---
 .../java/org/qi4j/tutorials/hello/Hello.java    |  1 -
 152 files changed, 770 insertions(+), 494 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/activation/Activator.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/activation/Activator.java b/core/api/src/main/java/org/qi4j/api/activation/Activator.java
index 4c36d7f..2cba184 100644
--- a/core/api/src/main/java/org/qi4j/api/activation/Activator.java
+++ b/core/api/src/main/java/org/qi4j/api/activation/Activator.java
@@ -23,7 +23,7 @@ package org.qi4j.api.activation;
  * @param <ActivateeType> Type of the activatee.
  *
  * @see ActivatorAdapter
- * @see ServiceActivation
+ * @see org.qi4j.api.service.ServiceActivation
  */
 public interface Activator<ActivateeType>
 {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/activation/ActivatorAdapter.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/activation/ActivatorAdapter.java b/core/api/src/main/java/org/qi4j/api/activation/ActivatorAdapter.java
index 7eb8960..59652b9 100644
--- a/core/api/src/main/java/org/qi4j/api/activation/ActivatorAdapter.java
+++ b/core/api/src/main/java/org/qi4j/api/activation/ActivatorAdapter.java
@@ -19,7 +19,7 @@ package org.qi4j.api.activation;
 
 /**
  * Adapter for Activator.
- * <p>If you are thinking about Service activation, see {@link ServiceActivatorAdapter}.</p>
+ * <p>If you are thinking about Service activation, see {@link org.qi4j.api.service.ServiceActivatorAdapter}.</p>
  *
  * @param <ActivateeType> Type of the activatee.
  */

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/association/AssociationDescriptor.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/association/AssociationDescriptor.java b/core/api/src/main/java/org/qi4j/api/association/AssociationDescriptor.java
index c301c63..9f7576a 100644
--- a/core/api/src/main/java/org/qi4j/api/association/AssociationDescriptor.java
+++ b/core/api/src/main/java/org/qi4j/api/association/AssociationDescriptor.java
@@ -27,11 +27,20 @@ public interface AssociationDescriptor extends MetaInfoHolder
     /**
      * Get the qualified name of the association. This is constructed by
      * concatenating the name of the declaring interface with the name
-     * of the method, using ":" as separator. Example:<br/>
-     * com.somecompany.MyInterface with association method<br/>
-     * Association<String> someAssociation();<br/>
-     * will have the qualified name:<br/>
+     * of the method, using ":" as separator.
+     * <p>
+     * Example:
+     * </p>
+     * <p>
+     * com.somecompany.MyInterface with association method
+     * </p>
+     * <pre><code>
+     * Association&lt;String&gt; someAssociation();
+     * </code></pre>
+     * will have the qualified name:
+     * <pre><code>
      * com.somecompany.MyInterface:someAssociation
+     * </code></pre>
      *
      * @return the qualified name of the association
      */

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/common/AppliesTo.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/common/AppliesTo.java b/core/api/src/main/java/org/qi4j/api/common/AppliesTo.java
index d448aad..ccdff03 100644
--- a/core/api/src/main/java/org/qi4j/api/common/AppliesTo.java
+++ b/core/api/src/main/java/org/qi4j/api/common/AppliesTo.java
@@ -27,12 +27,12 @@ import java.lang.annotation.Target;
  * annotation or implement a known interface should use this annotation.
  * <p>
  * &#64;AppliesTo can specify one of;
+ * </p>
  * <ul>
  * <li>An annotation,</li>
  * <li>An interface,</li>
  * <li>An AppliesToFilter implementation.</li>
  * </ul>
- * </p>
  * <p>
  * Example with annotation:
  * </p>

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/common/AppliesToFilter.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/common/AppliesToFilter.java b/core/api/src/main/java/org/qi4j/api/common/AppliesToFilter.java
index 4d008f4..2a07c00 100644
--- a/core/api/src/main/java/org/qi4j/api/common/AppliesToFilter.java
+++ b/core/api/src/main/java/org/qi4j/api/common/AppliesToFilter.java
@@ -26,7 +26,8 @@ import java.lang.reflect.Method;
  * <p>
  * The starting point is the basic use of AppliesToFilter, where the &#64;AppliesTo annotation is given an
  * AppliesToFilter implementation as an argument, for instance at a Mixin implementation;
- * <pre></code>
+ * </p>
+ * <pre><code>
  * &#64;AppliesTo( MyAppliesToFilter.class )
  * public class SomeMixin
  *     implements InvocationHandler
@@ -43,6 +44,7 @@ import java.lang.reflect.Method;
  *     }
  * }
  * </code></pre>
+ * <p>
  * In the case above, the generic mixin will only be applied to the methods that that is defined by the
  * AppliesToFilter. This is the primary way to define limits on the application of generic fragments, since
  * especially mixins are rarely applied to all methods.

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/common/MetaInfo.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/common/MetaInfo.java b/core/api/src/main/java/org/qi4j/api/common/MetaInfo.java
index 3313e60..b746711 100644
--- a/core/api/src/main/java/org/qi4j/api/common/MetaInfo.java
+++ b/core/api/src/main/java/org/qi4j/api/common/MetaInfo.java
@@ -43,19 +43,19 @@ import static org.qi4j.api.util.Classes.typesOf;
  * To set the MetaInfo on a Composite, call the {@code setMetaInfo()} methods on the various composite declaration
  * types, such as;
  * </p>
- * <code><pre>
+ * <pre><code>
  * public void assemble( ModuleAssembly module )
  *     throws AssemblyException
  * {
- *     Map<String,String> properties = ...;
+ *     Map&lt;String,String&gt; properties = ...;
  *     module.services( MyService.class ).setMetaInfo( properties );
  * }
- * </pre></code>
+ * </code></pre>
  * <p>
  * which can later be retrieved by calling the {@code metaInfo()} method on the composite itself. For the example
  * above that would be;
  * </p>
- * <code><pre>
+ * <pre><code>
  * &#64;Mixins(MyServiceMixin.class)
  * public interface MyService extends ServiceComposite
  * {
@@ -72,8 +72,7 @@ import static org.qi4j.api.util.Classes.typesOf;
  *         props = metaInfo( Map.class );
  *     }
  * }
- * </pre></code>
- * <p>
+ * </code></pre>
  */
 public final class MetaInfo
 {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/common/UseDefaults.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/common/UseDefaults.java b/core/api/src/main/java/org/qi4j/api/common/UseDefaults.java
index bf0f008..0f61ea1 100644
--- a/core/api/src/main/java/org/qi4j/api/common/UseDefaults.java
+++ b/core/api/src/main/java/org/qi4j/api/common/UseDefaults.java
@@ -52,22 +52,22 @@ import java.lang.annotation.Target;
  * Example;
  * Let's assume that we have the following mixin type;
  *
- * <code><pre>
+ * <pre><code>
  * public interface SomeType
  * {
  *     &#64;UseDefaults
- *     Property<String> someValue();
+ *     Property&lt;String&gt; someValue();
  * }
- * </pre></code>
+ * </code></pre>
  * And that we want to have {@code someValue()} to be initialized to "&lt;unknown&gt;" instead of the empty string.
  * Then we need to declare the default for that with the following in the assembler.
- * <code><pre>
+ * <pre><code>
  * public void assemble( ModuleAssembly module )
  * {
  *     module.forMixin( SomeType.class ).declareDefaults().someValue().set( "&lt;unknown&gt;" );
  * }
  * }
- * </pre></code>
+ * </code></pre>
  */
 @Retention( RetentionPolicy.RUNTIME )
 @Target( { ElementType.METHOD, ElementType.FIELD } )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/composite/AmbiguousTypeException.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/composite/AmbiguousTypeException.java b/core/api/src/main/java/org/qi4j/api/composite/AmbiguousTypeException.java
index 79ef8b3..34f3653 100644
--- a/core/api/src/main/java/org/qi4j/api/composite/AmbiguousTypeException.java
+++ b/core/api/src/main/java/org/qi4j/api/composite/AmbiguousTypeException.java
@@ -23,7 +23,7 @@ package org.qi4j.api.composite;
  * <p>
  * For instance;
  * </p>
- * <code><pre>
+ * <pre><code>
  * public interface AbcComposite extends TransientComposite, Abc
  * {}
  *
@@ -38,7 +38,7 @@ package org.qi4j.api.composite;
  *
  *
  * TransientBuilder cb = factory.newTransientBuilder( Abc.class );
- * </pre></code>
+ * </code></pre>
  * <p>
  * In the code above, both the AbcComposite and DefComposite implement Abc, and therefore
  * the <code>newTransientBuilder</code> method can not unambiguously figure out which

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/composite/Composite.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/composite/Composite.java b/core/api/src/main/java/org/qi4j/api/composite/Composite.java
index d3155f3..91662fb 100644
--- a/core/api/src/main/java/org/qi4j/api/composite/Composite.java
+++ b/core/api/src/main/java/org/qi4j/api/composite/Composite.java
@@ -19,12 +19,14 @@ import org.qi4j.api.property.PropertyMixin;
 
 /**
  * Base Composite interface.
- * 
+ * <p>
  * All Composite objects must implement this interface. Let the
  * Composite interface extend this one. An implementation will be provided
  * by the framework.
- * <p/>
+ * </p>
+ * <p>
  * Properties and associations are handled by default.
+ * </p>
  */
 @Mixins( { PropertyMixin.class } )
 public interface Composite

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/composite/CompositeInvoker.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/composite/CompositeInvoker.java b/core/api/src/main/java/org/qi4j/api/composite/CompositeInvoker.java
index e585a38..5bd8d11 100644
--- a/core/api/src/main/java/org/qi4j/api/composite/CompositeInvoker.java
+++ b/core/api/src/main/java/org/qi4j/api/composite/CompositeInvoker.java
@@ -17,12 +17,14 @@ import java.lang.reflect.Method;
 
 /**
  * Composite method invoker.
- *
+ * <p>
  * All composites must implement this interface. Methods that are invoked
  * may reside either in the public Composite interface or in any internal mixins.
- *
- * <b><i>NOTE:</i></i></b>Client code should never use method in this class. We have not been able to hide this
- * from client code, but IF we find a way to do, this interface may disappear.</b>
+ * </p>
+ * <p>
+ * <strong><i>NOTE:</i></strong>Client code should never use method in this class. We have not been able to hide this
+ * from client code, but IF we find a way to do, this interface may disappear.
+ * </p>
  */
 public interface CompositeInvoker
 {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/composite/DecoratorMixin.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/composite/DecoratorMixin.java b/core/api/src/main/java/org/qi4j/api/composite/DecoratorMixin.java
index 9f50cc1..6b81844 100644
--- a/core/api/src/main/java/org/qi4j/api/composite/DecoratorMixin.java
+++ b/core/api/src/main/java/org/qi4j/api/composite/DecoratorMixin.java
@@ -26,10 +26,11 @@ import org.qi4j.api.injection.scope.Uses;
 /**
  * Generic decorator mixin that allows a Composite to wrap
  * any other Composite as long as they share an interface.
- * <p/>
+ * <p>
  * Can be used to effectively implement
  * singleton mixins, since the decorated object can be shared between
  * many instances.
+ * </p>
  */
 public class DecoratorMixin
     implements InvocationHandler

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/concern/ConcernOf.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/concern/ConcernOf.java b/core/api/src/main/java/org/qi4j/api/concern/ConcernOf.java
index 26d1460..33cdd01 100644
--- a/core/api/src/main/java/org/qi4j/api/concern/ConcernOf.java
+++ b/core/api/src/main/java/org/qi4j/api/concern/ConcernOf.java
@@ -23,11 +23,13 @@ import org.qi4j.api.concern.internal.ConcernFor;
  * Base class for Concerns. It introduces a typed "next" pointer
  * that Concerns can use to invoke the next Concern (or mixin) in
  * the chain.
- * <p/>
+ * <p>
  * Generic Concerns should subclass {@link GenericConcern} instead.
- * <p/>
+ * </p>
+ * <p>
  * Concerns implementations must be thread-safe in their implementation,
  * as multiple threads may share instances.
+ * </p>
  */
 public abstract class ConcernOf<T>
 {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/concern/internal/ConcernFor.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/concern/internal/ConcernFor.java b/core/api/src/main/java/org/qi4j/api/concern/internal/ConcernFor.java
index df71f77..de3e1b4 100644
--- a/core/api/src/main/java/org/qi4j/api/concern/internal/ConcernFor.java
+++ b/core/api/src/main/java/org/qi4j/api/concern/internal/ConcernFor.java
@@ -25,27 +25,28 @@ import org.qi4j.api.injection.InjectionScope;
  * This annotation is required once in each Concern, to mark the
  * field where the next element in the call sequence should be
  * injected.
- * <p/>
+ * <p>
  * The type of the field must be of the same type as the Concern
  * itself, or an InvocationHandler.
- * <p/>
- * <p/>
+ * </p>
+ * <p>
  * Example;
+ * </p>
  * <pre><code>
  * public interface MyStuff
  * {
  *     void doSomething();
  * }
- * <p/>
+ *
  * public class MyStuffConcern
  *     implements MyStuff
  * {
  *     &#64;ConcernFor MyStuff next;
- * <p/>
+ *
  *     public void doSomething()
  *     {
  *         // HERE DO THE MODIFIER STUFF.
- * <p/>
+ *
  *         // Delegate to the underlying mixin/modifier.
  *         next.doSomething();
  *     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/configuration/Configuration.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/configuration/Configuration.java b/core/api/src/main/java/org/qi4j/api/configuration/Configuration.java
index e2fbea7..52ec60f 100644
--- a/core/api/src/main/java/org/qi4j/api/configuration/Configuration.java
+++ b/core/api/src/main/java/org/qi4j/api/configuration/Configuration.java
@@ -39,15 +39,16 @@ import static org.qi4j.functional.Iterables.first;
 /**
  * Provide Configurations for Services. A Service that wants to be configurable
  * should inject a reference to Configuration with the Configuration type:
- * <code><pre>
- * <p/>
- * &#64;This Configuration&#60;MyServiceConfiguration&#62; config;
- * </pre></code>
+ * <pre><code>
+ *  * &#64;This Configuration&#60;MyServiceConfiguration&#62; config;
+ * </code></pre>
+ * <p>
  * where MyServiceConfiguration extends {@link ConfigurationComposite}, which itself is an ordinary
  * {@link org.qi4j.api.entity.EntityComposite}. The Configuration implementation
  * will either locate an instance of the given Configuration type in the
  * persistent store using the identity of the Service, or create a new such instance
  * if one doesn't already exist.
+ * </p>
  * <p>
  * If a new Configuration instance is created then it will be populated with properties
  * from the properties file whose filesystem name is the same as the identity (e.g. "MyService.properties").
@@ -68,6 +69,7 @@ import static org.qi4j.functional.Iterables.first;
  * <p>
  * The user configuration entity is part of a long running {@link UnitOfWork}, and to persist changes to it the
  * {@link #save()} method must be called. No other actions are required. Example;
+ * </p>
  * <pre><code>
  *
  * public interface MyConfiguration extends ConfigurationComposite
@@ -85,10 +87,12 @@ import static org.qi4j.functional.Iterables.first;
  *     config.save();
  * }
  * </code></pre>
+ * <p>
  * And even if a separate thread is using the {@code timeout()} configuration when this is happening, the
  * {@link UnitOfWork} isolation will ensure that the other thread is not affected. That thread, on the other hand
  * will need to do a {@link #refresh()} at an appropriate time to pick up the timeout change. For instance;
- * <code><pre>
+ * </p>
+ * <pre><code>
  *
  * &#64;Service InventoryService remoteInventoryService;
  *
@@ -102,15 +106,14 @@ import static org.qi4j.functional.Iterables.first;
  *     :
  *     :
  * }
- * </pre></code>
- * </p>
+ * </code></pre>
+ *
  */
 @Mixins( Configuration.ConfigurationMixin.class )
 public interface Configuration<T>
 {
     /**
      * Retrieves the user configuration instance managed by this Configuration.
-     * <p/>
      * <p>
      * Even if the user configuration is initialized from properties file, the consistency rules of Qi4j composites
      * still applies. If the the properties file is missing a value, then the initialization will fail with a
@@ -132,9 +135,6 @@ public interface Configuration<T>
 
     /**
      * Persists the modified values in the user configuration instance to the underlying store.
-     * <p>
-     *
-     * </p>
      */
     void save();
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/constraint/ConstraintViolationException.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/constraint/ConstraintViolationException.java b/core/api/src/main/java/org/qi4j/api/constraint/ConstraintViolationException.java
index 76efa4c..28e41b3 100644
--- a/core/api/src/main/java/org/qi4j/api/constraint/ConstraintViolationException.java
+++ b/core/api/src/main/java/org/qi4j/api/constraint/ConstraintViolationException.java
@@ -38,10 +38,6 @@ import org.qi4j.functional.Iterables;
  * violations, together with the Composite instance it happened on as well as the Method that
  * was invoked. The Exception also has support for localized messages of these violations.
  * </p>
- * <p>
- * <b>This class is still under evolution. Beware that the methods, formatting, Locale spec may
- * change. It will be stable before the 1.0 release.
- * </p>
  */
 public class ConstraintViolationException
     extends IllegalArgumentException
@@ -95,13 +91,15 @@ public class ConstraintViolationException
 
     /**
      * Creates localized messages of all the constraint violations that has occured.
-     * <p/>
-     * The key &nbsp;"<code>Qi4j_ConstraintViolation_<i><strong>CompositeType</strong></code></i>" will be used to lookup the text formatting
+     * <p>
+     * The key "<code>Qi4j_ConstraintViolation_<i><strong>CompositeType</strong></i></code>" will be used to lookup the text formatting
      * pattern from the ResourceBundle, where <strong><code><i>CompositeType</i></code></strong> is the
      * class name of the Composite where the constraint was violated. If such key does not exist, then the
      * key &nbsp;"<code>Qi4j_ConstraintViolation</code>" will be used, and if that one also doesn't exist, or
      * the resourceBundle argument is null, then the default patterns will be used;
-     * <table><tr><th>Type of Composite</th><th>Pattern used</th></tr>
+     * </p>
+     * <table summary="Localization of constraint vioations.">
+     * <tr><th>Type of Composite</th><th>Pattern used</th></tr>
      * <tr><td>Composite</td>
      * <td><code>Constraint Violation in {2}.{3} with constraint {4}, in composite \n{0} of type {1}</code></td>
      * </tr>
@@ -113,7 +111,7 @@ public class ConstraintViolationException
      * </tr>
      * </table>
      * Then format each ConstraintViolation according to such pattern, where the following argument are passed;
-     * <table><tr><th>Arg</th><th>Value</th></tr>
+     * <table summary="List of arguments available."><tr><th>Arg</th><th>Value</th></tr>
      * <tr>
      * <td>{0}</td>
      * <td>Composite instance toString()</td>
@@ -139,8 +137,9 @@ public class ConstraintViolationException
      * <td>toString() of value passed as the argument, or "null" text if argument was null.</td>
      * </tr>
      * </table>
-     * <p/>
+     * <p>
      * <b>NOTE!!!</b> This class is still under construction and will be modified further.
+     * </p>
      *
      * @param bundle The ResourceBundle for Localization, or null if default formatting and locale to be used.
      *
@@ -183,7 +182,7 @@ public class ConstraintViolationException
             String name = violation.name();
             Object value = violation.value();
             String classes;
-            if( Iterables.count( instanceTypes) == 1 )
+            if( Iterables.count( instanceTypes ) == 1 )
             {
                 classes = Iterables.first( instanceTypes ).getSimpleName();
             }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/constraint/Constraints.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/constraint/Constraints.java b/core/api/src/main/java/org/qi4j/api/constraint/Constraints.java
index 079df4c..b42701c 100644
--- a/core/api/src/main/java/org/qi4j/api/constraint/Constraints.java
+++ b/core/api/src/main/java/org/qi4j/api/constraint/Constraints.java
@@ -23,8 +23,9 @@ import java.lang.annotation.Target;
 /**
  * This annotation is used by composites and mixins to declare what Constraints
  * can be applied in the Composite.
- * <p/>
+ * <p>
  * Constraints implement the {@link Constraint} interface
+ * </p>
  */
 @Retention( RetentionPolicy.RUNTIME )
 @Target( { ElementType.TYPE } )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/entity/Identity.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/entity/Identity.java b/core/api/src/main/java/org/qi4j/api/entity/Identity.java
index 9dce884..0c82ca9 100644
--- a/core/api/src/main/java/org/qi4j/api/entity/Identity.java
+++ b/core/api/src/main/java/org/qi4j/api/entity/Identity.java
@@ -29,10 +29,10 @@ public interface Identity
 {
     /**
      * Returns the client view of the identity.
-     * <p/>
+     * <p>
      * It is unique within the owning repository, but potentially not unique globally and between
      * types.
-     *
+     * </p>
      * @return The Identity of 'this' composite.
      */
     @Immutable

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/entity/Lifecycle.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/entity/Lifecycle.java b/core/api/src/main/java/org/qi4j/api/entity/Lifecycle.java
index 0a7400e..650f456 100644
--- a/core/api/src/main/java/org/qi4j/api/entity/Lifecycle.java
+++ b/core/api/src/main/java/org/qi4j/api/entity/Lifecycle.java
@@ -16,21 +16,23 @@ package org.qi4j.api.entity;
 
 /**
  * Lifecycle interface for all Composites.
- * <p/>
+ * <p>
  * This Lifecycle interface is a built-in feature of the Qi4j runtime, similar to the Initializable interface.
  * Any Mixin that implements this interface AND is part of an EntityComposite will have these two methods called
  * upon creation/removal of the EntityComposite instance to/from the EntityStore. Meaning, the create method is called
  * only when the identifiable EntityComposite is created the first time, and not when it is read from its persisted
  * state and created into memory.
- * <p/>
+ * </p>
+ * <p>
  * Example;
- * <code><pre>
+ * </p>
+ * <pre><code>
  * public interface System
  * {
  *     Property&lt;User&gt; admin();
  * }
  *
- * public class SystemAdminMixin<LifeCycle>
+ * public class SystemAdminMixin&lt;LifeCycle&gt;
  *     implements System, Lifecyle, ...
  * {
  *      &#64;Structure private UnitOfWork uow;
@@ -54,17 +56,17 @@ package org.qi4j.api.entity;
  * public interface SystemEntity extends System, EntityComposite
  * {}
  *
- * </pre></code>
+ * </code></pre>
  */
 public interface Lifecycle
 {
 
     /**
      * Creation callback method.
-     * <p/>
+     * <p>
      * Called by the Qi4j runtime before the newInstance of the entity completes, before the constraints are checked,
      * allowing for additional initialization.
-     *
+     * </p>
      * @throws LifecycleException if the entity could not be created
      */
     void create()
@@ -72,10 +74,10 @@ public interface Lifecycle
 
     /**
      * Removal callback method.
-     * <p/>
+     * <p>
      * Called by the Qi4j runtime before the entity is removed from the system, allowing
      * for clean-up operations.
-     *
+     * </p>
      * @throws LifecycleException if the entity could not be removed
      */
     void remove()

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/injection/scope/Invocation.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/injection/scope/Invocation.java b/core/api/src/main/java/org/qi4j/api/injection/scope/Invocation.java
index 3e0259b..230e5c9 100644
--- a/core/api/src/main/java/org/qi4j/api/injection/scope/Invocation.java
+++ b/core/api/src/main/java/org/qi4j/api/injection/scope/Invocation.java
@@ -35,11 +35,11 @@ import org.qi4j.api.injection.InjectionScope;
  *  - An Annotation of a specific type
  * </code></pre>
  * Examples:
- * <code><pre>
+ * <pre><code>
  * &#64;Invocation Method theInvokedMethod
  * &#64;Invocation AnnotationElement annotations
  * &#64;Invocation Matches matchesAnnotation
- * </pre></code>
+ * </code></pre>
  */
 @Retention( RetentionPolicy.RUNTIME )
 @Target( { ElementType.FIELD, ElementType.PARAMETER } )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/injection/scope/Service.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/injection/scope/Service.java b/core/api/src/main/java/org/qi4j/api/injection/scope/Service.java
index 7c74a56..6116cc1 100644
--- a/core/api/src/main/java/org/qi4j/api/injection/scope/Service.java
+++ b/core/api/src/main/java/org/qi4j/api/injection/scope/Service.java
@@ -23,14 +23,15 @@ import org.qi4j.api.injection.InjectionScope;
 
 /**
  * Annotation to denote the injection of a service dependency into a Fragment.
- * <p/>
+ * <p>
  * Examples:
- * <code><pre>
+ * </p>
+ * <pre><code>
  * &#64;Service MyService service
- * &#64;Service Iterable<MyService> services
- * &#64;Service ServiceReference<MyService> serviceRef
- * &#64;Service Iterable<ServiceReference<MyService>> serviceRefs
- * </pre></code>
+ * &#64;Service Iterable&lt;MyService&gt; services
+ * &#64;Service ServiceReference&lt;MyService&gt; serviceRef
+ * &#64;Service Iterable&lt;ServiceReference&lt;MyService&gt;&gt; serviceRefs
+ * </code></pre>
  */
 @Retention( RetentionPolicy.RUNTIME )
 @Target( { ElementType.FIELD, ElementType.PARAMETER } )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/injection/scope/State.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/injection/scope/State.java b/core/api/src/main/java/org/qi4j/api/injection/scope/State.java
index 80ef8db..ec3c52a 100644
--- a/core/api/src/main/java/org/qi4j/api/injection/scope/State.java
+++ b/core/api/src/main/java/org/qi4j/api/injection/scope/State.java
@@ -24,10 +24,10 @@ import org.qi4j.api.injection.InjectionScope;
  * Annotation to denote the injection of a property, association or
  * StateHolder.
  * <pre><code>
- * &#64;State Property<String> propertyName;
- * &#64;State Association<MyEntity> associationName;
- * &#64;State ManyAssociation<MyEntity> manyAssociationName;
- * &#64;State NamedAssociation<MyEntity> namedAssociationName;
+ * &#64;State Property&lt;StringState propertyName;
+ * &#64;State Association&lt;MyEntityState associationName;
+ * &#64;State ManyAssociation&lt;MyEntityState manyAssociationName;
+ * &#64;State NamedAssociation&lt;MyEntityState namedAssociationName;
  * &#64;State StateHolder state;
  * &#64;State AssociationStateHolder associationState;
  * </code></pre>

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/injection/scope/Structure.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/injection/scope/Structure.java b/core/api/src/main/java/org/qi4j/api/injection/scope/Structure.java
index 80b741b..252af5e 100644
--- a/core/api/src/main/java/org/qi4j/api/injection/scope/Structure.java
+++ b/core/api/src/main/java/org/qi4j/api/injection/scope/Structure.java
@@ -25,9 +25,10 @@ import org.qi4j.api.injection.InjectionScope;
  * Annotation to denote the injection of a
  * resource specific for the module which the
  * injected object/fragment is instantiated in.
- * <p/>
+ * <p>
  * Valid types are:
- * <code><pre>
+ * </p>
+ * <pre><code>
  * - TransientBuilderFactory
  * - ObjectBuilderFactory
  * - UnitOfWorkFactory
@@ -37,7 +38,7 @@ import org.qi4j.api.injection.InjectionScope;
  * - Application
  * - Qi4j
  * - Qi4jSPI
- * </pre></code>
+ * </code></pre>
  */
 @Retention( RetentionPolicy.RUNTIME )
 @Target( { ElementType.FIELD, ElementType.PARAMETER } )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/injection/scope/This.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/injection/scope/This.java b/core/api/src/main/java/org/qi4j/api/injection/scope/This.java
index 26ff7cb..4d806d0 100644
--- a/core/api/src/main/java/org/qi4j/api/injection/scope/This.java
+++ b/core/api/src/main/java/org/qi4j/api/injection/scope/This.java
@@ -24,12 +24,14 @@ import org.qi4j.api.injection.InjectionScope;
 /**
  * Annotation to denote the injection of a reference to the same Composite
  * as the fragment is a part of.
- * <p/>
+ * <p>
  * If the Composite type does not implement the type of the field or parameter
  * then it will be referencing a private mixin.
- * <p/>
+ * </p>
+ * <p>
  * Calls to the reference will have the same semantics as calls to the Composite itself.
  * Specifically the same set of Modifiers will be used.
+ * </p>
  */
 @Retention( RetentionPolicy.RUNTIME )
 @Target( { ElementType.FIELD, ElementType.PARAMETER } )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/metrics/MetricsCounterFactory.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/metrics/MetricsCounterFactory.java b/core/api/src/main/java/org/qi4j/api/metrics/MetricsCounterFactory.java
index 73d82fe..caa2915 100644
--- a/core/api/src/main/java/org/qi4j/api/metrics/MetricsCounterFactory.java
+++ b/core/api/src/main/java/org/qi4j/api/metrics/MetricsCounterFactory.java
@@ -29,8 +29,6 @@ public interface MetricsCounterFactory extends MetricsFactory
      * @param name   A human readable, short name of the metric.
      *
      * @return A Metric instance to be used, OR org.qi4j.spi.metrics.DefaultMetric.NULL if not supported.
-     *
-     * @see DefaultMetric
      */
     MetricsCounter createCounter( Class<?> origin, String name );
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/metrics/MetricsHealthCheckFactory.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/metrics/MetricsHealthCheckFactory.java b/core/api/src/main/java/org/qi4j/api/metrics/MetricsHealthCheckFactory.java
index 12b913d..12decc5 100644
--- a/core/api/src/main/java/org/qi4j/api/metrics/MetricsHealthCheckFactory.java
+++ b/core/api/src/main/java/org/qi4j/api/metrics/MetricsHealthCheckFactory.java
@@ -31,7 +31,6 @@ public interface MetricsHealthCheckFactory extends MetricsFactory
      *
      * @return A MetricsHealthCheck instance to be used, OR org.qi4j.spi.metrics.DefaultMetric.NULL if not supported.
      *
-     * @see DefaultMetric
      */
     MetricsHealthCheck registerHealthCheck( Class<?> origin, String name, MetricsHealthCheck check );
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/metrics/MetricsHistogramFactory.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/metrics/MetricsHistogramFactory.java b/core/api/src/main/java/org/qi4j/api/metrics/MetricsHistogramFactory.java
index c9f3f27..ab62508 100644
--- a/core/api/src/main/java/org/qi4j/api/metrics/MetricsHistogramFactory.java
+++ b/core/api/src/main/java/org/qi4j/api/metrics/MetricsHistogramFactory.java
@@ -30,7 +30,6 @@ public interface MetricsHistogramFactory extends MetricsFactory
      *
      * @return A Metric instance to be used, OR org.qi4j.spi.metrics.DefaultMetric.NULL if not supported.
      *
-     * @see DefaultMetric
      */
     MetricsHistogram createHistogram( Class<?> origin, String name );
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/metrics/MetricsTimerFactory.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/metrics/MetricsTimerFactory.java b/core/api/src/main/java/org/qi4j/api/metrics/MetricsTimerFactory.java
index 0a6e9ed..18d3e38 100644
--- a/core/api/src/main/java/org/qi4j/api/metrics/MetricsTimerFactory.java
+++ b/core/api/src/main/java/org/qi4j/api/metrics/MetricsTimerFactory.java
@@ -34,7 +34,6 @@ public interface MetricsTimerFactory extends MetricsFactory
      *
      * @return A Metric instance to be used, OR org.qi4j.spi.metrics.DefaultMetric.NULL if not supported.
      *
-     * @see DefaultMetric
      */
     MetricsTimer createTimer( Class<?> origin, String name, TimeUnit duration, TimeUnit rate );
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/mixin/Mixins.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/mixin/Mixins.java b/core/api/src/main/java/org/qi4j/api/mixin/Mixins.java
index 59078a0..e308381 100644
--- a/core/api/src/main/java/org/qi4j/api/mixin/Mixins.java
+++ b/core/api/src/main/java/org/qi4j/api/mixin/Mixins.java
@@ -23,45 +23,50 @@ import java.lang.annotation.Target;
 
 /**
  * This annotation is used in composites to declare mixin implementation classes.
- * <p/>
+ * <p>
  * Mixins tells the runtime which implementation class of a Mixin should be
  * used. The &#64;Mixins annotation can occur at any level in the composite hierarchy
  * and the runtime will match each found Mixin implementation against a Mixins annotation.
  * All mixin interfaces must have a Mixin implementation in the composite hierarchy or
  * a runtime exception will occur.
- * <p/>
+ * </p>
+ * <p>
  * Example;
+ * </p>
  * <pre><code>
- * <p/>
+ *
  * &#64;Mixins( MyBeerOrder.class )
  * public interface BeerOrderComposite extends BeerOrder, Composite
  * {
  * }
- * <p/>
+ *
  * public class MyBeerOrder
  * implements BeerOrder
  * {
  * :
  * }
  * </code></pre>
- * <p/>
+ * <p>
  * Many implementations can be listed,
+ * </p>
  * <pre><code>
  * &#64;Mixins( { MyBeerOrder.class, DescriptionImpl.class } )
  * public interface BeerOrderComposite extends BeerOrder, Description, Composite
  * {
  * }
  * </code></pre>
- * <p/>
+ * <p>
  * If the Mixins is a class that implements InvocationHandler, it will be
  * used for all mixins. To avoid that an invocation handler based implementation
  * not service all mixin, use the AppliesTo annotation.
- * <p/>
- * <p/>
+ * </p>
+ *
+ * <p>
  * It is valid to have multiple Mixins for a mixin. The first one found
  * will be used. The search order is in the order they are written in the Mixins
  * annotation left-to-right, and depth-first recursive search of the super-interfaces again
  * left-to-right.
+ * </p>
  *
  * @see org.qi4j.api.common.AppliesTo
  */

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/property/PropertyDescriptor.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/property/PropertyDescriptor.java b/core/api/src/main/java/org/qi4j/api/property/PropertyDescriptor.java
index 1d5fa6c..aa986b1 100644
--- a/core/api/src/main/java/org/qi4j/api/property/PropertyDescriptor.java
+++ b/core/api/src/main/java/org/qi4j/api/property/PropertyDescriptor.java
@@ -29,8 +29,10 @@ public interface PropertyDescriptor extends MetaInfoHolder
     boolean isImmutable();
 
     /**
-     * Get the qualified name of the property which is equal to:<br/>
-     * <interface name>:<method name>
+     * Get the qualified name of the property which is equal to:
+     * <pre><code>
+     * &lt;interface name&gt;:&lt;method name&gt;
+     * </code></pre>
      *
      * @return the qualified name of the property
      */
@@ -38,7 +40,7 @@ public interface PropertyDescriptor extends MetaInfoHolder
 
     /**
      * Get the type of the property. If the property is declared
-     * as Property<X> then X is returned.
+     * as Property&lt;X&gt; then X is returned.
      *
      * @return the property type
      */

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/query/Query.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/query/Query.java b/core/api/src/main/java/org/qi4j/api/query/Query.java
index 78b7994..504b2e2 100644
--- a/core/api/src/main/java/org/qi4j/api/query/Query.java
+++ b/core/api/src/main/java/org/qi4j/api/query/Query.java
@@ -27,12 +27,15 @@ import org.qi4j.api.query.grammar.OrderBy;
 /**
  * This represents a Query in an indexing system. It is created from a
  * {@link QueryBuilder}, which decides the "where" clause in the query.
+ * <p>
  * Additional limitations, such as paging, ordering, and variables, can be set on
  * a Query before it is executed by calling one of find(), iterator(),
  * or count().
- * <p/>
+ * </p>
+ * <p>
  * DDD tip: typically Queries are created in the Domain Model and passed to the UI,
  * which sets the order and paging before executing it.
+ * </p>
  */
 public interface Query<T>
     extends Iterable<T>, Serializable

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/service/ServiceFinder.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/service/ServiceFinder.java b/core/api/src/main/java/org/qi4j/api/service/ServiceFinder.java
index 398c056..efaaff9 100644
--- a/core/api/src/main/java/org/qi4j/api/service/ServiceFinder.java
+++ b/core/api/src/main/java/org/qi4j/api/service/ServiceFinder.java
@@ -17,8 +17,11 @@ package org.qi4j.api.service;
 import java.lang.reflect.Type;
 
 /**
- * Interface used to query for ServiceReferences. Each ServiceFinder is
+ * Interface used to query for ServiceReferences.
+ * <p>
+ * Each ServiceFinder is
  * obtained from a specific Module, and the lookup rules are the following:
+ * </p>
  * <ol>
  * <li>First look in the same Module as the ServiceFinder</li>
  * <li>Then look in the same Layer as the ServiceFinder. Any Services declared
@@ -26,8 +29,9 @@ import java.lang.reflect.Type;
  * <li>Then look in the used Layers. Any Services declared with Visibility Application
  * should be included</li>
  * </ol>
- *
+ * <p>
  * Both native Qi4j services and imported services are considered, with preference to native services.
+ * </p>
  */
 public interface ServiceFinder
 {
@@ -57,9 +61,10 @@ public interface ServiceFinder
 
     /**
      * Find ServiceReferences that implements the given type.
-     * <p/>
+     * <p>
      * The order of the references is such that Services more local to the querying
      * Module is earlier in the list.
+     * </p>
      *
      * @param serviceType the type that the Services must implement
      *
@@ -69,9 +74,10 @@ public interface ServiceFinder
 
     /**
      * Find ServiceReferences that implements the given type.
-     * <p/>
+     * <p>
      * The order of the references is such that Services more local to the querying
      * Module is earlier in the list.
+     * </p>
      *
      * @param serviceType the type that the Services must implement
      *

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/service/qualifier/Active.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/service/qualifier/Active.java b/core/api/src/main/java/org/qi4j/api/service/qualifier/Active.java
index 4cbccf6..d06a749 100644
--- a/core/api/src/main/java/org/qi4j/api/service/qualifier/Active.java
+++ b/core/api/src/main/java/org/qi4j/api/service/qualifier/Active.java
@@ -21,13 +21,15 @@ import org.qi4j.functional.Specification;
 
 /**
  * Filter services based on whether they are active or not.
- *
+ * <p>
  * At an injection point you can do this:
- *
+ * </p>
  * <pre><code>
- * &#64;Service @Active MyService service;
+ * &#64;Service &#64;Active MyService service;
  * </code></pre>
+ * <p>
  * to get only a service that is currently active.
+ * </p>
  */
 @Retention( RetentionPolicy.RUNTIME )
 @Qualifier( Active.ActiveQualifier.class )
@@ -35,7 +37,7 @@ public @interface Active
 {
     /**
      * Active Annotation Qualifier.
-     * See {@see Active}.
+     * See {@link Active}.
      */
     public final class ActiveQualifier
         implements AnnotationQualifier<Active>

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/service/qualifier/Available.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/service/qualifier/Available.java b/core/api/src/main/java/org/qi4j/api/service/qualifier/Available.java
index e8c23bb..894451d 100644
--- a/core/api/src/main/java/org/qi4j/api/service/qualifier/Available.java
+++ b/core/api/src/main/java/org/qi4j/api/service/qualifier/Available.java
@@ -25,7 +25,7 @@ import org.qi4j.functional.Specification;
  * At an injection point you can do this:
  *
  * <pre><code>
- * &#64;Service @Available MyService service;
+ * &#64;Service &#64;Available MyService service;
  * </code></pre>
  * to get only a service that is currently available.
  */
@@ -35,7 +35,7 @@ public @interface Available
 {
     /**
      * Available Annotation Qualifier.
-     * See {@see Available}.
+     * See {@link Available}.
      */
     public final class AvailableQualifier
         implements AnnotationQualifier<Available>

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/service/qualifier/HasMetaInfo.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/service/qualifier/HasMetaInfo.java b/core/api/src/main/java/org/qi4j/api/service/qualifier/HasMetaInfo.java
index 85087a3..aac0702 100644
--- a/core/api/src/main/java/org/qi4j/api/service/qualifier/HasMetaInfo.java
+++ b/core/api/src/main/java/org/qi4j/api/service/qualifier/HasMetaInfo.java
@@ -20,17 +20,22 @@ import org.qi4j.api.service.ServiceReference;
 import org.qi4j.functional.Specification;
 
 /**
- * Filter services based on Meta Info being declared on the Service. Meta Info of any type can be set on the service
- * during assembly, e.g.;
- * <code><pre>
+ * Filter services based on Meta Info being declared on the Service.
+ * <p>
+ * Meta Info of any type can be set on the service during assembly, e.g.;
+ * </p>
+ * <pre><code>
  * module.addService( MyService.class ).setMetaInfo( new MyCustomInfo(someData) );
- * </pre></code>
- * <p/>
+ * </code></pre>
+ * <p>
  * and then at an injection point you can do this:
- * <code><pre>
+ * </p>
+ * <pre><code>
  * &#64;Service &#64;HasMetaInfo(MyCustomInfo.class) MyService service;
- * </pre></code>
+ * </code></pre>
+ * <p>
  * to get only a service that has a MyCustomInfo instance set as meta info.
+ * </p>
  */
 @Retention( RetentionPolicy.RUNTIME )
 @Qualifier( HasMetaInfo.HasMetaInfoQualifier.class )
@@ -57,7 +62,7 @@ public @interface HasMetaInfo
 
     /**
      * HasMetaInfo Annotation Qualifier.
-     * See {@see HasMetaInfo}.
+     * See {@link HasMetaInfo}.
      */
     public static class HasMetaInfoQualifier
         implements AnnotationQualifier<HasMetaInfo>

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/service/qualifier/IdentifiedBy.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/service/qualifier/IdentifiedBy.java b/core/api/src/main/java/org/qi4j/api/service/qualifier/IdentifiedBy.java
index 1e30038..2c715d7 100644
--- a/core/api/src/main/java/org/qi4j/api/service/qualifier/IdentifiedBy.java
+++ b/core/api/src/main/java/org/qi4j/api/service/qualifier/IdentifiedBy.java
@@ -39,7 +39,7 @@ public @interface IdentifiedBy
 
     /**
      * IdentifiedBy Annotation Qualifier.
-     * See {@see IdentifiedBy}.
+     * See {@link IdentifiedBy}.
      */
     public final class IdentifiedByQualifier
         implements AnnotationQualifier<IdentifiedBy>

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/service/qualifier/ServiceQualifier.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/service/qualifier/ServiceQualifier.java b/core/api/src/main/java/org/qi4j/api/service/qualifier/ServiceQualifier.java
index a43a0b8..75410d6 100644
--- a/core/api/src/main/java/org/qi4j/api/service/qualifier/ServiceQualifier.java
+++ b/core/api/src/main/java/org/qi4j/api/service/qualifier/ServiceQualifier.java
@@ -19,20 +19,26 @@ import org.qi4j.functional.Specification;
 
 /**
  * This class helps you select a particular service
- * from a list. Provide a Selector which does the actual
+ * from a list.
+ * <p>
+ * Provide a Selector which does the actual
  * selection from the list. A common case is to select
  * based on identity of the service, which you can do this way:
+ * </p>
  *
  * <pre><code>
- * new ServiceQualifier<MyService>(services, ServiceQualifier.withId("someId"))
+ * new ServiceQualifier&lt;MyService&gt;(services, ServiceQualifier.withId("someId"))
  * </code></pre>
- *
+ * <p>
  * Many selectors can be combined by using firstOf. Example:
+ * </p>
  * <pre><code>
- * new ServiceQualifier<MyService>(services, firstOf(withTags("sometag"), firstActive(), first()))
+ * new ServiceQualifier&lt;MyService&gt;(services, firstOf(withTags("sometag"), firstActive(), first()))
  * </code></pre>
+ * <p>
  * This will pick a service that has the tag "sometag", or if none is found take the first active one. If no
  * service is active, then the first service will be picked.
+ * </p>
  */
 public abstract class ServiceQualifier
 {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/service/qualifier/Tagged.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/service/qualifier/Tagged.java b/core/api/src/main/java/org/qi4j/api/service/qualifier/Tagged.java
index 33f5a02..3c8c0b7 100644
--- a/core/api/src/main/java/org/qi4j/api/service/qualifier/Tagged.java
+++ b/core/api/src/main/java/org/qi4j/api/service/qualifier/Tagged.java
@@ -28,7 +28,7 @@ import org.qi4j.functional.Specification;
  * and then at an injection point you can do this:
  *
  * <pre><code>
- * &#64;Service @Tagged("onetag") MyService service;
+ * &#64;Service &#64;Tagged("onetag") MyService service;
  * </code></pre>
  * to get only a service tagged with MyService. If several match only the first match is used.
  */
@@ -40,7 +40,7 @@ public @interface Tagged
 
     /**
      * Tagged Annotation Qualifier.
-     * See {@see Tagged}.
+     * See {@link Tagged}.
      */
     public final class TaggedQualifier
         implements AnnotationQualifier<Tagged>

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/service/qualifier/package.html
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/service/qualifier/package.html b/core/api/src/main/java/org/qi4j/api/service/qualifier/package.html
index 1647b16..103541e 100644
--- a/core/api/src/main/java/org/qi4j/api/service/qualifier/package.html
+++ b/core/api/src/main/java/org/qi4j/api/service/qualifier/package.html
@@ -27,16 +27,16 @@
         </blockquote>
         <p>
             Let's say these SomeImportedService are only sometimes available. Then whenever iterator() is called the
-            {@see org.qi4j.api.service.qualifier.Active} tag can kick in and filter out those whose
+            {@link org.qi4j.api.service.qualifier.Active} tag can kick in and filter out those whose
             ServiceReference.isActive() returns false.
         </p>
         <p>Standard ones defined in the API are:</p>
         <ul>
-            <li>{@see org.qi4j.api.service.qualifier.Active}</li>
-            <li>{@see org.qi4j.api.service.qualifier.Available}</li>
-            <li>{@see org.qi4j.api.service.qualifier.HasMetaInfo}</li>
-            <li>{@see org.qi4j.api.service.qualifier.IdentifiedBy}</li>
-            <li>{@see org.qi4j.api.service.qualifier.Tagged}</li>
+            <li>{@link org.qi4j.api.service.qualifier.Active}</li>
+            <li>{@link org.qi4j.api.service.qualifier.Available}</li>
+            <li>{@link org.qi4j.api.service.qualifier.HasMetaInfo}</li>
+            <li>{@link org.qi4j.api.service.qualifier.IdentifiedBy}</li>
+            <li>{@link org.qi4j.api.service.qualifier.Tagged}</li>
         </ul>
         <p>See tests and API for more examples, and how to implement your own qualifiers.</p>
     </body>

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/sideeffect/SideEffectOf.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/sideeffect/SideEffectOf.java b/core/api/src/main/java/org/qi4j/api/sideeffect/SideEffectOf.java
index f1a73a4..39113cc 100644
--- a/core/api/src/main/java/org/qi4j/api/sideeffect/SideEffectOf.java
+++ b/core/api/src/main/java/org/qi4j/api/sideeffect/SideEffectOf.java
@@ -22,11 +22,13 @@ import org.qi4j.api.sideeffect.internal.SideEffectFor;
 /**
  * Base class for SideEffects. It introduces a typed "next" pointer
  * that SideEffects can use to get the result of the original invocation.
- * <p/>
+ * <p>
  * Generic SideEffects should subclass {@link GenericSideEffect} instead.
- * <p/>
+ * </p>
+ * <p>
  * SideEffects implementations must be thread-safe in their implementation,
  * as multiple threads may share instances.
+ * </p>
  */
 public abstract class SideEffectOf<T>
 {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/sideeffect/SideEffects.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/sideeffect/SideEffects.java b/core/api/src/main/java/org/qi4j/api/sideeffect/SideEffects.java
index e218f61..bd2e525 100644
--- a/core/api/src/main/java/org/qi4j/api/sideeffect/SideEffects.java
+++ b/core/api/src/main/java/org/qi4j/api/sideeffect/SideEffects.java
@@ -23,7 +23,6 @@ import java.lang.annotation.Target;
 /**
  * This annotation is used by composites and mixins to declare what SideEffects
  * should apply to the type or specific method.
- * <p/>
  */
 @Retention( RetentionPolicy.RUNTIME )
 @Target( { ElementType.TYPE, ElementType.METHOD } )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/sideeffect/internal/SideEffectFor.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/sideeffect/internal/SideEffectFor.java b/core/api/src/main/java/org/qi4j/api/sideeffect/internal/SideEffectFor.java
index 3193516..1ab3383 100644
--- a/core/api/src/main/java/org/qi4j/api/sideeffect/internal/SideEffectFor.java
+++ b/core/api/src/main/java/org/qi4j/api/sideeffect/internal/SideEffectFor.java
@@ -25,36 +25,37 @@ import org.qi4j.api.injection.InjectionScope;
  * This annotation is required once in each SideEffect, to mark the
  * field where the element providing the invocation result should be
  * injected.
- * <p/>
+ * <p>
  * The type of the field must be of the same type as the SideEffect
  * itself, or an InvocationHandler.
- * <p/>
- * <p/>
+ * </p>
+ * <p>
  * Example;
+ * </p>
  * <pre><code>
  * public interface MyStuff
  * {
  *     SomeResult doSomething();
  * }
- * <p/>
+ *
  * public class MyStuffSideEffect
  *     implements MyStuff
  * {
  *     &#64;SideEffectFor MyStuff next;
- * <p/>
+ *
  *     public SomeResult doSomething()
  *     {
  *          SomeResult result = next.doSomething();
- * <p/>
+ *
  *         // HERE DO THE SIDEEFFECT STUFF.
- * <p/>
+ *
  *          return result; // Result value is ignored, null would work too.
  *     }
  * }
  * </code></pre>
  */
-@Retention( RetentionPolicy.RUNTIME )
-@Target( { ElementType.FIELD, ElementType.PARAMETER } )
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ ElementType.FIELD, ElementType.PARAMETER })
 @Documented
 @InjectionScope
 public @interface SideEffectFor

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/unitofwork/UnitOfWork.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/unitofwork/UnitOfWork.java b/core/api/src/main/java/org/qi4j/api/unitofwork/UnitOfWork.java
index 68cccf6..8af1db2 100644
--- a/core/api/src/main/java/org/qi4j/api/unitofwork/UnitOfWork.java
+++ b/core/api/src/main/java/org/qi4j/api/unitofwork/UnitOfWork.java
@@ -101,12 +101,16 @@ public interface UnitOfWork extends MetaInfoHolder, AutoCloseable
 //    DataSet newDataSetBuilder(Specification<?>... constraints);
 
     /**
-     * Create a new Entity which implements the given mixin type. An EntityComposite
+     * Create a new Entity which implements the given mixin type.
+     * <p>
+     * An EntityComposite
      * will be chosen according to what has been registered and the visibility rules
      * for Modules and Layers will be considered. If several
      * EntityComposites implement the type then an AmbiguousTypeException will be thrown.
-     * <p/>
+     * </p>
+     * <p>
      * The identity of the Entity will be generated by the IdentityGenerator of the Module of the EntityComposite.
+     * </p>
      *
      * @param type the mixin type that the EntityComposite must implement
      *

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/unitofwork/UnitOfWorkFactory.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/unitofwork/UnitOfWorkFactory.java b/core/api/src/main/java/org/qi4j/api/unitofwork/UnitOfWorkFactory.java
index 10c3063..a8755d4 100644
--- a/core/api/src/main/java/org/qi4j/api/unitofwork/UnitOfWorkFactory.java
+++ b/core/api/src/main/java/org/qi4j/api/unitofwork/UnitOfWorkFactory.java
@@ -23,33 +23,31 @@ import org.qi4j.api.usecase.Usecase;
 public interface UnitOfWorkFactory
 {
     /**
-     * Create a new UnitOfWork and associate
-     * it with the current thread.
-     * <p/>
+     * Create a new UnitOfWork and associate it with the current thread.
+     * <p>
      * The UnitOfWork will use the default Usecase settings.
-     * <p/>
+     * </p>
+     * <p>
      * Current time will be set to System.currentTimeMillis();
-     *
+     * </p>
      * @return a new UnitOfWork
      */
     UnitOfWork newUnitOfWork();
 
     /**
-     * Create a new UnitOfWork and associate
-     * it with the current thread.
-     * <p/>
+     * Create a new UnitOfWork and associate it with the current thread.
+     * <p>
      * The UnitOfWork will use the default Usecase settings.
-     *
+     * </p>
      * @return a new UnitOfWork
      */
     UnitOfWork newUnitOfWork( long currentTime );
 
     /**
-     * Create a new UnitOfWork for the given Usecase and
-     * associate it with the current thread.
-     * <p/>
+     * Create a new UnitOfWork for the given Usecase and associate it with the current thread.
+     * <p>
      * Current time will be set to System.currentTimeMillis();
-     *
+     * </p>
      * @param usecase the Usecase for this UnitOfWork
      *
      * @return a new UnitOfWork
@@ -57,8 +55,7 @@ public interface UnitOfWorkFactory
     UnitOfWork newUnitOfWork( Usecase usecase );
 
     /**
-     * Create a new UnitOfWork for the given Usecase and
-     * associate it with the current thread.
+     * Create a new UnitOfWork for the given Usecase and associate it with the current thread.
      *
      * @param usecase the Usecase for this UnitOfWork
      *

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/unitofwork/UnitOfWorkOptions.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/unitofwork/UnitOfWorkOptions.java b/core/api/src/main/java/org/qi4j/api/unitofwork/UnitOfWorkOptions.java
index ee74cdb..1150854 100644
--- a/core/api/src/main/java/org/qi4j/api/unitofwork/UnitOfWorkOptions.java
+++ b/core/api/src/main/java/org/qi4j/api/unitofwork/UnitOfWorkOptions.java
@@ -2,9 +2,12 @@ package org.qi4j.api.unitofwork;
 
 /**
  * Set instances of this in MetaInfo on UnitOfWork or the associated Usecase.
- *
- * Options: <br/>
+ *  <p>
+ * Options:
+ *  </p>
+ * <p>
  * "pruneOnPause": if true, then clear out all instances that have been loaded in the UoW but not modified
+ * </p>
  */
 public class UnitOfWorkOptions
 {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/unitofwork/concern/UnitOfWorkDiscardOn.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/unitofwork/concern/UnitOfWorkDiscardOn.java b/core/api/src/main/java/org/qi4j/api/unitofwork/concern/UnitOfWorkDiscardOn.java
index 919683e..3668736 100644
--- a/core/api/src/main/java/org/qi4j/api/unitofwork/concern/UnitOfWorkDiscardOn.java
+++ b/core/api/src/main/java/org/qi4j/api/unitofwork/concern/UnitOfWorkDiscardOn.java
@@ -23,35 +23,39 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
 
 /**
  * Annotation to denote the unit of work discard policy.
+ * <p>
  * By default, discard is applied on any method that has {@link UnitOfWorkPropagation} and any exception is thrown.
- * <p/>
+ * </p>
+ * <p>
  * Apply {@code UnitOfWorkDiscardOn} to override the default settings.
- * <p/>
- * <p/>
+ * </p>
+ * <p>
  * Usage example:
+ * </p>
  * <pre>
  * <code>
- * <p/>
+ *
  * &#64;Concerns( UnitOfWorkConcern.class )
  * public class MyBusinessServiceMixin implements BusinessService
  * {
  *   &#64;Structure UnitOfWorkFactory uowf;
- * <p/>
+ *
  *   &#64;UnitOfWorkDiscardOn( MyBusinessException.class )
  *   public void myBusinessMethod()
  *   {
  *     // Must invoke current unit of work.
  *     UnitOfWork uow = uowf.currentUnitOfWork();
- * <p/>
+ *
  *     // Perform business logic
  *   }
  * }
  * </code>
  * </pre>
- * <p/>
- * <p/>
+ *
+ * <p>
  * The unit of work will be discarded iff {@code MyBusinessException} exceptions or its subclass is thrown from within
  * {@code myBusinessMethod} method.
+ * </p>
  */
 @Retention( RUNTIME )
 @Target( METHOD )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/unitofwork/concern/UnitOfWorkPropagation.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/unitofwork/concern/UnitOfWorkPropagation.java b/core/api/src/main/java/org/qi4j/api/unitofwork/concern/UnitOfWorkPropagation.java
index 8a8b57e..4fe78b7 100644
--- a/core/api/src/main/java/org/qi4j/api/unitofwork/concern/UnitOfWorkPropagation.java
+++ b/core/api/src/main/java/org/qi4j/api/unitofwork/concern/UnitOfWorkPropagation.java
@@ -24,23 +24,23 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
 
 /**
  * Annotation to denote the unit of work propagation.
- * <p/>
- * <p/>
+ * <p>
  * Usage example:
+ * </p>
  * <pre>
  * <code>
- * <p/>
+ *
  * &#64;Concerns( UnitOfWorkConcern.class )
  * public class MyBusinessServiceMixin implements BusinessService
  * {
  *   &#64;Structure UnitOfWorkFactory uowf;
- * <p/>
+ *
  *   &#64;UnitOfWorkPropagation
  *   public void myBusinessMethod()
  *   {
  *     // Must invoke current unit of work.
  *     UnitOfWork uow = uowf.currentUnitOfWork();
- * <p/>
+ *
  *     // Perform business logic
  *   }
  * }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/util/Classes.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/util/Classes.java b/core/api/src/main/java/org/qi4j/api/util/Classes.java
index e4ccc11..9413f9e 100644
--- a/core/api/src/main/java/org/qi4j/api/util/Classes.java
+++ b/core/api/src/main/java/org/qi4j/api/util/Classes.java
@@ -546,11 +546,12 @@ public final class Classes
 
     /**
      * Get URI for a class name.
-     * <p/>
+     * <p>
      * Example:
-     * Class name com.example.Foo$Bar
-     * is converted to
-     * URI urn:qi4j:com.example.Foo-Bar
+     * </p>
+     * <p>
+     * Class name com.example.Foo$Bar is converted to URI urn:qi4j:com.example.Foo-Bar
+     * </p>
      *
      * @param className class name
      *

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/api/src/main/java/org/qi4j/api/value/ValueDeserializer.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/value/ValueDeserializer.java b/core/api/src/main/java/org/qi4j/api/value/ValueDeserializer.java
index d17657d..175b176 100644
--- a/core/api/src/main/java/org/qi4j/api/value/ValueDeserializer.java
+++ b/core/api/src/main/java/org/qi4j/api/value/ValueDeserializer.java
@@ -64,7 +64,7 @@ import org.qi4j.functional.Function2;
  * </p>
  * <p>
  *     Having type information in the serialized payload allows to keep actual ValueComposite types and by so
- *     circumvent {@link AmbiguousTypeException} when deserializing.
+ *     circumvent {@link org.qi4j.api.composite.AmbiguousTypeException} when deserializing.
  * </p>
  */
 public interface ValueDeserializer

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/bootstrap/src/main/java/org/qi4j/bootstrap/Assembler.java
----------------------------------------------------------------------
diff --git a/core/bootstrap/src/main/java/org/qi4j/bootstrap/Assembler.java b/core/bootstrap/src/main/java/org/qi4j/bootstrap/Assembler.java
index 10be43c..5914a87 100644
--- a/core/bootstrap/src/main/java/org/qi4j/bootstrap/Assembler.java
+++ b/core/bootstrap/src/main/java/org/qi4j/bootstrap/Assembler.java
@@ -28,13 +28,13 @@ public interface Assembler
      * to register objects, composites, services etc. and
      * the additional metadata that may exist for these
      * artifacts.
-     * <p/>
+     * <p>
      * An Assembler may create new Modules by calling
      * {@link org.qi4j.bootstrap.ModuleAssembly#layer()} and
      * then {@link LayerAssembly#module(String)} (String)}.
      * This allows an Assembler to bootstrap an entire Layer with
      * more Modules.
-     *
+     * </p>
      * @param module the Module to assemble
      *
      * @throws AssemblyException thrown if the assembler tries to do something illegal

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/bootstrap/src/main/java/org/qi4j/bootstrap/AssemblerCollection.java
----------------------------------------------------------------------
diff --git a/core/bootstrap/src/main/java/org/qi4j/bootstrap/AssemblerCollection.java b/core/bootstrap/src/main/java/org/qi4j/bootstrap/AssemblerCollection.java
index e75c39e..670d88b 100644
--- a/core/bootstrap/src/main/java/org/qi4j/bootstrap/AssemblerCollection.java
+++ b/core/bootstrap/src/main/java/org/qi4j/bootstrap/AssemblerCollection.java
@@ -20,8 +20,9 @@ import java.util.Collection;
 
 /**
  * Assembler that delegates to a collection of Assemblers.
- * <p/>
+ * <p>
  * Makes it easy to collect and compose assemblers into bigger assemblers.
+ * </p>
  */
 public final class AssemblerCollection
     implements Assembler

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/bootstrap/src/main/java/org/qi4j/bootstrap/AssemblyVisitor.java
----------------------------------------------------------------------
diff --git a/core/bootstrap/src/main/java/org/qi4j/bootstrap/AssemblyVisitor.java b/core/bootstrap/src/main/java/org/qi4j/bootstrap/AssemblyVisitor.java
index 0bf7703..c1afb59 100644
--- a/core/bootstrap/src/main/java/org/qi4j/bootstrap/AssemblyVisitor.java
+++ b/core/bootstrap/src/main/java/org/qi4j/bootstrap/AssemblyVisitor.java
@@ -15,10 +15,13 @@
 package org.qi4j.bootstrap;
 
 /**
- * Visitor interface to visit the whole or parts of an assembly. Implement this
- * interface and call visit() on ApplicationAssembly, LayerAssembly or ModuleAssembly.
- * <p/>
+ * Visitor interface to visit the whole or parts of an assembly.
+ * <p>
+ * Implement this interface and call visit() on ApplicationAssembly, LayerAssembly or ModuleAssembly.
+ * </p>
+ * <p>
  * This can be used to, for example, add metadata to all entities, add concerns on composites, or similar.
+ * </p>
  */
 public interface AssemblyVisitor<ThrowableType extends Throwable>
 {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/bootstrap/src/main/java/org/qi4j/bootstrap/AssociationDeclarations.java
----------------------------------------------------------------------
diff --git a/core/bootstrap/src/main/java/org/qi4j/bootstrap/AssociationDeclarations.java b/core/bootstrap/src/main/java/org/qi4j/bootstrap/AssociationDeclarations.java
index 86c0197..59724ca 100644
--- a/core/bootstrap/src/main/java/org/qi4j/bootstrap/AssociationDeclarations.java
+++ b/core/bootstrap/src/main/java/org/qi4j/bootstrap/AssociationDeclarations.java
@@ -18,7 +18,7 @@ import java.lang.reflect.AccessibleObject;
 import org.qi4j.api.common.MetaInfo;
 
 /**
- * This provides declared {@see org.qi4j.api.association.Association} information that the runtime can use.
+ * This provides declared {@link org.qi4j.api.association.Association} information that the runtime can use.
  */
 public interface AssociationDeclarations
 {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/bootstrap/src/main/java/org/qi4j/bootstrap/ClassScanner.java
----------------------------------------------------------------------
diff --git a/core/bootstrap/src/main/java/org/qi4j/bootstrap/ClassScanner.java b/core/bootstrap/src/main/java/org/qi4j/bootstrap/ClassScanner.java
index f3cfee9..70c2946 100644
--- a/core/bootstrap/src/main/java/org/qi4j/bootstrap/ClassScanner.java
+++ b/core/bootstrap/src/main/java/org/qi4j/bootstrap/ClassScanner.java
@@ -43,10 +43,10 @@ public class ClassScanner
 {
     /**
      * Get all classes from the same package of the given class, and recursively in all subpackages.
-     * <p/>
+     * <p>
      * This only works if the seed class is loaded from a file: URL. Jar files are possible as well. Abstract classes
      * are not included in the results. For further filtering use e.g. Iterables.filter.
-     *
+     * </p>
      * @param seedClass starting point for classpath scanning
      *
      * @return iterable of all concrete classes in the same package as the seedclass, and also all classes in subpackages.
@@ -162,12 +162,11 @@ public class ClassScanner
 
     /**
      * Useful specification for filtering classes based on a regular expression matching the class names.
-     * <p/>
-     * Example: matches(".*Model") -> match only class names that end with Model
-     * <p/>
-     * Example:
+     * <p>
+     * Example: matches(".*Model") -&gt; match only class names that end with Model
+     * </p>
      *
-     * @param regex
+     * @param regex The regular expression to be matched.
      *
      * @return regex class name specification
      */

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/bootstrap/src/main/java/org/qi4j/bootstrap/Energy4Java.java
----------------------------------------------------------------------
diff --git a/core/bootstrap/src/main/java/org/qi4j/bootstrap/Energy4Java.java b/core/bootstrap/src/main/java/org/qi4j/bootstrap/Energy4Java.java
index b30a19a..71dd525 100644
--- a/core/bootstrap/src/main/java/org/qi4j/bootstrap/Energy4Java.java
+++ b/core/bootstrap/src/main/java/org/qi4j/bootstrap/Energy4Java.java
@@ -24,11 +24,14 @@ import org.qi4j.api.structure.ApplicationDescriptor;
 import org.qi4j.spi.Qi4jSPI;
 
 /**
- * Main bootstrap class for starting Qi4j and creating new applications. Instantiate this
- * and call one of the factory methods to get started.
- * <p/>
+ * Main bootstrap class for starting Qi4j and creating new applications.
+ * <p>
+ * Instantiate this and call one of the factory methods to get started.
+ * </p>
+ * <p>
  * This class will use the Service Loader mechanism in Java to try to locate a runtime that implements
  * the Qi4jRuntime interface. This avoids a direct dependency from the bootstrap to the runtime.
+ * </p>
  */
 public final class Energy4Java
 {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/bootstrap/src/main/java/org/qi4j/bootstrap/EntityDeclaration.java
----------------------------------------------------------------------
diff --git a/core/bootstrap/src/main/java/org/qi4j/bootstrap/EntityDeclaration.java b/core/bootstrap/src/main/java/org/qi4j/bootstrap/EntityDeclaration.java
index 21468d5..fb00745 100644
--- a/core/bootstrap/src/main/java/org/qi4j/bootstrap/EntityDeclaration.java
+++ b/core/bootstrap/src/main/java/org/qi4j/bootstrap/EntityDeclaration.java
@@ -64,9 +64,9 @@ public interface EntityDeclaration
 
     /**
      * Declare additional mixins for these entities.
-     * <p/>
+     * <p>
      * This can be useful to override any default mixins from the entity interface.
-     *
+     * </p>
      * @param mixins The mixins that are to be added to the EntityComposite beyond the statically declared ones.
      *
      * @return This instance for a fluid DSL
@@ -75,10 +75,10 @@ public interface EntityDeclaration
 
     /**
      * Declare additional interfaces for these declared interfaces.
-     * <p/>
+     * <p>
      * This can be useful to add types that the entities should implement, but
      * which you do not want to include in the entity interface itself.
-     *
+     * </p>
      * @param types list of interfaces to add
      *
      * @return This instance for a fluid DSL

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/bootstrap/src/main/java/org/qi4j/bootstrap/ManyAssociationDeclarations.java
----------------------------------------------------------------------
diff --git a/core/bootstrap/src/main/java/org/qi4j/bootstrap/ManyAssociationDeclarations.java b/core/bootstrap/src/main/java/org/qi4j/bootstrap/ManyAssociationDeclarations.java
index a226582..f95a6ac 100644
--- a/core/bootstrap/src/main/java/org/qi4j/bootstrap/ManyAssociationDeclarations.java
+++ b/core/bootstrap/src/main/java/org/qi4j/bootstrap/ManyAssociationDeclarations.java
@@ -18,7 +18,7 @@ import java.lang.reflect.AccessibleObject;
 import org.qi4j.api.common.MetaInfo;
 
 /**
- * This provides declared {@see org.qi4j.api.association.ManyAssociation} information that the runtime can use.
+ * This provides declared {@link org.qi4j.api.association.ManyAssociation} information that the runtime can use.
  */
 public interface ManyAssociationDeclarations
 {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/bootstrap/src/main/java/org/qi4j/bootstrap/ModuleAssembly.java
----------------------------------------------------------------------
diff --git a/core/bootstrap/src/main/java/org/qi4j/bootstrap/ModuleAssembly.java b/core/bootstrap/src/main/java/org/qi4j/bootstrap/ModuleAssembly.java
index 03df5f7..805b232 100644
--- a/core/bootstrap/src/main/java/org/qi4j/bootstrap/ModuleAssembly.java
+++ b/core/bootstrap/src/main/java/org/qi4j/bootstrap/ModuleAssembly.java
@@ -24,10 +24,11 @@ import org.qi4j.api.structure.Module;
 import org.qi4j.functional.Specification;
 
 /**
- * The ModuleAssembly is used to register any information about
- * what the module should contain, such as composites, entities and services.
- * <p/>
+ * The ModuleAssembly is used to register any information about * what the module should contain, such as composites,
+ * entities and services.
+ * <p>
  * Use the methods and the fluent API's to declare how the module should be constructed.
+ * </p>
  */
 public interface ModuleAssembly
 {
@@ -42,8 +43,9 @@ public interface ModuleAssembly
      * Get an assembly for a particular Module. If this is called many times with the same names, then the same module
      * is affected.
      *
-     * @param layerName The name of the Layer
+     * @param layerName  The name of the Layer
      * @param moduleName The name of the Module to retrieve or create.
+     *
      * @return The ModuleAssembly for the Module.
      */
     ModuleAssembly module( String layerName, String moduleName );
@@ -69,9 +71,10 @@ public interface ModuleAssembly
      * Module activation and passivation.
      *
      * @param activators the module activators
+     *
      * @return the assembly
-     */    
-    @SuppressWarnings( { "unchecked","varargs" } )
+     */
+    @SuppressWarnings({ "unchecked", "varargs" })
     ModuleAssembly withActivators( Class<? extends Activator<Module>>... activators );
 
     /**

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/bootstrap/src/main/java/org/qi4j/bootstrap/NamedAssociationDeclarations.java
----------------------------------------------------------------------
diff --git a/core/bootstrap/src/main/java/org/qi4j/bootstrap/NamedAssociationDeclarations.java b/core/bootstrap/src/main/java/org/qi4j/bootstrap/NamedAssociationDeclarations.java
index 0838632..54a4257 100644
--- a/core/bootstrap/src/main/java/org/qi4j/bootstrap/NamedAssociationDeclarations.java
+++ b/core/bootstrap/src/main/java/org/qi4j/bootstrap/NamedAssociationDeclarations.java
@@ -23,7 +23,7 @@ import java.lang.reflect.AccessibleObject;
 import org.qi4j.api.common.MetaInfo;
 
 /**
- * This provides declared {@see org.qi4j.api.association.NamedAssociation} information that the runtime can use.
+ * This provides declared {@link org.qi4j.api.association.NamedAssociation} information that the runtime can use.
  */
 public interface NamedAssociationDeclarations
 {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/bootstrap/src/main/java/org/qi4j/bootstrap/SingletonAssembler.java
----------------------------------------------------------------------
diff --git a/core/bootstrap/src/main/java/org/qi4j/bootstrap/SingletonAssembler.java b/core/bootstrap/src/main/java/org/qi4j/bootstrap/SingletonAssembler.java
index 93bd781..255bd29 100644
--- a/core/bootstrap/src/main/java/org/qi4j/bootstrap/SingletonAssembler.java
+++ b/core/bootstrap/src/main/java/org/qi4j/bootstrap/SingletonAssembler.java
@@ -42,7 +42,7 @@ public abstract class SingletonAssembler
      *
      * @throws AssemblyException Either if the model can not be created from the disk, or some inconsistency in
      *                           the programming model makes it impossible to create it.
-     * @throws
+     * @throws ActivationException If the automatic {@code activate()} method is throwing this Exception..
      */
     public SingletonAssembler()
         throws AssemblyException, ActivationException

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/bootstrap/src/main/java/org/qi4j/bootstrap/StateDeclarations.java
----------------------------------------------------------------------
diff --git a/core/bootstrap/src/main/java/org/qi4j/bootstrap/StateDeclarations.java b/core/bootstrap/src/main/java/org/qi4j/bootstrap/StateDeclarations.java
index e615b22..39a69b8 100644
--- a/core/bootstrap/src/main/java/org/qi4j/bootstrap/StateDeclarations.java
+++ b/core/bootstrap/src/main/java/org/qi4j/bootstrap/StateDeclarations.java
@@ -18,7 +18,7 @@ import java.lang.reflect.AccessibleObject;
 import org.qi4j.api.common.MetaInfo;
 
 /**
- * This provides declared {@see org.qi4j.api.property.Property} information that the runtime can use.
+ * This provides declared {@link org.qi4j.api.property.Property} information that the runtime can use.
  */
 public interface StateDeclarations
 {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/core/functional/src/main/java/org/qi4j/functional/ForEach.java
----------------------------------------------------------------------
diff --git a/core/functional/src/main/java/org/qi4j/functional/ForEach.java b/core/functional/src/main/java/org/qi4j/functional/ForEach.java
index a209bcb..c2bbe3e 100644
--- a/core/functional/src/main/java/org/qi4j/functional/ForEach.java
+++ b/core/functional/src/main/java/org/qi4j/functional/ForEach.java
@@ -18,9 +18,12 @@ import java.util.Iterator;
 /**
  * When using Iterables with map() and filter() the code often reads "in reverse", with the first item last in the code.
  * Example: Iterables.map(function,Iterables.filter(specification, iterable))
- * <p/>
+ * <p>
  * This ForEach class reverses that order and makes the code more readable, and allows easy application of visitors on iterables.
+ * </p>
+ * <p>
  * Example: forEach(iterable).filter(specification).map(function).visit(visitor)
+ * </p>
  */
 public final class ForEach<T>
     implements Iterable<T>


[14/50] [abbrv] zest-qi4j git commit: Gradle Wrapper now use 1.12

Posted by ni...@apache.org.
Gradle Wrapper now use 1.12

Forgot the build.gradle


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/510550ff
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/510550ff
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/510550ff

Branch: refs/heads/3.0
Commit: 510550ff6639eab7ecfe03ef4f8cba7a2f0f3e00
Parents: cf478f2
Author: Paul Merlin <pa...@nosphere.org>
Authored: Thu Jun 12 15:06:04 2014 +0200
Committer: Paul Merlin <pa...@nosphere.org>
Committed: Thu Jun 12 15:06:04 2014 +0200

----------------------------------------------------------------------
 build.gradle | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/510550ff/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 0ad152e..c8fdcd3 100644
--- a/build.gradle
+++ b/build.gradle
@@ -343,7 +343,7 @@ configurations {
   jacoco
 }
 dependencies {
-  jacoco 'org.jacoco:org.jacoco.ant:0.6.4.201312101107'
+  jacoco 'org.jacoco:org.jacoco.ant:0.7.1.201405082137'
 }
 // Generate a global code codeverage report
 task coverageReport {
@@ -650,5 +650,5 @@ task release {
 //  2) /gradlew.bat which is the windows bat script for for executing builds
 //  3) /wrapper which is a directory named by the "jarPath" config which contains other needed files.
 task wrapper( type: Wrapper ) {
-  gradleVersion = '1.11'
+  gradleVersion = '1.12'
 }


[28/50] [abbrv] zest-qi4j git commit: Removed Function, Function2 and Specification and replaced with the equivalents in JDK, Function, BiFunction and Predicate.

Posted by ni...@apache.org.
Removed Function, Function2 and Specification and replaced with the equivalents in JDK, Function, BiFunction and Predicate.


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/9479a63e
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/9479a63e
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/9479a63e

Branch: refs/heads/3.0
Commit: 9479a63e998a949af53d9a51d480d43a72d24067
Parents: 3bf71df
Author: Niclas Hedhman <ni...@hedhman.org>
Authored: Fri Oct 3 17:12:06 2014 +0800
Committer: Niclas Hedhman <ni...@hedhman.org>
Committed: Fri Oct 3 17:12:06 2014 +0800

----------------------------------------------------------------------
 build.gradle                                    | 108 ++++----
 core/api/src/main/java/org/qi4j/api/Qi4j.java   |   8 +-
 .../main/java/org/qi4j/api/common/MetaInfo.java |   2 +-
 .../main/java/org/qi4j/api/common/TypeName.java |   2 +-
 .../java/org/qi4j/api/common/UseDefaults.java   |   2 +-
 .../qi4j/api/composite/CompositeContext.java    |   2 +-
 .../org/qi4j/api/composite/PropertyMapper.java  |   4 +-
 .../qi4j/api/configuration/Configuration.java   |   4 +-
 .../ConstraintViolationException.java           |   6 +-
 .../main/java/org/qi4j/api/dataset/DataSet.java |   6 +-
 .../main/java/org/qi4j/api/dataset/Query.java   |   4 +-
 .../api/dataset/iterable/IterableDataSet.java   |   6 +-
 .../api/dataset/iterable/IterableQuery.java     |   4 +-
 .../qi4j/api/query/NotQueryableException.java   |   2 +-
 .../java/org/qi4j/api/query/QueryBuilder.java   |   4 +-
 .../org/qi4j/api/query/QueryExpressions.java    |  12 +-
 .../api/query/grammar/AndSpecification.java     |  10 +-
 .../api/query/grammar/AssociationFunction.java  |  12 +-
 .../AssociationNotNullSpecification.java        |   7 +-
 .../grammar/AssociationNullSpecification.java   |   7 +-
 .../api/query/grammar/BinarySpecification.java  |  10 +-
 .../query/grammar/ComparisonSpecification.java  |   7 +-
 .../query/grammar/ContainsAllSpecification.java |   7 +-
 .../query/grammar/ContainsSpecification.java    |   7 +-
 .../query/grammar/ExpressionSpecification.java  |  42 ---
 .../ManyAssociationContainsSpecification.java   |   7 +-
 .../query/grammar/ManyAssociationFunction.java  |   6 +-
 .../api/query/grammar/MatchesSpecification.java |   7 +-
 ...medAssociationContainsNameSpecification.java |   7 +-
 .../NamedAssociationContainsSpecification.java  |   7 +-
 .../query/grammar/NamedAssociationFunction.java |   6 +-
 .../api/query/grammar/NotSpecification.java     |  14 +-
 .../qi4j/api/query/grammar/OrSpecification.java |  10 +-
 .../api/query/grammar/PropertyFunction.java     |  10 +-
 .../grammar/PropertyNotNullSpecification.java   |   7 +-
 .../grammar/PropertyNullSpecification.java      |   7 +-
 .../api/query/grammar/PropertyReference.java    |   2 +-
 .../api/query/grammar/QuerySpecification.java   |   8 +-
 .../api/service/importer/InstanceImporter.java  |   4 +-
 .../importer/ServiceSelectorImporter.java       |   6 +-
 .../org/qi4j/api/service/qualifier/Active.java  |   4 +-
 .../service/qualifier/AnnotationQualifier.java  |   4 +-
 .../qi4j/api/service/qualifier/Available.java   |   4 +-
 .../qi4j/api/service/qualifier/HasMetaInfo.java |   8 +-
 .../api/service/qualifier/IdentifiedBy.java     |   4 +-
 .../api/service/qualifier/ServiceQualifier.java |  36 +--
 .../org/qi4j/api/service/qualifier/Tagged.java  |   4 +-
 .../java/org/qi4j/api/type/CollectionType.java  |   2 +-
 .../main/java/org/qi4j/api/type/MapType.java    |   2 +-
 .../qi4j/api/type/MatchTypeSpecification.java   |   6 +-
 .../org/qi4j/api/type/ValueCompositeType.java   |   2 +-
 .../main/java/org/qi4j/api/type/ValueType.java  |   4 +-
 .../api/unitofwork/NoSuchEntityException.java   |   6 +-
 .../java/org/qi4j/api/util/Annotations.java     |  24 +-
 .../main/java/org/qi4j/api/util/Classes.java    | 116 ++++----
 .../java/org/qi4j/api/util/Constructors.java    |   4 +-
 .../src/main/java/org/qi4j/api/util/Fields.java |  12 +-
 .../main/java/org/qi4j/api/util/Methods.java    |  14 +-
 .../org/qi4j/api/value/ValueBuilderFactory.java |   2 +-
 .../org/qi4j/api/value/ValueDeserializer.java   |   6 +-
 .../org/qi4j/api/value/ValueSerializer.java     |   2 +-
 .../test/java/org/qi4j/api/OperatorsTest.java   |  10 +-
 .../org/qi4j/api/common/QualifiedNameTest.java  |   8 +-
 .../IntegerRangeSpecificationTest.java          |  60 ++++
 .../api/specification/SpecificationsTest.java   |  88 ++++++
 .../java/org/qi4j/api/util/ClassesTest.java     |   6 +-
 .../qi4j/api/value/DocumentationSupport.java    |   4 +-
 .../org/qi4j/bootstrap/ApplicationAssembly.java |   2 +-
 .../qi4j/bootstrap/AssemblySpecifications.java  |  10 +-
 .../java/org/qi4j/bootstrap/ClassScanner.java   |  34 +--
 .../java/org/qi4j/bootstrap/LayerAssembly.java  |  14 +-
 .../java/org/qi4j/bootstrap/ModuleAssembly.java |  14 +-
 .../qi4j/bootstrap/DocumentationSupport.java    |   6 +-
 .../main/java/org/qi4j/functional/ForEach.java  |   4 +-
 .../main/java/org/qi4j/functional/Function.java |  35 ---
 .../java/org/qi4j/functional/Function2.java     |  33 ---
 .../java/org/qi4j/functional/Functions.java     | 275 -------------------
 .../java/org/qi4j/functional/Iterables.java     |  68 ++---
 .../java/org/qi4j/functional/Specification.java |  37 ---
 .../org/qi4j/functional/Specifications.java     | 113 +++-----
 .../java/org/qi4j/functional/FunctionsTest.java | 125 ---------
 .../IntegerRangeSpecificationTest.java          |  59 ----
 .../java/org/qi4j/functional/IterablesTest.java |  27 +-
 .../org/qi4j/functional/SpecificationsTest.java |  85 ------
 .../functional/docsupport/FunctionalDocs.java   |  20 +-
 .../src/main/java/org/qi4j/io/Transforms.java   |  32 +--
 .../test/java/org/qi4j/io/InputOutputTest.java  |   6 +-
 .../AbstractAssociationInstance.java            |   8 +-
 .../association/AssociationInstance.java        |   4 +-
 .../association/ManyAssociationInstance.java    |   4 +-
 .../association/ManyAssociationModel.java       |   8 +-
 .../association/NamedAssociationInstance.java   |   4 +-
 .../association/NamedAssociationModel.java      |   8 +-
 .../bootstrap/CompositeAssemblyImpl.java        |  24 +-
 .../runtime/bootstrap/EntityAssemblyImpl.java   |   2 +-
 .../runtime/bootstrap/LayerAssemblyImpl.java    |  14 +-
 .../runtime/bootstrap/ModuleAssemblyImpl.java   |  26 +-
 .../runtime/bootstrap/ServiceAssemblyImpl.java  |   4 +-
 .../runtime/bootstrap/ValueAssemblyImpl.java    |   2 +-
 .../runtime/composite/CompositeMethodModel.java |   6 +-
 .../composite/ConstraintDeclaration.java        |   6 +-
 .../runtime/composite/ConstructorsModel.java    |   4 +-
 .../runtime/composite/GenericSpecification.java |   6 +-
 .../org/qi4j/runtime/composite/MixinsModel.java |  14 +-
 .../runtime/composite/TransientInstance.java    |   2 +-
 .../runtime/entity/EntityStateInstance.java     |  20 +-
 .../qi4j/runtime/injection/Dependencies.java    |   4 +-
 .../qi4j/runtime/injection/DependencyModel.java |  10 +-
 .../runtime/injection/InjectedFieldModel.java   |   6 +-
 .../runtime/injection/InjectedFieldsModel.java  |   6 +-
 .../runtime/injection/InjectedMethodsModel.java |   2 +-
 .../injection/InjectedParametersModel.java      |   6 +-
 .../InvocationInjectionProviderFactory.java     |   4 +-
 .../ModifiesInjectionProviderFactory.java       |   2 +-
 .../ServiceInjectionProviderFactory.java        |  22 +-
 .../provider/ThisInjectionProviderFactory.java  |   2 +-
 .../qi4j/runtime/query/IterableQuerySource.java |  16 +-
 .../qi4j/runtime/query/QueryBuilderImpl.java    |   8 +-
 .../java/org/qi4j/runtime/query/QueryImpl.java  |   6 +-
 .../service/ImportedServicesInstance.java       |   6 +-
 .../qi4j/runtime/service/ServiceInstance.java   |   2 +-
 .../org/qi4j/runtime/service/ServiceModel.java  |   2 +-
 .../qi4j/runtime/service/ServicesInstance.java  |   6 +-
 .../qi4j/runtime/structure/LayerInstance.java   |  12 +-
 .../org/qi4j/runtime/structure/ModelModule.java |   6 +-
 .../qi4j/runtime/structure/ModuleInstance.java  |  28 +-
 .../runtime/structure/ModuleUnitOfWork.java     |   8 +-
 .../org/qi4j/runtime/structure/TypeLookup.java  |  22 +-
 .../runtime/structure/UsedLayersInstance.java   |  12 +-
 .../structure/VisibilitySpecification.java      |  12 +-
 .../qi4j/runtime/types/ValueTypeFactory.java    |  20 +-
 .../runtime/unitofwork/BuilderEntityState.java  |   2 +-
 .../composite/CompositeFactoryImplTest.java     |   2 +-
 .../runtime/composite/FunctionalListTest.java   |   6 +-
 .../runtime/injection/ServiceInjectionTest.java |   8 +-
 .../org/qi4j/runtime/mixin/JDKMixinTest.java    |  10 +-
 .../qi4j/runtime/mixin/MixinPrecedenceTest.java |   2 +-
 .../org/qi4j/runtime/property/PropertyTest.java |   2 +-
 .../org/qi4j/runtime/structure/ModuleTest.java  |   2 +-
 .../src/test/java/org/qi4j/test/ASMTest.java    |  58 ++--
 .../test/composite/CleanStackTraceTest.java     |   4 +-
 .../org/qi4j/spi/entity/QualifiedIdentity.java  |   5 +-
 .../entitystore/helpers/DefaultEntityState.java |   2 +-
 .../java/org/qi4j/spi/query/EntityFinder.java   |   8 +-
 .../java/org/qi4j/spi/query/QuerySource.java    |   8 +-
 .../spi/value/ValueDeserializerAdapter.java     |  71 +++--
 .../qi4j/spi/value/ValueSerializerAdapter.java  |  56 ++--
 .../orgjson/OrgJsonValueDeserializer.java       |  16 +-
 .../orgjson/OrgJsonValueSerialization.java      |   8 +-
 .../helpers/JSONManyAssociationStateTest.java   |   4 +-
 .../org/qi4j/test/AbstractQi4jBaseTest.java     |   2 +-
 .../org/qi4j/test/AbstractQi4jScenarioTest.java |   2 +-
 .../qi4j/test/cache/AbstractCachePoolTest.java  |   2 +-
 .../test/entity/AbstractEntityStoreTest.java    |   2 +-
 .../test/indexing/AbstractAnyQueryTest.java     |   2 +-
 .../test/indexing/AbstractComplexQueryTest.java |   2 +-
 .../test/indexing/AbstractEntityFinderTest.java |   6 +-
 .../test/indexing/AbstractNamedQueryTest.java   |  10 +-
 .../qi4j/test/indexing/AbstractQueryTest.java   |   2 +-
 .../elasticsearch/ElasticSearchFinder.java      |  22 +-
 .../qi4j/index/rdf/query/RdfQueryParser.java    |   4 +-
 .../qi4j/index/rdf/query/RdfQueryService.java   |   8 +-
 .../rdf/query/internal/RdfQueryParserImpl.java  |  12 +-
 .../org/qi4j/index/rdf/RdfNamedQueryTest.java   |   4 +-
 .../solr/internal/SolrEntityQueryMixin.java     |   8 +-
 .../org/qi4j/index/solr/SolrNamedQueryTest.java |   4 +-
 .../index/sql/internal/SQLEntityFinder.java     |   8 +-
 .../qi4j/index/sql/support/api/SQLQuerying.java |   4 +-
 .../support/postgresql/PostgreSQLQuerying.java  |   4 +-
 .../support/skeletons/AbstractSQLIndexing.java  |   9 +-
 .../support/skeletons/AbstractSQLQuerying.java  |  68 ++---
 .../support/skeletons/AbstractSQLStartup.java   |  12 +-
 .../skeletons/SQLCompatEntityStateWrapper.java  |  10 +-
 .../jackson/JacksonValueDeserializer.java       |  16 +-
 .../JacksonValueSerializationAssembler.java     |   2 +-
 .../OrgJsonValueSerializationAssembler.java     |   2 +-
 .../stax/StaxValueDeserializer.java             |  12 +-
 .../stax/StaxValueSerializationAssembler.java   |   2 +-
 .../library/circuitbreaker/CircuitBreaker.java  |   8 +-
 .../library/circuitbreaker/CircuitBreakers.java |  16 +-
 .../conversion/values/EntityToValue.java        |  24 +-
 .../conversion/values/EntityToValueTest.java    |   4 +-
 .../org/qi4j/library/cxf/Qi4jTypeCreator.java   |   2 +-
 .../qi4j/library/cxf/ValueCompositeCxfType.java |  20 +-
 .../source/jdbm/JdbmEventStoreService.java      |   4 +-
 .../source/jdbm/JdbmEventStoreServiceTest.java  |   4 +-
 .../source/helper/ApplicationEvents.java        |  52 ++--
 .../factory/DomainEventFactoryService.java      |   2 +-
 .../domain/source/helper/EventRouter.java       |  10 +-
 .../domain/source/helper/Events.java            |  66 ++---
 .../domain/source/helper/UnitOfWorkRouter.java  |  10 +-
 .../eventsourcing/domain/DomainEventTest.java   |   4 +-
 .../source/helper/DomainEventTrackerTest.java   |   4 +-
 .../jmx/ConfigurationManagerService.java        |   4 +-
 .../java/org/qi4j/library/jmx/Qi4jMBeans.java   |   6 +-
 .../org/qi4j/lang/scala/ScalaTraitMixin.java    |   6 +-
 .../debug/service/DebugOnConsoleSideEffect.java |   2 +-
 .../debug/service/DebuggingServiceMixin.java    |   2 +-
 .../org/qi4j/logging/log/SimpleLogConcern.java  |   2 +-
 .../log/service/LogOnConsoleSideEffect.java     |   2 +-
 .../log/service/LoggingServiceMixin.java        |   2 +-
 .../trace/service/TraceServiceMixin.java        |   2 +-
 .../java/org/qi4j/logging/DebuggingTest.java    |   5 +-
 .../rdf/entity/EntityStateSerializer.java       |   2 +-
 .../rdf/entity/EntityTypeSerializer.java        |   2 +-
 .../org/qi4j/library/rdf/model/Model2XML.java   |   4 +-
 .../org/qi4j/library/rdf/Model2XMLTest.java     |   2 +-
 .../rest/client/api/ContextResourceClient.java  |  10 +-
 .../library/rest/client/api/ErrorHandler.java   |  18 +-
 .../library/rest/client/api/HandlerCommand.java |   4 +-
 .../library/rest/common/link/LinksUtil.java     |  30 +-
 .../library/rest/common/table/TableBuilder.java |   6 +-
 .../rest/common/table/TableBuilderFactory.java  |   2 +-
 .../library/rest/common/table/TableQuery.java   |   2 +-
 .../server/assembler/RestServerAssembler.java   |   6 +-
 .../freemarker/ValueCompositeTemplateModel.java |  12 +-
 .../requestreader/DefaultRequestReader.java     |  10 +-
 .../sql/liquibase/LiquibaseServiceTest.java     |   4 +-
 .../library/sql/datasource/DataSources.java     |   4 +-
 .../struts2/ConstraintViolationInterceptor.java |   2 +-
 .../library/struts2/util/ClassNameFilters.java  |   4 +-
 .../library/struts2/util/ClassNameMapper.java   |   4 +-
 .../qi4j/library/struts2/util/ClassNames.java   |   2 +-
 .../sample_a/bootstrap/assembly/Assembler.java  |   4 +-
 .../conversion/EntityToDTOService.java          |  18 +-
 .../sample_a/bootstrap/test/TestAssembler.java  |   4 +-
 .../sample_b/bootstrap/assembly/Assembler.java  |   4 +-
 .../conversion/EntityToDTOService.java          |  18 +-
 .../sample_b/bootstrap/test/TestAssembler.java  |   4 +-
 .../samples/forum/assembler/ForumAssembler.java |   4 +-
 .../org/qi4j/samples/forum/context/Context.java |   2 +-
 .../samples/forum/context/EventsService.java    |   4 +-
 .../samples/forum/domainevent/DomainEvent.java  |   4 +-
 .../java/org/qi4j/sample/rental/web/Page.java   |   2 +-
 .../qi4j/sample/rental/web/QuikitServlet.java   |   4 +-
 .../rental/web/assembly/StorageModule.java      |   4 +-
 236 files changed, 1314 insertions(+), 1900 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index c8fdcd3..8e434c3 100644
--- a/build.gradle
+++ b/build.gradle
@@ -175,7 +175,7 @@ allprojects {
   if( ext.javaDir.isDirectory() || ext.scalaDir.isDirectory() ||
       ext.testJavaDir.isDirectory() || ext.testScalaDir.isDirectory() )
   {
-    apply plugin: 'jacoco'
+//    apply plugin: 'jacoco'
     apply plugin: 'osgi'
     apply plugin: VersionClass
     apply plugin: AsciidocBuildInfo
@@ -340,63 +340,63 @@ test {
 
 // Jacoco
 configurations {
-  jacoco
+//  jacoco
 }
 dependencies {
-  jacoco 'org.jacoco:org.jacoco.ant:0.7.1.201405082137'
+//  jacoco 'org.jacoco:org.jacoco.ant:0.7.1.201405082137'
 }
 // Generate a global code codeverage report
-task coverageReport {
-  dependsOn subprojects*.test
-  def outputPath = "build/reports/coverage"
-  def coveredProjects = subprojects.findAll { p -> new File( "${p.buildDir.path}/jacoco" ).exists() }
-  def coreProjects = coveredProjects.findAll { p -> p.name.startsWith('org.qi4j.core' ) }
-  def libProjects = coveredProjects.findAll { p -> p.name.startsWith( 'org.qi4j.lib' ) }
-  def extProjects = coveredProjects.findAll { p -> p.name.startsWith( 'org.qi4j.ext' ) }
-  def toolsProjects = coveredProjects.findAll { p -> p.name.startsWith( 'org.qi4j.tool' ) }
-  def tutoProjects = coveredProjects.findAll { p -> p.name.startsWith( 'org.qi4j.tuto' ) }
-  def samplesProjects = coveredProjects.findAll { p -> p.name.startsWith( 'org.qi4j.sample' ) }
-  ant {
-    taskdef name:'jacocoreport', classname: 'org.jacoco.ant.ReportTask', classpath: configurations.jacoco.asPath
-    mkdir dir: outputPath
-    jacocoreport {
-      executiondata {
-        coveredProjects.collect { p -> fileset( dir: "${p.buildDir.path}/jacoco" ) { include( name: '*.exec' ) } }
-      }
-      structure( name: "Qi4j SDK" ) {
-        group( name: "Core" ) {
-          classfiles { coreProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
-          sourcefiles { coreProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
-        }
-        group( name: "Libraries" ) {
-          classfiles { libProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
-          sourcefiles { libProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
-        }
-        group( name: "Extensions" ) {
-          classfiles { extProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
-          sourcefiles { extProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
-        }
-        group( name: "Tools" ) {
-          classfiles { toolsProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
-          sourcefiles { toolsProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
-        }
-        group( name: "Tutorials" ) {
-          classfiles { tutoProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
-          sourcefiles { tutoProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
-        }
-        group( name: "Samples" ) {
-          classfiles { samplesProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
-          sourcefiles { samplesProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
-        }
-      }
-      csv  destfile: "${outputPath}/jacoco.csv", encoding: "UTF-8"
-      xml  destfile: "${outputPath}/jacoco.xml", encoding: "UTF-8"
-      html destdir:  outputPath, encoding: "UTF-8", locale: "en", footer: "Qi4j SDK"
-    }
-  }
-  inputs.dir coveredProjects.collect { p -> "${p.buildDir.path}/jacoco" }
-  outputs.dir outputPath
-}
+//task coverageReport {
+//  dependsOn subprojects*.test
+//  def outputPath = "build/reports/coverage"
+//  def coveredProjects = subprojects.findAll { p -> new File( "${p.buildDir.path}/jacoco" ).exists() }
+//  def coreProjects = coveredProjects.findAll { p -> p.name.startsWith('org.qi4j.core' ) }
+//  def libProjects = coveredProjects.findAll { p -> p.name.startsWith( 'org.qi4j.lib' ) }
+//  def extProjects = coveredProjects.findAll { p -> p.name.startsWith( 'org.qi4j.ext' ) }
+//  def toolsProjects = coveredProjects.findAll { p -> p.name.startsWith( 'org.qi4j.tool' ) }
+//  def tutoProjects = coveredProjects.findAll { p -> p.name.startsWith( 'org.qi4j.tuto' ) }
+//  def samplesProjects = coveredProjects.findAll { p -> p.name.startsWith( 'org.qi4j.sample' ) }
+//  ant {
+//    taskdef name:'jacocoreport', classname: 'org.jacoco.ant.ReportTask', classpath: configurations.jacoco.asPath
+//    mkdir dir: outputPath
+//    jacocoreport {
+//      executiondata {
+//        coveredProjects.collect { p -> fileset( dir: "${p.buildDir.path}/jacoco" ) { include( name: '*.exec' ) } }
+//      }
+//      structure( name: "Qi4j SDK" ) {
+//        group( name: "Core" ) {
+//          classfiles { coreProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
+//          sourcefiles { coreProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
+//        }
+//        group( name: "Libraries" ) {
+//          classfiles { libProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
+//          sourcefiles { libProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
+//        }
+//        group( name: "Extensions" ) {
+//          classfiles { extProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
+//          sourcefiles { extProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
+//        }
+//        group( name: "Tools" ) {
+//          classfiles { toolsProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
+//          sourcefiles { toolsProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
+//        }
+//        group( name: "Tutorials" ) {
+//          classfiles { tutoProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
+//          sourcefiles { tutoProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
+//        }
+//        group( name: "Samples" ) {
+//          classfiles { samplesProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
+//          sourcefiles { samplesProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
+//        }
+//      }
+//      csv  destfile: "${outputPath}/jacoco.csv", encoding: "UTF-8"
+//      xml  destfile: "${outputPath}/jacoco.xml", encoding: "UTF-8"
+//      html destdir:  outputPath, encoding: "UTF-8", locale: "en", footer: "Qi4j SDK"
+//    }
+//  }
+//  inputs.dir coveredProjects.collect { p -> "${p.buildDir.path}/jacoco" }
+//  outputs.dir outputPath
+//}
 
 
 // Build the whole SDK public Javadoc

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/Qi4j.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/Qi4j.java b/core/api/src/main/java/org/qi4j/api/Qi4j.java
index 317153c..116cbef 100644
--- a/core/api/src/main/java/org/qi4j/api/Qi4j.java
+++ b/core/api/src/main/java/org/qi4j/api/Qi4j.java
@@ -16,6 +16,7 @@ package org.qi4j.api;
 import java.lang.reflect.Field;
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Proxy;
+import java.util.function.Function;
 import org.qi4j.api.association.AbstractAssociation;
 import org.qi4j.api.association.AssociationDescriptor;
 import org.qi4j.api.composite.Composite;
@@ -30,7 +31,6 @@ import org.qi4j.api.property.PropertyDescriptor;
 import org.qi4j.api.service.ServiceDescriptor;
 import org.qi4j.api.structure.Module;
 import org.qi4j.api.value.ValueDescriptor;
-import org.qi4j.functional.Function;
 
 /**
  * Encapsulation of the Qi4j API.
@@ -126,10 +126,10 @@ public interface Qi4j
     /**
      * Function that returns the CompositeDescriptor of a Composite.
      */
-    Function<Composite, CompositeDescriptor> FUNCTION_DESCRIPTOR_FOR = new Function<Composite, CompositeDescriptor>()
+    Function<Composite, CompositeDescriptor> FUNCTION_DESCRIPTOR_FOR = new Function<Composite,CompositeDescriptor>()
     {
         @Override
-        public CompositeDescriptor map( Composite composite )
+        public CompositeDescriptor apply( Composite composite )
         {
             if( composite instanceof Proxy )
             {
@@ -158,7 +158,7 @@ public interface Qi4j
     Function<Composite, CompositeInstance> FUNCTION_COMPOSITE_INSTANCE_OF = new Function<Composite, CompositeInstance>()
     {
         @Override
-        public CompositeInstance map( Composite composite )
+        public CompositeInstance apply( Composite composite )
         {
             if( composite instanceof Proxy )
             {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/common/MetaInfo.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/common/MetaInfo.java b/core/api/src/main/java/org/qi4j/api/common/MetaInfo.java
index b746711..9fd084c 100644
--- a/core/api/src/main/java/org/qi4j/api/common/MetaInfo.java
+++ b/core/api/src/main/java/org/qi4j/api/common/MetaInfo.java
@@ -110,7 +110,7 @@ public final class MetaInfo
             Iterable<Type> types = typesOf( metaInfoclass );
             for( Type type : types )
             {
-                metaInfoMap.put( Classes.RAW_CLASS.map( type ), metaInfo );
+                metaInfoMap.put( Classes.RAW_CLASS.apply( type ), metaInfo );
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/common/TypeName.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/common/TypeName.java b/core/api/src/main/java/org/qi4j/api/common/TypeName.java
index df9d6c5..c351b8a 100644
--- a/core/api/src/main/java/org/qi4j/api/common/TypeName.java
+++ b/core/api/src/main/java/org/qi4j/api/common/TypeName.java
@@ -21,7 +21,7 @@ public final class TypeName
 
     public static TypeName nameOf( Type type )
     {
-        return nameOf( Classes.RAW_CLASS.map( type ) );
+        return nameOf( Classes.RAW_CLASS.apply( type ) );
     }
 
     public static TypeName nameOf( String typeName )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/common/UseDefaults.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/common/UseDefaults.java b/core/api/src/main/java/org/qi4j/api/common/UseDefaults.java
index 0f61ea1..859d469 100644
--- a/core/api/src/main/java/org/qi4j/api/common/UseDefaults.java
+++ b/core/api/src/main/java/org/qi4j/api/common/UseDefaults.java
@@ -46,7 +46,7 @@ import java.lang.annotation.Target;
  * </p>
  * <p>
  * It is also possible to change the default values for Composites during the assembly. This is done by calling the
- * {@link org.qi4j.bootstrap.ModuleAssembly#forMixin(Class)} method.
+ * {@code org.qi4j.bootstrap.ModuleAssembly#forMixin(Class)} method.
  * </p>
  * <p>
  * Example;

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/composite/CompositeContext.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/composite/CompositeContext.java b/core/api/src/main/java/org/qi4j/api/composite/CompositeContext.java
index d8a2aa7..fc1cd05 100644
--- a/core/api/src/main/java/org/qi4j/api/composite/CompositeContext.java
+++ b/core/api/src/main/java/org/qi4j/api/composite/CompositeContext.java
@@ -52,7 +52,7 @@ public class CompositeContext<T extends TransientComposite>
     {
         TransientComposite composite = get();
 
-        Iterable<Class<?>> types = Qi4j.FUNCTION_COMPOSITE_INSTANCE_OF.map( composite ).types();
+        Iterable<Class<?>> types = Qi4j.FUNCTION_COMPOSITE_INSTANCE_OF.apply( composite ).types();
         return (T) Proxy.newProxyInstance(
             composite.getClass().getClassLoader(),
             toArray( Class.class, Iterables.<Class>cast( types ) ),

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/composite/PropertyMapper.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/composite/PropertyMapper.java b/core/api/src/main/java/org/qi4j/api/composite/PropertyMapper.java
index 3543260..a47db83 100644
--- a/core/api/src/main/java/org/qi4j/api/composite/PropertyMapper.java
+++ b/core/api/src/main/java/org/qi4j/api/composite/PropertyMapper.java
@@ -113,7 +113,7 @@ public final class PropertyMapper
             {
                 strategy = STRATEGY.get( Array.class );
             }
-            else if( Enum.class.isAssignableFrom( Classes.RAW_CLASS.map( propertyType ) ) )
+            else if( Enum.class.isAssignableFrom( Classes.RAW_CLASS.apply( propertyType ) ) )
             {
                 strategy = STRATEGY.get( Enum.class );
             }
@@ -444,7 +444,7 @@ public final class PropertyMapper
         @SuppressWarnings( "unchecked" )
         public Object map( Composite composite, Type type, String value )
         {
-            return Qi4j.FUNCTION_COMPOSITE_INSTANCE_OF.map( composite ).module().newValueFromSerializedState( (Class<Object>) type, value );
+            return Qi4j.FUNCTION_COMPOSITE_INSTANCE_OF.apply( composite ).module().newValueFromSerializedState( (Class<Object>) type, value );
         }
     }
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/configuration/Configuration.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/configuration/Configuration.java b/core/api/src/main/java/org/qi4j/api/configuration/Configuration.java
index 52ec60f..966da22 100644
--- a/core/api/src/main/java/org/qi4j/api/configuration/Configuration.java
+++ b/core/api/src/main/java/org/qi4j/api/configuration/Configuration.java
@@ -52,7 +52,7 @@ import static org.qi4j.functional.Iterables.first;
  * <p>
  * If a new Configuration instance is created then it will be populated with properties
  * from the properties file whose filesystem name is the same as the identity (e.g. "MyService.properties").
- * If a service is not given a name via the {@link org.qi4j.bootstrap.ServiceDeclaration#identifiedBy(String)}, the
+ * If a service is not given a name via the {@code org.qi4j.bootstrap.ServiceDeclaration#identifiedBy(String)}, the
  * name will default to the FQCN of the ServiceComposite type.
  * </p>
  * <p>
@@ -128,7 +128,7 @@ public interface Configuration<T>
 
     /**
      * Updates the values of the managed user ConfigurationComposite instance from the underlying
-     * {@link org.qi4j.spi.entitystore.EntityStore}.  Any modified values in the current user configuration that
+     * {@code org.qi4j.spi.entitystore.EntityStore}.  Any modified values in the current user configuration that
      * has not been saved, via {@link #save()} method, will be lost.
      */
     void refresh();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/constraint/ConstraintViolationException.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/constraint/ConstraintViolationException.java b/core/api/src/main/java/org/qi4j/api/constraint/ConstraintViolationException.java
index 28e41b3..9697a8b 100644
--- a/core/api/src/main/java/org/qi4j/api/constraint/ConstraintViolationException.java
+++ b/core/api/src/main/java/org/qi4j/api/constraint/ConstraintViolationException.java
@@ -25,9 +25,9 @@ import java.util.Collection;
 import java.util.Locale;
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
+import java.util.function.Function;
 import org.qi4j.api.Qi4j;
 import org.qi4j.api.composite.Composite;
-import org.qi4j.functional.Function;
 import org.qi4j.functional.Iterables;
 
 /**
@@ -54,7 +54,7 @@ public class ConstraintViolationException
                                          Collection<ConstraintViolation> constraintViolations
     )
     {
-        this( instance.toString(), Qi4j.FUNCTION_DESCRIPTOR_FOR.map( instance ).types(), method, constraintViolations );
+        this( instance.toString(), Qi4j.FUNCTION_DESCRIPTOR_FOR.apply( instance ).types(), method, constraintViolations );
     }
 
     public ConstraintViolationException( String instanceToString,
@@ -191,7 +191,7 @@ public class ConstraintViolationException
                 classes = "[" + Iterables.<Class<?>>toString( instanceTypes, new Function<Class<?>, String>()
                 {
                     @Override
-                    public String map( Class<?> from )
+                    public String apply( Class<?> from )
                     {
                         return from.getSimpleName();
                     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/dataset/DataSet.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/dataset/DataSet.java b/core/api/src/main/java/org/qi4j/api/dataset/DataSet.java
index c62db9c..e194424 100644
--- a/core/api/src/main/java/org/qi4j/api/dataset/DataSet.java
+++ b/core/api/src/main/java/org/qi4j/api/dataset/DataSet.java
@@ -1,7 +1,7 @@
 package org.qi4j.api.dataset;
 
-import org.qi4j.functional.Function;
-import org.qi4j.functional.Specification;
+import java.util.function.Function;
+import java.util.function.Predicate;
 
 /**
  * definition.constrain(entity(Person.class))
@@ -10,7 +10,7 @@ import org.qi4j.functional.Specification;
  */
 public interface DataSet<T>
 {
-    DataSet<T> constrain( Specification<T> selection );
+    DataSet<T> constrain( Predicate<T> selection );
 
     <U> DataSet<U> project( Function<T, U> conversion );
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/dataset/Query.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/dataset/Query.java b/core/api/src/main/java/org/qi4j/api/dataset/Query.java
index 651462f..5c4db0e 100644
--- a/core/api/src/main/java/org/qi4j/api/dataset/Query.java
+++ b/core/api/src/main/java/org/qi4j/api/dataset/Query.java
@@ -1,9 +1,9 @@
 package org.qi4j.api.dataset;
 
+import java.util.function.Predicate;
 import org.qi4j.api.property.Property;
 import org.qi4j.api.query.QueryException;
 import org.qi4j.api.query.QueryExecutionException;
-import org.qi4j.functional.Specification;
 import org.qi4j.functional.Visitor;
 
 /**
@@ -16,7 +16,7 @@ public interface Query<T>
         ASCENDING, DESCENDING
     }
 
-    Query filter( Specification<T> filter );
+    Query filter( Predicate<T> filter );
 
     Query orderBy( final Property<?> property, final Order order );
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/dataset/iterable/IterableDataSet.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/dataset/iterable/IterableDataSet.java b/core/api/src/main/java/org/qi4j/api/dataset/iterable/IterableDataSet.java
index 8808427..213763b 100644
--- a/core/api/src/main/java/org/qi4j/api/dataset/iterable/IterableDataSet.java
+++ b/core/api/src/main/java/org/qi4j/api/dataset/iterable/IterableDataSet.java
@@ -1,10 +1,10 @@
 package org.qi4j.api.dataset.iterable;
 
+import java.util.function.Function;
+import java.util.function.Predicate;
 import org.qi4j.api.dataset.DataSet;
 import org.qi4j.api.dataset.Query;
-import org.qi4j.functional.Function;
 import org.qi4j.functional.Iterables;
-import org.qi4j.functional.Specification;
 
 /**
  * TODO
@@ -20,7 +20,7 @@ public class IterableDataSet<T>
     }
 
     @Override
-    public DataSet<T> constrain( Specification<T> selection )
+    public DataSet<T> constrain( Predicate<T> selection )
     {
         return new IterableDataSet<T>( Iterables.filter( selection, iterable ) );
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/dataset/iterable/IterableQuery.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/dataset/iterable/IterableQuery.java b/core/api/src/main/java/org/qi4j/api/dataset/iterable/IterableQuery.java
index d63e6f8..7e67184 100644
--- a/core/api/src/main/java/org/qi4j/api/dataset/iterable/IterableQuery.java
+++ b/core/api/src/main/java/org/qi4j/api/dataset/iterable/IterableQuery.java
@@ -2,11 +2,11 @@ package org.qi4j.api.dataset.iterable;
 
 import java.util.HashMap;
 import java.util.Map;
+import java.util.function.Predicate;
 import org.qi4j.api.dataset.Query;
 import org.qi4j.api.property.Property;
 import org.qi4j.api.query.QueryException;
 import org.qi4j.functional.Iterables;
-import org.qi4j.functional.Specification;
 import org.qi4j.functional.Visitor;
 
 /**
@@ -25,7 +25,7 @@ public class IterableQuery<T> implements Query<T>
     }
 
     @Override
-    public Query filter( Specification<T> filter )
+    public Query filter( Predicate<T> filter )
     {
         iterable = Iterables.filter( filter, iterable );
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/query/NotQueryableException.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/query/NotQueryableException.java b/core/api/src/main/java/org/qi4j/api/query/NotQueryableException.java
index 74737eb..0a29086 100644
--- a/core/api/src/main/java/org/qi4j/api/query/NotQueryableException.java
+++ b/core/api/src/main/java/org/qi4j/api/query/NotQueryableException.java
@@ -57,7 +57,7 @@ public class NotQueryableException
             throw new NotQueryableException(
                 String.format(
                     "%1$s \"%2$s\" (%3$s) is not queryable as has been marked with @Queryable(false)",
-                    Classes.RAW_CLASS.map( GenericPropertyInfo.propertyTypeOf( accessor ) ).getSimpleName(),
+                    Classes.RAW_CLASS.apply( GenericPropertyInfo.propertyTypeOf( accessor ) ).getSimpleName(),
                     ( (Member) accessor ).getName(),
                     ( (Member) accessor ).getDeclaringClass().getName()
                 )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/query/QueryBuilder.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/query/QueryBuilder.java b/core/api/src/main/java/org/qi4j/api/query/QueryBuilder.java
index c07552c..2325c33 100644
--- a/core/api/src/main/java/org/qi4j/api/query/QueryBuilder.java
+++ b/core/api/src/main/java/org/qi4j/api/query/QueryBuilder.java
@@ -19,8 +19,8 @@
  */
 package org.qi4j.api.query;
 
+import java.util.function.Predicate;
 import org.qi4j.api.composite.Composite;
-import org.qi4j.functional.Specification;
 
 /**
  * QueryBuilders are used to create {@link Query} instances.
@@ -43,7 +43,7 @@ public interface QueryBuilder<T>
      *
      * @return a new builder with the added where-clause
      */
-    QueryBuilder<T> where( Specification<Composite> specification );
+    QueryBuilder<T> where( Predicate<Composite> specification );
 
     /**
      * Create a new query with the declared where-clauses that will be evaluated against the iterable entries.

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/query/QueryExpressions.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/query/QueryExpressions.java b/core/api/src/main/java/org/qi4j/api/query/QueryExpressions.java
index 75276a0..8cf266e 100644
--- a/core/api/src/main/java/org/qi4j/api/query/QueryExpressions.java
+++ b/core/api/src/main/java/org/qi4j/api/query/QueryExpressions.java
@@ -28,6 +28,7 @@ import java.lang.reflect.Proxy;
 import java.lang.reflect.Type;
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.function.Predicate;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.association.GenericAssociationInfo;
 import org.qi4j.api.association.ManyAssociation;
@@ -64,7 +65,6 @@ import org.qi4j.api.query.grammar.PropertyNullSpecification;
 import org.qi4j.api.query.grammar.PropertyReference;
 import org.qi4j.api.query.grammar.Variable;
 import org.qi4j.api.util.NullArgumentException;
-import org.qi4j.functional.Specification;
 
 import static org.qi4j.functional.Iterables.first;
 import static org.qi4j.functional.Iterables.prepend;
@@ -300,9 +300,9 @@ public final class QueryExpressions
      * @return a new AND specification
      */
     @SafeVarargs
-    public static AndSpecification and( Specification<Composite> left,
-                                        Specification<Composite> right,
-                                        Specification<Composite>... optionalRight
+    public static AndSpecification and( Predicate<Composite> left,
+                                        Predicate<Composite> right,
+                                        Predicate<Composite>... optionalRight
     )
     {
         return new AndSpecification( prepend( left, prepend( right, Arrays.asList( optionalRight ) ) ) );
@@ -316,7 +316,7 @@ public final class QueryExpressions
      * @return a new OR specification
      */
     @SafeVarargs
-    public static OrSpecification or( Specification<Composite>... specs )
+    public static OrSpecification or( Predicate<Composite>... specs )
     {
         return new OrSpecification( Arrays.asList( specs ) );
     }
@@ -328,7 +328,7 @@ public final class QueryExpressions
      *
      * @return a new NOT specification
      */
-    public static NotSpecification not( Specification<Composite> operand )
+    public static NotSpecification not( Predicate<Composite> operand )
     {
         return new NotSpecification( operand );
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/query/grammar/AndSpecification.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/query/grammar/AndSpecification.java b/core/api/src/main/java/org/qi4j/api/query/grammar/AndSpecification.java
index 9644235..557fe0a 100644
--- a/core/api/src/main/java/org/qi4j/api/query/grammar/AndSpecification.java
+++ b/core/api/src/main/java/org/qi4j/api/query/grammar/AndSpecification.java
@@ -1,7 +1,7 @@
 package org.qi4j.api.query.grammar;
 
+import java.util.function.Predicate;
 import org.qi4j.api.composite.Composite;
-import org.qi4j.functional.Specification;
 import org.qi4j.functional.Specifications;
 
 /**
@@ -11,15 +11,15 @@ public class AndSpecification
     extends BinarySpecification
 {
 
-    public AndSpecification( Iterable<Specification<Composite>> operands )
+    public AndSpecification( Iterable<Predicate<Composite>> operands )
     {
         super( operands );
     }
 
     @Override
-    public boolean satisfiedBy( Composite item )
+    public boolean test( Composite item )
     {
-        return Specifications.and( operands ).satisfiedBy( item );
+        return Specifications.and( operands ).test( item );
     }
 
     @Override
@@ -27,7 +27,7 @@ public class AndSpecification
     {
         StringBuilder sb = new StringBuilder( "(" );
         String and = "";
-        for( Specification<Composite> operand : operands )
+        for( Predicate<Composite> operand : operands )
         {
             sb.append( and ).append( operand );
             and = " and ";

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/query/grammar/AssociationFunction.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/query/grammar/AssociationFunction.java b/core/api/src/main/java/org/qi4j/api/query/grammar/AssociationFunction.java
index ee423a0..7978a62 100644
--- a/core/api/src/main/java/org/qi4j/api/query/grammar/AssociationFunction.java
+++ b/core/api/src/main/java/org/qi4j/api/query/grammar/AssociationFunction.java
@@ -22,6 +22,7 @@ import java.lang.reflect.AccessibleObject;
 import java.lang.reflect.Member;
 import java.lang.reflect.Proxy;
 import java.lang.reflect.Type;
+import java.util.function.Function;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.association.AssociationStateHolder;
 import org.qi4j.api.association.GenericAssociationInfo;
@@ -31,7 +32,6 @@ import org.qi4j.api.composite.Composite;
 import org.qi4j.api.composite.CompositeInstance;
 import org.qi4j.api.query.QueryExpressionException;
 import org.qi4j.api.util.Classes;
-import org.qi4j.functional.Function;
 
 import static org.qi4j.api.util.Classes.typeOf;
 
@@ -58,9 +58,9 @@ public class AssociationFunction<T>
         this.accessor = accessor;
 
         Type returnType = typeOf( accessor );
-        if( !Association.class.isAssignableFrom( Classes.RAW_CLASS.map( returnType ) )
-            && !ManyAssociation.class.isAssignableFrom( Classes.RAW_CLASS.map( returnType ) )
-            && !NamedAssociation.class.isAssignableFrom( Classes.RAW_CLASS.map( returnType ) ) )
+        if( !Association.class.isAssignableFrom( Classes.RAW_CLASS.apply( returnType ) )
+            && !ManyAssociation.class.isAssignableFrom( Classes.RAW_CLASS.apply( returnType ) )
+            && !NamedAssociation.class.isAssignableFrom( Classes.RAW_CLASS.apply( returnType ) ) )
         {
             throw new QueryExpressionException( "Unsupported association type:" + returnType );
         }
@@ -92,14 +92,14 @@ public class AssociationFunction<T>
     }
 
     @Override
-    public Association<T> map( Composite entity )
+    public Association<T> apply( Composite entity )
     {
         try
         {
             Object target = entity;
             if( traversedAssociation != null )
             {
-                Association<?> association = traversedAssociation.map( entity );
+                Association<?> association = traversedAssociation.apply( entity );
                 if( association == null )
                 {
                     return null;

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/query/grammar/AssociationNotNullSpecification.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/query/grammar/AssociationNotNullSpecification.java b/core/api/src/main/java/org/qi4j/api/query/grammar/AssociationNotNullSpecification.java
index 86797df..f0a38c0 100644
--- a/core/api/src/main/java/org/qi4j/api/query/grammar/AssociationNotNullSpecification.java
+++ b/core/api/src/main/java/org/qi4j/api/query/grammar/AssociationNotNullSpecification.java
@@ -1,5 +1,6 @@
 package org.qi4j.api.query.grammar;
 
+import java.util.function.Predicate;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.composite.Composite;
 
@@ -7,7 +8,7 @@ import org.qi4j.api.composite.Composite;
  * Association not null Specification.
  */
 public class AssociationNotNullSpecification<T>
-    extends ExpressionSpecification
+    implements Predicate<Composite>
 {
     private AssociationFunction<T> association;
 
@@ -22,11 +23,11 @@ public class AssociationNotNullSpecification<T>
     }
 
     @Override
-    public boolean satisfiedBy( Composite item )
+    public boolean test( Composite item )
     {
         try
         {
-            Association<T> assoc = association.map( item );
+            Association<T> assoc = association.apply( item );
 
             if( assoc == null )
             {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/query/grammar/AssociationNullSpecification.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/query/grammar/AssociationNullSpecification.java b/core/api/src/main/java/org/qi4j/api/query/grammar/AssociationNullSpecification.java
index 5834d4b..be320c3 100644
--- a/core/api/src/main/java/org/qi4j/api/query/grammar/AssociationNullSpecification.java
+++ b/core/api/src/main/java/org/qi4j/api/query/grammar/AssociationNullSpecification.java
@@ -1,5 +1,6 @@
 package org.qi4j.api.query.grammar;
 
+import java.util.function.Predicate;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.composite.Composite;
 
@@ -7,7 +8,7 @@ import org.qi4j.api.composite.Composite;
  * Association null Specification.
  */
 public class AssociationNullSpecification<T>
-    extends ExpressionSpecification
+    implements Predicate<Composite>
 {
     private AssociationFunction<T> association;
 
@@ -22,11 +23,11 @@ public class AssociationNullSpecification<T>
     }
 
     @Override
-    public boolean satisfiedBy( Composite item )
+    public boolean test( Composite item )
     {
         try
         {
-            Association<T> assoc = association.map( item );
+            Association<T> assoc = association.apply( item );
 
             if( assoc == null )
             {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/query/grammar/BinarySpecification.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/query/grammar/BinarySpecification.java b/core/api/src/main/java/org/qi4j/api/query/grammar/BinarySpecification.java
index f251f99..3480cb1 100644
--- a/core/api/src/main/java/org/qi4j/api/query/grammar/BinarySpecification.java
+++ b/core/api/src/main/java/org/qi4j/api/query/grammar/BinarySpecification.java
@@ -1,22 +1,22 @@
 package org.qi4j.api.query.grammar;
 
+import java.util.function.Predicate;
 import org.qi4j.api.composite.Composite;
-import org.qi4j.functional.Specification;
 
 /**
  * Base binary Specification, used for AND and OR Specifications..
  */
 public abstract class BinarySpecification
-    extends ExpressionSpecification
+    implements Predicate<Composite>
 {
-    protected final Iterable<Specification<Composite>> operands;
+    protected final Iterable<Predicate<Composite>> operands;
 
-    protected BinarySpecification( Iterable<Specification<Composite>> operands )
+    protected BinarySpecification( Iterable<Predicate<Composite>> operands )
     {
         this.operands = operands;
     }
 
-    public Iterable<Specification<Composite>> operands()
+    public Iterable<Predicate<Composite>> operands()
     {
         return operands;
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/query/grammar/ComparisonSpecification.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/query/grammar/ComparisonSpecification.java b/core/api/src/main/java/org/qi4j/api/query/grammar/ComparisonSpecification.java
index b8c743e..29d2680 100644
--- a/core/api/src/main/java/org/qi4j/api/query/grammar/ComparisonSpecification.java
+++ b/core/api/src/main/java/org/qi4j/api/query/grammar/ComparisonSpecification.java
@@ -1,5 +1,6 @@
 package org.qi4j.api.query.grammar;
 
+import java.util.function.Predicate;
 import org.qi4j.api.composite.Composite;
 import org.qi4j.api.property.Property;
 
@@ -7,7 +8,7 @@ import org.qi4j.api.property.Property;
  * Base comparison Specification.
  */
 public abstract class ComparisonSpecification<T>
-    extends ExpressionSpecification
+    implements Predicate<Composite>
 {
     protected final PropertyFunction<T> property;
     protected final T value;
@@ -24,11 +25,11 @@ public abstract class ComparisonSpecification<T>
     }
 
     @Override
-    public final boolean satisfiedBy( Composite item )
+    public final boolean test( Composite item )
     {
         try
         {
-            Property<T> prop = property.map( item );
+            Property<T> prop = property.apply( item );
 
             if( prop == null )
             {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/query/grammar/ContainsAllSpecification.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/query/grammar/ContainsAllSpecification.java b/core/api/src/main/java/org/qi4j/api/query/grammar/ContainsAllSpecification.java
index adf9c76..7a814b8 100644
--- a/core/api/src/main/java/org/qi4j/api/query/grammar/ContainsAllSpecification.java
+++ b/core/api/src/main/java/org/qi4j/api/query/grammar/ContainsAllSpecification.java
@@ -1,6 +1,7 @@
 package org.qi4j.api.query.grammar;
 
 import java.util.Collection;
+import java.util.function.Predicate;
 import org.qi4j.api.composite.Composite;
 import org.qi4j.functional.Iterables;
 
@@ -8,7 +9,7 @@ import org.qi4j.functional.Iterables;
  * Contains All Specification.
  */
 public class ContainsAllSpecification<T>
-    extends ExpressionSpecification
+    implements Predicate<Composite>
 {
     private PropertyFunction<? extends Collection<T>> collectionProperty;
     private Iterable<T> valueCollection;
@@ -32,9 +33,9 @@ public class ContainsAllSpecification<T>
     }
 
     @Override
-    public boolean satisfiedBy( Composite item )
+    public boolean test( Composite item )
     {
-        Collection<T> collection = collectionProperty.map( item ).get();
+        Collection<T> collection = collectionProperty.apply( item ).get();
 
         if( collection == null )
         {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/query/grammar/ContainsSpecification.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/query/grammar/ContainsSpecification.java b/core/api/src/main/java/org/qi4j/api/query/grammar/ContainsSpecification.java
index 1622c52..aed36bf 100644
--- a/core/api/src/main/java/org/qi4j/api/query/grammar/ContainsSpecification.java
+++ b/core/api/src/main/java/org/qi4j/api/query/grammar/ContainsSpecification.java
@@ -1,13 +1,14 @@
 package org.qi4j.api.query.grammar;
 
 import java.util.Collection;
+import java.util.function.Predicate;
 import org.qi4j.api.composite.Composite;
 
 /**
  * Contains Specification.
  */
 public class ContainsSpecification<T>
-    extends ExpressionSpecification
+    implements Predicate<Composite>
 {
     private PropertyFunction<? extends Collection<T>> collectionProperty;
     private T value;
@@ -29,9 +30,9 @@ public class ContainsSpecification<T>
     }
 
     @Override
-    public boolean satisfiedBy( Composite item )
+    public boolean test( Composite item )
     {
-        Collection<T> collection = collectionProperty.map( item ).get();
+        Collection<T> collection = collectionProperty.apply( item ).get();
 
         if( collection == null )
         {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/query/grammar/ExpressionSpecification.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/query/grammar/ExpressionSpecification.java b/core/api/src/main/java/org/qi4j/api/query/grammar/ExpressionSpecification.java
deleted file mode 100644
index d1338a2..0000000
--- a/core/api/src/main/java/org/qi4j/api/query/grammar/ExpressionSpecification.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package org.qi4j.api.query.grammar;
-
-import org.qi4j.api.composite.Composite;
-import org.qi4j.functional.Specification;
-
-import static org.qi4j.functional.Iterables.append;
-import static org.qi4j.functional.Iterables.iterable;
-
-/**
- * Base expression Specification.
- */
-public abstract class ExpressionSpecification
-    implements Specification<Composite>
-{
-
-    @SuppressWarnings( "unchecked" )
-    public AndSpecification and( Specification<Composite> specification )
-    {
-        if( this instanceof AndSpecification )
-        {
-            return new AndSpecification( append( specification, ( (AndSpecification) this ).operands() ) );
-        }
-        else
-        {
-            return new AndSpecification( iterable( this, specification ) );
-        }
-    }
-
-    @SuppressWarnings( "unchecked" )
-    public OrSpecification or( Specification<Composite> specification )
-    {
-        if( this instanceof OrSpecification )
-        {
-            return new OrSpecification( append( specification, ( (OrSpecification) this ).operands() ) );
-        }
-        else
-        {
-            return new OrSpecification( iterable( this, specification ) );
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/query/grammar/ManyAssociationContainsSpecification.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/query/grammar/ManyAssociationContainsSpecification.java b/core/api/src/main/java/org/qi4j/api/query/grammar/ManyAssociationContainsSpecification.java
index d8a6b2e..893a50b 100644
--- a/core/api/src/main/java/org/qi4j/api/query/grammar/ManyAssociationContainsSpecification.java
+++ b/core/api/src/main/java/org/qi4j/api/query/grammar/ManyAssociationContainsSpecification.java
@@ -18,6 +18,7 @@
  */
 package org.qi4j.api.query.grammar;
 
+import java.util.function.Predicate;
 import org.qi4j.api.association.ManyAssociation;
 import org.qi4j.api.composite.Composite;
 
@@ -25,7 +26,7 @@ import org.qi4j.api.composite.Composite;
  * ManyAssociation Contains Specification.
  */
 public class ManyAssociationContainsSpecification<T>
-    extends ExpressionSpecification
+    implements Predicate<Composite>
 {
     private final ManyAssociationFunction<T> manyAssociationFunction;
     private final T value;
@@ -47,9 +48,9 @@ public class ManyAssociationContainsSpecification<T>
     }
 
     @Override
-    public boolean satisfiedBy( Composite item )
+    public boolean test( Composite item )
     {
-        ManyAssociation<T> collection = manyAssociationFunction.map( item );
+        ManyAssociation<T> collection = manyAssociationFunction.apply( item );
         if( collection == null )
         {
             return false;

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/query/grammar/ManyAssociationFunction.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/query/grammar/ManyAssociationFunction.java b/core/api/src/main/java/org/qi4j/api/query/grammar/ManyAssociationFunction.java
index e91cdeb..bac4163 100644
--- a/core/api/src/main/java/org/qi4j/api/query/grammar/ManyAssociationFunction.java
+++ b/core/api/src/main/java/org/qi4j/api/query/grammar/ManyAssociationFunction.java
@@ -21,11 +21,11 @@ package org.qi4j.api.query.grammar;
 import java.lang.reflect.AccessibleObject;
 import java.lang.reflect.Member;
 import java.lang.reflect.Proxy;
+import java.util.function.Function;
 import org.qi4j.api.association.AssociationStateHolder;
 import org.qi4j.api.association.ManyAssociation;
 import org.qi4j.api.composite.Composite;
 import org.qi4j.api.composite.CompositeInstance;
-import org.qi4j.functional.Function;
 
 /**
  * Function to get Entity ManyAssociations.
@@ -71,14 +71,14 @@ public class ManyAssociationFunction<T>
     }
 
     @Override
-    public ManyAssociation<T> map( Composite entity )
+    public ManyAssociation<T> apply( Composite entity )
     {
         try
         {
             Object target = entity;
             if( traversedAssociation != null )
             {
-                target = traversedAssociation.map( entity ).get();
+                target = traversedAssociation.apply( entity ).get();
             }
             if( traversedManyAssociation != null )
             {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/query/grammar/MatchesSpecification.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/query/grammar/MatchesSpecification.java b/core/api/src/main/java/org/qi4j/api/query/grammar/MatchesSpecification.java
index 101d64d..50ccd40 100644
--- a/core/api/src/main/java/org/qi4j/api/query/grammar/MatchesSpecification.java
+++ b/core/api/src/main/java/org/qi4j/api/query/grammar/MatchesSpecification.java
@@ -1,5 +1,6 @@
 package org.qi4j.api.query.grammar;
 
+import java.util.function.Predicate;
 import org.qi4j.api.composite.Composite;
 import org.qi4j.api.property.Property;
 
@@ -7,7 +8,7 @@ import org.qi4j.api.property.Property;
  * Regular expression match Specification.
  */
 public class MatchesSpecification
-    extends ExpressionSpecification
+    implements Predicate<Composite>
 {
     private PropertyFunction<String> property;
     private Object value;
@@ -40,9 +41,9 @@ public class MatchesSpecification
     }
 
     @Override
-    public boolean satisfiedBy( Composite item )
+    public boolean test( Composite item )
     {
-        Property<String> prop = property.map( item );
+        Property<String> prop = property.apply( item );
 
         if( prop == null )
         {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/query/grammar/NamedAssociationContainsNameSpecification.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/query/grammar/NamedAssociationContainsNameSpecification.java b/core/api/src/main/java/org/qi4j/api/query/grammar/NamedAssociationContainsNameSpecification.java
index c20987e..a882d56 100644
--- a/core/api/src/main/java/org/qi4j/api/query/grammar/NamedAssociationContainsNameSpecification.java
+++ b/core/api/src/main/java/org/qi4j/api/query/grammar/NamedAssociationContainsNameSpecification.java
@@ -18,6 +18,7 @@
  */
 package org.qi4j.api.query.grammar;
 
+import java.util.function.Predicate;
 import org.qi4j.api.association.NamedAssociation;
 import org.qi4j.api.composite.Composite;
 
@@ -25,7 +26,7 @@ import org.qi4j.api.composite.Composite;
  * NamedAssociation Contains Specification.
  */
 public class NamedAssociationContainsNameSpecification<T>
-    extends ExpressionSpecification
+    implements Predicate<Composite>
 {
     private final NamedAssociationFunction<T> namedAssociationFunction;
     private final String name;
@@ -47,9 +48,9 @@ public class NamedAssociationContainsNameSpecification<T>
     }
 
     @Override
-    public boolean satisfiedBy( Composite item )
+    public boolean test( Composite item )
     {
-        NamedAssociation<T> collection = namedAssociationFunction.map( item );
+        NamedAssociation<T> collection = namedAssociationFunction.apply( item );
         if( collection == null )
         {
             return false;

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/query/grammar/NamedAssociationContainsSpecification.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/query/grammar/NamedAssociationContainsSpecification.java b/core/api/src/main/java/org/qi4j/api/query/grammar/NamedAssociationContainsSpecification.java
index 22079aa..9e1082a 100644
--- a/core/api/src/main/java/org/qi4j/api/query/grammar/NamedAssociationContainsSpecification.java
+++ b/core/api/src/main/java/org/qi4j/api/query/grammar/NamedAssociationContainsSpecification.java
@@ -18,6 +18,7 @@
  */
 package org.qi4j.api.query.grammar;
 
+import java.util.function.Predicate;
 import org.qi4j.api.association.NamedAssociation;
 import org.qi4j.api.composite.Composite;
 
@@ -25,7 +26,7 @@ import org.qi4j.api.composite.Composite;
  * NamedAssociation Contains Specification.
  */
 public class NamedAssociationContainsSpecification<T>
-    extends ExpressionSpecification
+    implements Predicate<Composite>
 {
     private final NamedAssociationFunction<T> namedAssociationFunction;
     private final T value;
@@ -47,9 +48,9 @@ public class NamedAssociationContainsSpecification<T>
     }
 
     @Override
-    public boolean satisfiedBy( Composite item )
+    public boolean test( Composite item )
     {
-        NamedAssociation<T> collection = namedAssociationFunction.map( item );
+        NamedAssociation<T> collection = namedAssociationFunction.apply( item );
         if( collection == null )
         {
             return false;

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/query/grammar/NamedAssociationFunction.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/query/grammar/NamedAssociationFunction.java b/core/api/src/main/java/org/qi4j/api/query/grammar/NamedAssociationFunction.java
index 3f7b8e3..44e651e 100644
--- a/core/api/src/main/java/org/qi4j/api/query/grammar/NamedAssociationFunction.java
+++ b/core/api/src/main/java/org/qi4j/api/query/grammar/NamedAssociationFunction.java
@@ -21,11 +21,11 @@ package org.qi4j.api.query.grammar;
 import java.lang.reflect.AccessibleObject;
 import java.lang.reflect.Member;
 import java.lang.reflect.Proxy;
+import java.util.function.Function;
 import org.qi4j.api.association.AssociationStateHolder;
 import org.qi4j.api.association.NamedAssociation;
 import org.qi4j.api.composite.Composite;
 import org.qi4j.api.composite.CompositeInstance;
-import org.qi4j.functional.Function;
 
 /**
  * Function to get Entity NamedAssociations.
@@ -71,14 +71,14 @@ public class NamedAssociationFunction<T>
     }
 
     @Override
-    public NamedAssociation<T> map( Composite entity )
+    public NamedAssociation<T> apply( Composite entity )
     {
         try
         {
             Object target = entity;
             if( traversedAssociation != null )
             {
-                target = traversedAssociation.map( entity ).get();
+                target = traversedAssociation.apply( entity ).get();
             }
             if( traversedManyAssociation != null )
             {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/query/grammar/NotSpecification.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/query/grammar/NotSpecification.java b/core/api/src/main/java/org/qi4j/api/query/grammar/NotSpecification.java
index a17ea82..4efefb8 100644
--- a/core/api/src/main/java/org/qi4j/api/query/grammar/NotSpecification.java
+++ b/core/api/src/main/java/org/qi4j/api/query/grammar/NotSpecification.java
@@ -1,30 +1,30 @@
 package org.qi4j.api.query.grammar;
 
+import java.util.function.Predicate;
 import org.qi4j.api.composite.Composite;
-import org.qi4j.functional.Specification;
 import org.qi4j.functional.Specifications;
 
 /**
  * NOT Specification.
  */
-public class NotSpecification implements Specification<Composite>
+public class NotSpecification implements Predicate<Composite>
 {
-    private Specification<Composite> operand;
+    private Predicate<Composite> operand;
 
-    public NotSpecification( Specification<Composite> operand )
+    public NotSpecification( Predicate<Composite> operand )
     {
         this.operand = operand;
     }
 
-    public Specification<Composite> operand()
+    public Predicate<Composite> operand()
     {
         return operand;
     }
 
     @Override
-    public boolean satisfiedBy( Composite item )
+    public boolean test( Composite item )
     {
-        return Specifications.not( operand ).satisfiedBy( item );
+        return Specifications.not( operand ).test( item );
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/query/grammar/OrSpecification.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/query/grammar/OrSpecification.java b/core/api/src/main/java/org/qi4j/api/query/grammar/OrSpecification.java
index 1c6454a..d9b4337 100644
--- a/core/api/src/main/java/org/qi4j/api/query/grammar/OrSpecification.java
+++ b/core/api/src/main/java/org/qi4j/api/query/grammar/OrSpecification.java
@@ -1,7 +1,7 @@
 package org.qi4j.api.query.grammar;
 
+import java.util.function.Predicate;
 import org.qi4j.api.composite.Composite;
-import org.qi4j.functional.Specification;
 import org.qi4j.functional.Specifications;
 
 /**
@@ -11,15 +11,15 @@ public class OrSpecification
     extends BinarySpecification
 {
 
-    public OrSpecification( Iterable<Specification<Composite>> operands )
+    public OrSpecification( Iterable<Predicate<Composite>> operands )
     {
         super( operands );
     }
 
     @Override
-    public boolean satisfiedBy( Composite item )
+    public boolean test( Composite item )
     {
-        return Specifications.or( operands ).satisfiedBy( item );
+        return Specifications.or( operands ).test( item );
     }
 
     @Override
@@ -27,7 +27,7 @@ public class OrSpecification
     {
         StringBuilder sb = new StringBuilder( "(" );
         String or = "";
-        for( Specification<Composite> operand : operands )
+        for( Predicate<Composite> operand : operands )
         {
             sb.append( or ).append( operand );
             or = " or ";

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/query/grammar/PropertyFunction.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/query/grammar/PropertyFunction.java b/core/api/src/main/java/org/qi4j/api/query/grammar/PropertyFunction.java
index b3f4c37..3ed7b8c 100644
--- a/core/api/src/main/java/org/qi4j/api/query/grammar/PropertyFunction.java
+++ b/core/api/src/main/java/org/qi4j/api/query/grammar/PropertyFunction.java
@@ -23,6 +23,7 @@ import java.lang.reflect.Member;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Proxy;
 import java.lang.reflect.Type;
+import java.util.function.Function;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.composite.Composite;
 import org.qi4j.api.composite.CompositeInstance;
@@ -31,7 +32,6 @@ import org.qi4j.api.property.Property;
 import org.qi4j.api.query.NotQueryableException;
 import org.qi4j.api.query.QueryExpressionException;
 import org.qi4j.api.util.Classes;
-import org.qi4j.functional.Function;
 
 import static org.qi4j.api.util.Classes.typeOf;
 
@@ -65,7 +65,7 @@ public class PropertyFunction<T>
         // Verify that the property type itself (value composites) is not marked as non queryable
 
         Type returnType = typeOf( accessor );
-        if( !Property.class.isAssignableFrom( Classes.RAW_CLASS.map( returnType ) ) )
+        if( !Property.class.isAssignableFrom( Classes.RAW_CLASS.apply( returnType ) ) )
         {
             throw new QueryExpressionException( "Not a property type:" + returnType );
         }
@@ -110,14 +110,14 @@ public class PropertyFunction<T>
     }
 
     @Override
-    public Property<T> map( Composite entity )
+    public Property<T> apply( Composite entity )
     {
         try
         {
             Object target = entity;
             if( traversedProperty != null )
             {
-                Property<?> property = traversedProperty.map( entity );
+                Property<?> property = traversedProperty.apply( entity );
                 if( property == null )
                 {
                     return null;
@@ -126,7 +126,7 @@ public class PropertyFunction<T>
             }
             else if( traversedAssociation != null )
             {
-                Association<?> association = traversedAssociation.map( entity );
+                Association<?> association = traversedAssociation.apply( entity );
                 if( association == null )
                 {
                     return null;

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/query/grammar/PropertyNotNullSpecification.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/query/grammar/PropertyNotNullSpecification.java b/core/api/src/main/java/org/qi4j/api/query/grammar/PropertyNotNullSpecification.java
index d92bb02..513e99a 100644
--- a/core/api/src/main/java/org/qi4j/api/query/grammar/PropertyNotNullSpecification.java
+++ b/core/api/src/main/java/org/qi4j/api/query/grammar/PropertyNotNullSpecification.java
@@ -1,5 +1,6 @@
 package org.qi4j.api.query.grammar;
 
+import java.util.function.Predicate;
 import org.qi4j.api.composite.Composite;
 import org.qi4j.api.property.Property;
 
@@ -7,7 +8,7 @@ import org.qi4j.api.property.Property;
  * Property not null Specification.
  */
 public class PropertyNotNullSpecification<T>
-    extends ExpressionSpecification
+    implements Predicate<Composite>
 {
     private PropertyFunction<T> property;
 
@@ -22,9 +23,9 @@ public class PropertyNotNullSpecification<T>
     }
 
     @Override
-    public boolean satisfiedBy( Composite item )
+    public boolean test( Composite item )
     {
-        Property<T> prop = property.map( item );
+        Property<T> prop = property.apply( item );
 
         if( prop == null )
         {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/query/grammar/PropertyNullSpecification.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/query/grammar/PropertyNullSpecification.java b/core/api/src/main/java/org/qi4j/api/query/grammar/PropertyNullSpecification.java
index 65b33b5..b7989c6 100644
--- a/core/api/src/main/java/org/qi4j/api/query/grammar/PropertyNullSpecification.java
+++ b/core/api/src/main/java/org/qi4j/api/query/grammar/PropertyNullSpecification.java
@@ -1,5 +1,6 @@
 package org.qi4j.api.query.grammar;
 
+import java.util.function.Predicate;
 import org.qi4j.api.composite.Composite;
 import org.qi4j.api.property.Property;
 
@@ -7,7 +8,7 @@ import org.qi4j.api.property.Property;
  * Property null Specification.
  */
 public class PropertyNullSpecification<T>
-    extends ExpressionSpecification
+    implements Predicate<Composite>
 {
     private PropertyFunction<T> property;
 
@@ -22,9 +23,9 @@ public class PropertyNullSpecification<T>
     }
 
     @Override
-    public boolean satisfiedBy( Composite item )
+    public boolean test( Composite item )
     {
-        Property<T> prop = property.map( item );
+        Property<T> prop = property.apply( item );
 
         if( prop == null )
         {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/query/grammar/PropertyReference.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/query/grammar/PropertyReference.java b/core/api/src/main/java/org/qi4j/api/query/grammar/PropertyReference.java
index 9b8f73d..0f51f2f 100644
--- a/core/api/src/main/java/org/qi4j/api/query/grammar/PropertyReference.java
+++ b/core/api/src/main/java/org/qi4j/api/query/grammar/PropertyReference.java
@@ -1,8 +1,8 @@
 package org.qi4j.api.query.grammar;
 
+import java.util.function.Function;
 import org.qi4j.api.composite.Composite;
 import org.qi4j.api.property.Property;
-import org.qi4j.functional.Function;
 
 /**
  * Property Reference.

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/query/grammar/QuerySpecification.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/query/grammar/QuerySpecification.java b/core/api/src/main/java/org/qi4j/api/query/grammar/QuerySpecification.java
index cdc3861..eb92463 100644
--- a/core/api/src/main/java/org/qi4j/api/query/grammar/QuerySpecification.java
+++ b/core/api/src/main/java/org/qi4j/api/query/grammar/QuerySpecification.java
@@ -1,16 +1,16 @@
 package org.qi4j.api.query.grammar;
 
+import java.util.function.Predicate;
 import org.qi4j.api.composite.Composite;
-import org.qi4j.functional.Specification;
 
 /**
  * This should be used when doing native queries, such as SQL, SPARQL or similar. EntityFinders can choose
  * what type of query languages they can understand by checking the language property of a QuerySpecification
  */
 public class QuerySpecification
-    implements Specification<Composite>
+    implements Predicate<Composite>
 {
-    public static boolean isQueryLanguage( String language, Specification<Composite> specification )
+    public static boolean isQueryLanguage( String language, Predicate<Composite> specification )
     {
         if( !( specification instanceof QuerySpecification ) )
         {
@@ -40,7 +40,7 @@ public class QuerySpecification
     }
 
     @Override
-    public boolean satisfiedBy( Composite item )
+    public boolean test( Composite item )
     {
         return false;
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/service/importer/InstanceImporter.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/service/importer/InstanceImporter.java b/core/api/src/main/java/org/qi4j/api/service/importer/InstanceImporter.java
index 38901fb..1e6058c 100644
--- a/core/api/src/main/java/org/qi4j/api/service/importer/InstanceImporter.java
+++ b/core/api/src/main/java/org/qi4j/api/service/importer/InstanceImporter.java
@@ -14,6 +14,7 @@
 
 package org.qi4j.api.service.importer;
 
+import java.util.function.Function;
 import org.qi4j.api.injection.scope.Structure;
 import org.qi4j.api.service.ImportedServiceDescriptor;
 import org.qi4j.api.service.ServiceImporter;
@@ -22,7 +23,6 @@ import org.qi4j.api.structure.Application;
 import org.qi4j.api.structure.Layer;
 import org.qi4j.api.structure.MetaInfoHolder;
 import org.qi4j.api.structure.Module;
-import org.qi4j.functional.Function;
 import org.qi4j.functional.Iterables;
 
 import static org.qi4j.functional.Iterables.filter;
@@ -58,7 +58,7 @@ public final class InstanceImporter<T>
             {
                 @Override
                 @SuppressWarnings( "unchecked" )
-                public T map( Class<?> type )
+                public T apply( Class<?> type )
                 {
                     return (T) metaInfoHolder.metaInfo( type );
                 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/service/importer/ServiceSelectorImporter.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/service/importer/ServiceSelectorImporter.java b/core/api/src/main/java/org/qi4j/api/service/importer/ServiceSelectorImporter.java
index ad3c757..6fddf2b 100644
--- a/core/api/src/main/java/org/qi4j/api/service/importer/ServiceSelectorImporter.java
+++ b/core/api/src/main/java/org/qi4j/api/service/importer/ServiceSelectorImporter.java
@@ -16,6 +16,7 @@ package org.qi4j.api.service.importer;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.function.Predicate;
 import org.qi4j.api.injection.scope.Structure;
 import org.qi4j.api.service.Availability;
 import org.qi4j.api.service.ImportedServiceDescriptor;
@@ -25,7 +26,6 @@ import org.qi4j.api.service.ServiceImporterException;
 import org.qi4j.api.service.ServiceReference;
 import org.qi4j.api.service.qualifier.ServiceQualifier;
 import org.qi4j.functional.Iterables;
-import org.qi4j.functional.Specification;
 
 /**
  * If several services are available with a given type, and you want to constrain
@@ -47,13 +47,13 @@ public final class ServiceSelectorImporter<T>
     public T importService( ImportedServiceDescriptor serviceDescriptor )
         throws ServiceImporterException
     {
-        Specification<ServiceReference<?>> selector = serviceDescriptor.metaInfo( Specification.class );
+        Predicate<ServiceReference<?>> selector = serviceDescriptor.metaInfo( Predicate.class );
         Class serviceType = Iterables.first( serviceDescriptor.types() );
         Iterable<ServiceReference<T>> services = locator.findServices( serviceType );
         List<ServiceReference<T>> filteredServices = new ArrayList<>();
         for( ServiceReference<T> service : services )
         {
-            Specification selector1 = service.metaInfo( Specification.class );
+            Predicate selector1 = service.metaInfo( Predicate.class );
             if( selector1 != null && selector1 == selector )
             {
                 continue;

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/service/qualifier/Active.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/service/qualifier/Active.java b/core/api/src/main/java/org/qi4j/api/service/qualifier/Active.java
index d06a749..5abfa3b 100644
--- a/core/api/src/main/java/org/qi4j/api/service/qualifier/Active.java
+++ b/core/api/src/main/java/org/qi4j/api/service/qualifier/Active.java
@@ -16,8 +16,8 @@ package org.qi4j.api.service.qualifier;
 
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
+import java.util.function.Predicate;
 import org.qi4j.api.service.ServiceReference;
-import org.qi4j.functional.Specification;
 
 /**
  * Filter services based on whether they are active or not.
@@ -43,7 +43,7 @@ public @interface Active
         implements AnnotationQualifier<Active>
     {
         @Override
-        public <T> Specification<ServiceReference<?>> qualifier( Active active )
+        public <T> Predicate<ServiceReference<?>> qualifier( Active active )
         {
             return ServiceQualifier.whereActive();
         }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/service/qualifier/AnnotationQualifier.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/service/qualifier/AnnotationQualifier.java b/core/api/src/main/java/org/qi4j/api/service/qualifier/AnnotationQualifier.java
index 7187ed1..d73fae4 100644
--- a/core/api/src/main/java/org/qi4j/api/service/qualifier/AnnotationQualifier.java
+++ b/core/api/src/main/java/org/qi4j/api/service/qualifier/AnnotationQualifier.java
@@ -15,13 +15,13 @@
 package org.qi4j.api.service.qualifier;
 
 import java.lang.annotation.Annotation;
+import java.util.function.Predicate;
 import org.qi4j.api.service.ServiceReference;
-import org.qi4j.functional.Specification;
 
 /**
  * Constructs a Specification for a given qualifier annotation
  */
 public interface AnnotationQualifier<QUALIFIER extends Annotation>
 {
-    public <T> Specification<ServiceReference<?>> qualifier( QUALIFIER qualifier );
+    public <T> Predicate<ServiceReference<?>> qualifier( QUALIFIER qualifier );
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/service/qualifier/Available.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/service/qualifier/Available.java b/core/api/src/main/java/org/qi4j/api/service/qualifier/Available.java
index 894451d..a4dae9c 100644
--- a/core/api/src/main/java/org/qi4j/api/service/qualifier/Available.java
+++ b/core/api/src/main/java/org/qi4j/api/service/qualifier/Available.java
@@ -16,8 +16,8 @@ package org.qi4j.api.service.qualifier;
 
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
+import java.util.function.Predicate;
 import org.qi4j.api.service.ServiceReference;
-import org.qi4j.functional.Specification;
 
 /**
  * Filter services based on whether they are available or not.
@@ -41,7 +41,7 @@ public @interface Available
         implements AnnotationQualifier<Available>
     {
         @Override
-        public <T> Specification<ServiceReference<?>> qualifier( Available active )
+        public <T> Predicate<ServiceReference<?>> qualifier( Available active )
         {
             return ServiceQualifier.whereAvailable();
         }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/service/qualifier/HasMetaInfo.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/service/qualifier/HasMetaInfo.java b/core/api/src/main/java/org/qi4j/api/service/qualifier/HasMetaInfo.java
index aac0702..196e2c8 100644
--- a/core/api/src/main/java/org/qi4j/api/service/qualifier/HasMetaInfo.java
+++ b/core/api/src/main/java/org/qi4j/api/service/qualifier/HasMetaInfo.java
@@ -16,8 +16,8 @@ package org.qi4j.api.service.qualifier;
 import java.lang.annotation.Documented;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
+import java.util.function.Predicate;
 import org.qi4j.api.service.ServiceReference;
-import org.qi4j.functional.Specification;
 
 /**
  * Filter services based on Meta Info being declared on the Service.
@@ -68,13 +68,13 @@ public @interface HasMetaInfo
         implements AnnotationQualifier<HasMetaInfo>
     {
         @Override
-        public <T> Specification<ServiceReference<?>> qualifier( final HasMetaInfo hasMetaInfo )
+        public <T> Predicate<ServiceReference<?>> qualifier( final HasMetaInfo hasMetaInfo )
         {
-            return new Specification<ServiceReference<?>>()
+            return new Predicate<ServiceReference<?>>()
             {
                 @Override
                 @SuppressWarnings( {"raw", "unchecked"} )
-                public boolean satisfiedBy( ServiceReference<?> service )
+                public boolean test( ServiceReference<?> service )
                 {
                     for( Class metaInfoType : hasMetaInfo.value() )
                     {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/api/src/main/java/org/qi4j/api/service/qualifier/IdentifiedBy.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/service/qualifier/IdentifiedBy.java b/core/api/src/main/java/org/qi4j/api/service/qualifier/IdentifiedBy.java
index 2c715d7..e8f2974 100644
--- a/core/api/src/main/java/org/qi4j/api/service/qualifier/IdentifiedBy.java
+++ b/core/api/src/main/java/org/qi4j/api/service/qualifier/IdentifiedBy.java
@@ -16,8 +16,8 @@ package org.qi4j.api.service.qualifier;
 
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
+import java.util.function.Predicate;
 import org.qi4j.api.service.ServiceReference;
-import org.qi4j.functional.Specification;
 
 /**
  * Filter services based on identity. Identity can be set during assembly, like so:
@@ -45,7 +45,7 @@ public @interface IdentifiedBy
         implements AnnotationQualifier<IdentifiedBy>
     {
         @Override
-        public <T> Specification<ServiceReference<?>> qualifier( IdentifiedBy identifiedBy )
+        public <T> Predicate<ServiceReference<?>> qualifier( IdentifiedBy identifiedBy )
         {
             return ServiceQualifier.withId( identifiedBy.value() );
         }


[22/50] [abbrv] zest-qi4j git commit: Removed Function, Function2 and Specification and replaced with the equivalents in JDK, Function, BiFunction and Predicate.

Posted by ni...@apache.org.
http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/struts2-plugin/src/main/java/org/qi4j/library/struts2/ConstraintViolationInterceptor.java
----------------------------------------------------------------------
diff --git a/libraries/struts2-plugin/src/main/java/org/qi4j/library/struts2/ConstraintViolationInterceptor.java b/libraries/struts2-plugin/src/main/java/org/qi4j/library/struts2/ConstraintViolationInterceptor.java
index a099cbf..dabbc35 100644
--- a/libraries/struts2-plugin/src/main/java/org/qi4j/library/struts2/ConstraintViolationInterceptor.java
+++ b/libraries/struts2-plugin/src/main/java/org/qi4j/library/struts2/ConstraintViolationInterceptor.java
@@ -148,7 +148,7 @@ public class ConstraintViolationInterceptor
         if( target instanceof Composite )
         {
             Composite composite = (Composite) target;
-            types = Qi4j.FUNCTION_DESCRIPTOR_FOR.map( composite ).types();
+            types = Qi4j.FUNCTION_DESCRIPTOR_FOR.apply( composite ).types();
         }
         else
         {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/struts2-plugin/src/main/java/org/qi4j/library/struts2/util/ClassNameFilters.java
----------------------------------------------------------------------
diff --git a/libraries/struts2-plugin/src/main/java/org/qi4j/library/struts2/util/ClassNameFilters.java b/libraries/struts2-plugin/src/main/java/org/qi4j/library/struts2/util/ClassNameFilters.java
index 3d41cdf..b24b916 100644
--- a/libraries/struts2-plugin/src/main/java/org/qi4j/library/struts2/util/ClassNameFilters.java
+++ b/libraries/struts2-plugin/src/main/java/org/qi4j/library/struts2/util/ClassNameFilters.java
@@ -9,7 +9,7 @@ public final class ClassNameFilters
     public static ClassNameMapper passThruMapper = new ClassNameMapper()
     {
         @Override
-        public String map( Class<?> type )
+        public String apply( Class<?> type )
         {
             return type.getName();
         }
@@ -20,7 +20,7 @@ public final class ClassNameFilters
         return new ClassNameMapper()
         {
             @Override
-            public String map( Class<?> type )
+            public String apply( Class<?> type )
             {
                 String className = type.getName();
                 for( String suffix : suffixes )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/struts2-plugin/src/main/java/org/qi4j/library/struts2/util/ClassNameMapper.java
----------------------------------------------------------------------
diff --git a/libraries/struts2-plugin/src/main/java/org/qi4j/library/struts2/util/ClassNameMapper.java b/libraries/struts2-plugin/src/main/java/org/qi4j/library/struts2/util/ClassNameMapper.java
index 93f3a8f..0b16b9a 100644
--- a/libraries/struts2-plugin/src/main/java/org/qi4j/library/struts2/util/ClassNameMapper.java
+++ b/libraries/struts2-plugin/src/main/java/org/qi4j/library/struts2/util/ClassNameMapper.java
@@ -3,10 +3,10 @@
  */
 package org.qi4j.library.struts2.util;
 
-import org.qi4j.functional.Function;
+import java.util.function.Function;
 
 public interface ClassNameMapper extends Function<Class<?>,String>
 {
     @Override
-    String map( Class<?> type );
+    String apply( Class<?> type );
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/struts2-plugin/src/main/java/org/qi4j/library/struts2/util/ClassNames.java
----------------------------------------------------------------------
diff --git a/libraries/struts2-plugin/src/main/java/org/qi4j/library/struts2/util/ClassNames.java b/libraries/struts2-plugin/src/main/java/org/qi4j/library/struts2/util/ClassNames.java
index 69e3ae8..4def699 100644
--- a/libraries/struts2-plugin/src/main/java/org/qi4j/library/struts2/util/ClassNames.java
+++ b/libraries/struts2-plugin/src/main/java/org/qi4j/library/struts2/util/ClassNames.java
@@ -1,7 +1,7 @@
 package org.qi4j.library.struts2.util;
 
 import java.util.Arrays;
-import org.qi4j.functional.Function;
+import java.util.function.Function;
 import org.qi4j.functional.Iterables;
 
 import static java.lang.Character.isLowerCase;

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/bootstrap/assembly/Assembler.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/bootstrap/assembly/Assembler.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/bootstrap/assembly/Assembler.java
index d4dca15..ef55bf8 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/bootstrap/assembly/Assembler.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/bootstrap/assembly/Assembler.java
@@ -17,6 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_a.bootstrap.assembly;
 
+import java.util.function.Function;
 import org.qi4j.api.structure.Application;
 import org.qi4j.api.structure.Module;
 import org.qi4j.api.value.ValueSerialization;
@@ -27,7 +28,6 @@ import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.LayerAssembly;
 import org.qi4j.bootstrap.ModuleAssembly;
 import org.qi4j.entitystore.memory.MemoryEntityStoreService;
-import org.qi4j.functional.Function;
 import org.qi4j.index.rdf.RdfIndexingEngineService;
 import org.qi4j.library.rdf.entity.EntityStateSerializer;
 import org.qi4j.library.rdf.entity.EntityTypeSerializer;
@@ -255,7 +255,7 @@ public class Assembler
             .setMetaInfo( new Function<Application, Module>()
         {
             @Override
-            public Module map( Application application )
+            public Module apply( Application application )
             {
                 return application.findModule( "CONTEXT", "CONTEXT-ContextSupport" );
             }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/infrastructure/conversion/EntityToDTOService.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/infrastructure/conversion/EntityToDTOService.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/infrastructure/conversion/EntityToDTOService.java
index 64ec55d..58f6215 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/infrastructure/conversion/EntityToDTOService.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/infrastructure/conversion/EntityToDTOService.java
@@ -21,6 +21,7 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
+import java.util.function.Function;
 import org.qi4j.api.association.AssociationDescriptor;
 import org.qi4j.api.association.AssociationStateHolder;
 import org.qi4j.api.association.ManyAssociation;
@@ -38,7 +39,6 @@ import org.qi4j.api.value.NoSuchValueException;
 import org.qi4j.api.value.ValueBuilder;
 import org.qi4j.api.value.ValueBuilderFactory;
 import org.qi4j.api.value.ValueDescriptor;
-import org.qi4j.functional.Function;
 import org.qi4j.functional.Iterables;
 import org.qi4j.library.conversion.values.Unqualified;
 import org.qi4j.spi.Qi4jSPI;
@@ -90,7 +90,7 @@ public interface EntityToDTOService
                 builder = vbf.newValueBuilderWithState( valueType, new Function<PropertyDescriptor, Object>()
                 {
                     @Override
-                    public Object map( PropertyDescriptor descriptor )
+                    public Object apply( PropertyDescriptor descriptor )
                     {
                         try
                         {
@@ -149,7 +149,7 @@ public interface EntityToDTOService
                 }, new Function<AssociationDescriptor, EntityReference>()
                 {
                     @Override
-                    public EntityReference map( AssociationDescriptor associationDescriptor )
+                    public EntityReference apply( AssociationDescriptor associationDescriptor )
                     {
                         return EntityReference.entityReferenceFor(
                             associationState.associationFor( associationDescriptor.accessor() ).get() );
@@ -157,7 +157,7 @@ public interface EntityToDTOService
                 }, 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() );
@@ -170,7 +170,7 @@ public interface EntityToDTOService
                 }, new Function<AssociationDescriptor, Map<String, EntityReference>>()
                 {
                     @Override
-                    public Map<String, EntityReference> map( AssociationDescriptor from )
+                    public Map<String, EntityReference> apply( AssociationDescriptor from )
                     {
                         // No NamedAssociation support
                         return Collections.emptyMap();
@@ -182,7 +182,7 @@ public interface EntityToDTOService
                 builder = vbf.newValueBuilderWithState( valueType, new Function<PropertyDescriptor, Object>()
                 {
                     @Override
-                    public Object map( PropertyDescriptor descriptor )
+                    public Object apply( PropertyDescriptor descriptor )
                     {
                         try
                         {
@@ -266,7 +266,7 @@ public interface EntityToDTOService
                 }, new Function<AssociationDescriptor, EntityReference>()
                 {
                     @Override
-                    public EntityReference map( AssociationDescriptor descriptor )
+                    public EntityReference apply( AssociationDescriptor descriptor )
                     {
                         AssociationDescriptor associationDescriptor;
                         try
@@ -285,7 +285,7 @@ public interface EntityToDTOService
                 }, new Function<AssociationDescriptor, Iterable<EntityReference>>()
                 {
                     @Override
-                    public Iterable<EntityReference> map( AssociationDescriptor descriptor )
+                    public Iterable<EntityReference> apply( AssociationDescriptor descriptor )
                     {
                         AssociationDescriptor associationDescriptor;
                         try
@@ -309,7 +309,7 @@ public interface EntityToDTOService
                 }, new Function<AssociationDescriptor, Map<String, EntityReference>>()
                 {
                     @Override
-                    public Map<String, EntityReference> map( AssociationDescriptor from )
+                    public Map<String, EntityReference> apply( AssociationDescriptor from )
                     {
                         // No NamedAssociations support
                         return Collections.emptyMap();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/samples/dci-cargo/dcisample_a/src/test/java/org/qi4j/sample/dcicargo/sample_a/bootstrap/test/TestAssembler.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/test/java/org/qi4j/sample/dcicargo/sample_a/bootstrap/test/TestAssembler.java b/samples/dci-cargo/dcisample_a/src/test/java/org/qi4j/sample/dcicargo/sample_a/bootstrap/test/TestAssembler.java
index f2ac4a1..67c2ca3 100644
--- a/samples/dci-cargo/dcisample_a/src/test/java/org/qi4j/sample/dcicargo/sample_a/bootstrap/test/TestAssembler.java
+++ b/samples/dci-cargo/dcisample_a/src/test/java/org/qi4j/sample/dcicargo/sample_a/bootstrap/test/TestAssembler.java
@@ -17,6 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_a.bootstrap.test;
 
+import java.util.function.Function;
 import org.qi4j.api.structure.Application;
 import org.qi4j.api.structure.Module;
 import org.qi4j.api.value.ValueSerialization;
@@ -27,7 +28,6 @@ import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.LayerAssembly;
 import org.qi4j.bootstrap.ModuleAssembly;
 import org.qi4j.entitystore.memory.MemoryEntityStoreService;
-import org.qi4j.functional.Function;
 import org.qi4j.index.rdf.RdfIndexingEngineService;
 import org.qi4j.library.rdf.entity.EntityStateSerializer;
 import org.qi4j.library.rdf.entity.EntityTypeSerializer;
@@ -189,7 +189,7 @@ public class TestAssembler
             .setMetaInfo( new Function<Application, Module>()
         {
             @Override
-            public Module map( Application application )
+            public Module apply( Application application )
             {
                 return application.findModule( "CONTEXT", "CONTEXT-ContextSupport" );
             }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/bootstrap/assembly/Assembler.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/bootstrap/assembly/Assembler.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/bootstrap/assembly/Assembler.java
index ce354db..b2c25a3 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/bootstrap/assembly/Assembler.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/bootstrap/assembly/Assembler.java
@@ -17,6 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.bootstrap.assembly;
 
+import java.util.function.Function;
 import org.qi4j.api.structure.Application;
 import org.qi4j.api.structure.Module;
 import org.qi4j.api.value.ValueSerialization;
@@ -27,7 +28,6 @@ import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.LayerAssembly;
 import org.qi4j.bootstrap.ModuleAssembly;
 import org.qi4j.entitystore.memory.MemoryEntityStoreService;
-import org.qi4j.functional.Function;
 import org.qi4j.index.rdf.RdfIndexingEngineService;
 import org.qi4j.library.rdf.entity.EntityStateSerializer;
 import org.qi4j.library.rdf.entity.EntityTypeSerializer;
@@ -260,7 +260,7 @@ public class Assembler
             .setMetaInfo( new Function<Application, Module>()
         {
             @Override
-            public Module map( Application application )
+            public Module apply( Application application )
             {
                 return application.findModule( "CONTEXT", "CONTEXT-RoleMap" );
             }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/infrastructure/conversion/EntityToDTOService.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/infrastructure/conversion/EntityToDTOService.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/infrastructure/conversion/EntityToDTOService.java
index 50adef3..73d217b 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/infrastructure/conversion/EntityToDTOService.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/infrastructure/conversion/EntityToDTOService.java
@@ -21,6 +21,7 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
+import java.util.function.Function;
 import org.qi4j.api.association.AssociationDescriptor;
 import org.qi4j.api.association.AssociationStateHolder;
 import org.qi4j.api.association.ManyAssociation;
@@ -38,7 +39,6 @@ import org.qi4j.api.value.NoSuchValueException;
 import org.qi4j.api.value.ValueBuilder;
 import org.qi4j.api.value.ValueBuilderFactory;
 import org.qi4j.api.value.ValueDescriptor;
-import org.qi4j.functional.Function;
 import org.qi4j.functional.Iterables;
 import org.qi4j.library.conversion.values.Unqualified;
 import org.qi4j.spi.Qi4jSPI;
@@ -90,7 +90,7 @@ public interface EntityToDTOService
                 builder = vbf.newValueBuilderWithState( valueType, new Function<PropertyDescriptor, Object>()
                 {
                     @Override
-                    public Object map( PropertyDescriptor descriptor )
+                    public Object apply( PropertyDescriptor descriptor )
                     {
                         try
                         {
@@ -152,7 +152,7 @@ public interface EntityToDTOService
                 }, new Function<AssociationDescriptor, EntityReference>()
                 {
                     @Override
-                    public EntityReference map( AssociationDescriptor associationDescriptor )
+                    public EntityReference apply( AssociationDescriptor associationDescriptor )
                     {
                         return EntityReference.entityReferenceFor(
                             associationState.associationFor( associationDescriptor.accessor() ).get() );
@@ -160,7 +160,7 @@ public interface EntityToDTOService
                 }, 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() );
@@ -173,7 +173,7 @@ public interface EntityToDTOService
                 }, new Function<AssociationDescriptor, Map<String, EntityReference>>()
                 {
                     @Override
-                    public Map<String, EntityReference> map( AssociationDescriptor from )
+                    public Map<String, EntityReference> apply( AssociationDescriptor from )
                     {
                         throw new UnsupportedOperationException( "NamedAssociations are not supported." );
                     }
@@ -184,7 +184,7 @@ public interface EntityToDTOService
                 builder = vbf.newValueBuilderWithState( valueType, new Function<PropertyDescriptor, Object>()
                 {
                     @Override
-                    public Object map( PropertyDescriptor descriptor )
+                    public Object apply( PropertyDescriptor descriptor )
                     {
                         try
                         {
@@ -268,7 +268,7 @@ public interface EntityToDTOService
                 }, new Function<AssociationDescriptor, EntityReference>()
                 {
                     @Override
-                    public EntityReference map( AssociationDescriptor descriptor )
+                    public EntityReference apply( AssociationDescriptor descriptor )
                     {
                         AssociationDescriptor associationDescriptor;
                         try
@@ -287,7 +287,7 @@ public interface EntityToDTOService
                 }, new Function<AssociationDescriptor, Iterable<EntityReference>>()
                 {
                     @Override
-                    public Iterable<EntityReference> map( AssociationDescriptor descriptor )
+                    public Iterable<EntityReference> apply( AssociationDescriptor descriptor )
                     {
                         AssociationDescriptor associationDescriptor;
                         try
@@ -311,7 +311,7 @@ public interface EntityToDTOService
                 }, new Function<AssociationDescriptor, Map<String, EntityReference>>()
                 {
                     @Override
-                    public Map<String, EntityReference> map( AssociationDescriptor from )
+                    public Map<String, EntityReference> apply( AssociationDescriptor from )
                     {
                         throw new UnsupportedOperationException( "NamedAssociations are not supported." );
                     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/bootstrap/test/TestAssembler.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/bootstrap/test/TestAssembler.java b/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/bootstrap/test/TestAssembler.java
index 639ec7b..fce9203 100644
--- a/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/bootstrap/test/TestAssembler.java
+++ b/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/bootstrap/test/TestAssembler.java
@@ -17,6 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.bootstrap.test;
 
+import java.util.function.Function;
 import org.qi4j.api.structure.Application;
 import org.qi4j.api.structure.Module;
 import org.qi4j.api.value.ValueSerialization;
@@ -27,7 +28,6 @@ import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.LayerAssembly;
 import org.qi4j.bootstrap.ModuleAssembly;
 import org.qi4j.entitystore.memory.MemoryEntityStoreService;
-import org.qi4j.functional.Function;
 import org.qi4j.index.rdf.RdfIndexingEngineService;
 import org.qi4j.library.rdf.entity.EntityStateSerializer;
 import org.qi4j.library.rdf.entity.EntityTypeSerializer;
@@ -194,7 +194,7 @@ public class TestAssembler
             .setMetaInfo( new Function<Application, Module>()
         {
             @Override
-            public Module map( Application application )
+            public Module apply( Application application )
             {
                 return application.findModule( "CONTEXT", "CONTEXT-RoleMap" );
             }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/samples/forum/src/main/java/org/qi4j/samples/forum/assembler/ForumAssembler.java
----------------------------------------------------------------------
diff --git a/samples/forum/src/main/java/org/qi4j/samples/forum/assembler/ForumAssembler.java b/samples/forum/src/main/java/org/qi4j/samples/forum/assembler/ForumAssembler.java
index 807886d..b010fe3 100644
--- a/samples/forum/src/main/java/org/qi4j/samples/forum/assembler/ForumAssembler.java
+++ b/samples/forum/src/main/java/org/qi4j/samples/forum/assembler/ForumAssembler.java
@@ -1,6 +1,7 @@
 package org.qi4j.samples.forum.assembler;
 
 import java.lang.reflect.Modifier;
+import java.util.function.Function;
 import org.qi4j.api.common.Visibility;
 import org.qi4j.api.entity.EntityComposite;
 import org.qi4j.api.structure.Application;
@@ -16,7 +17,6 @@ import org.qi4j.bootstrap.ModuleAssembly;
 import org.qi4j.entitystore.memory.MemoryEntityStoreService;
 import org.qi4j.entitystore.neo4j.NeoConfiguration;
 import org.qi4j.entitystore.neo4j.NeoEntityStoreService;
-import org.qi4j.functional.Function;
 import org.qi4j.library.fileconfig.FileConfigurationService;
 import org.qi4j.library.rest.common.ValueAssembler;
 import org.qi4j.library.rest.server.assembler.RestServerAssembler;
@@ -75,7 +75,7 @@ public class ForumAssembler
                 withValuesModuleFinder( new Function<Application, Module>()
             {
                 @Override
-                public Module map( Application app )
+                public Module apply( Application app )
                 {
                     return app.findModule( "REST", "Values" );
                 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/samples/forum/src/main/java/org/qi4j/samples/forum/context/Context.java
----------------------------------------------------------------------
diff --git a/samples/forum/src/main/java/org/qi4j/samples/forum/context/Context.java b/samples/forum/src/main/java/org/qi4j/samples/forum/context/Context.java
index 120c2b3..92edaad 100644
--- a/samples/forum/src/main/java/org/qi4j/samples/forum/context/Context.java
+++ b/samples/forum/src/main/java/org/qi4j/samples/forum/context/Context.java
@@ -20,6 +20,6 @@ public class Context
 
     protected <T> T role( Object object, Class<T> roleType )
     {
-        return Qi4j.FUNCTION_COMPOSITE_INSTANCE_OF.map( (Composite) object ).newProxy( roleType );
+        return Qi4j.FUNCTION_COMPOSITE_INSTANCE_OF.apply( (Composite) object ).newProxy( roleType );
     }
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/samples/forum/src/main/java/org/qi4j/samples/forum/context/EventsService.java
----------------------------------------------------------------------
diff --git a/samples/forum/src/main/java/org/qi4j/samples/forum/context/EventsService.java b/samples/forum/src/main/java/org/qi4j/samples/forum/context/EventsService.java
index c040b2a..a1ef7e5 100644
--- a/samples/forum/src/main/java/org/qi4j/samples/forum/context/EventsService.java
+++ b/samples/forum/src/main/java/org/qi4j/samples/forum/context/EventsService.java
@@ -2,6 +2,7 @@ package org.qi4j.samples.forum.context;
 
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Method;
+import java.util.function.Function;
 import org.qi4j.api.injection.scope.Structure;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.service.ServiceComposite;
@@ -11,7 +12,6 @@ import org.qi4j.api.unitofwork.UnitOfWork;
 import org.qi4j.api.unitofwork.UnitOfWorkCallback;
 import org.qi4j.api.unitofwork.UnitOfWorkCompletionException;
 import org.qi4j.api.value.ValueBuilder;
-import org.qi4j.functional.Function;
 import org.qi4j.functional.Iterables;
 import org.qi4j.library.rest.server.api.ObjectSelection;
 import org.qi4j.samples.forum.domainevent.DomainEventValue;
@@ -60,7 +60,7 @@ public interface EventsService
             Iterables.addAll( prototype.selection().get(), Iterables.map( new Function<Object, String>()
             {
                 @Override
-                public String map( Object o )
+                public String apply( Object o )
                 {
                     return o.toString();
                 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/samples/forum/src/main/java/org/qi4j/samples/forum/domainevent/DomainEvent.java
----------------------------------------------------------------------
diff --git a/samples/forum/src/main/java/org/qi4j/samples/forum/domainevent/DomainEvent.java b/samples/forum/src/main/java/org/qi4j/samples/forum/domainevent/DomainEvent.java
index ee96bd9..137a529 100644
--- a/samples/forum/src/main/java/org/qi4j/samples/forum/domainevent/DomainEvent.java
+++ b/samples/forum/src/main/java/org/qi4j/samples/forum/domainevent/DomainEvent.java
@@ -3,6 +3,7 @@ package org.qi4j.samples.forum.domainevent;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.reflect.Method;
+import java.util.function.Function;
 import org.qi4j.api.concern.Concerns;
 import org.qi4j.api.concern.GenericConcern;
 import org.qi4j.api.injection.scope.Structure;
@@ -12,7 +13,6 @@ import org.qi4j.api.unitofwork.UnitOfWork;
 import org.qi4j.api.unitofwork.UnitOfWorkCallback;
 import org.qi4j.api.unitofwork.UnitOfWorkCompletionException;
 import org.qi4j.api.value.ValueBuilder;
-import org.qi4j.functional.Function;
 import org.qi4j.functional.Iterables;
 import org.qi4j.library.rest.server.api.ObjectSelection;
 import org.restlet.Request;
@@ -62,7 +62,7 @@ public @interface DomainEvent
             Iterables.addAll( prototype.selection().get(), Iterables.map( new Function<Object, String>()
             {
                 @Override
-                public String map( Object o )
+                public String apply( Object o )
                 {
                     return o.toString();
                 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/samples/rental/src/main/java/org/qi4j/sample/rental/web/Page.java
----------------------------------------------------------------------
diff --git a/samples/rental/src/main/java/org/qi4j/sample/rental/web/Page.java b/samples/rental/src/main/java/org/qi4j/sample/rental/web/Page.java
index 30d9d5b..b808d89 100644
--- a/samples/rental/src/main/java/org/qi4j/sample/rental/web/Page.java
+++ b/samples/rental/src/main/java/org/qi4j/sample/rental/web/Page.java
@@ -90,7 +90,7 @@ public interface Page
             throws RenderException
         {
             Class<? extends Composite> compositeType = (Class<Composite>) first( Qi4j.FUNCTION_DESCRIPTOR_FOR
-                                                                                     .map( context.page() )
+                                                                                     .apply( context.page() )
                                                                                      .types() );
             try
             {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/samples/rental/src/main/java/org/qi4j/sample/rental/web/QuikitServlet.java
----------------------------------------------------------------------
diff --git a/samples/rental/src/main/java/org/qi4j/sample/rental/web/QuikitServlet.java b/samples/rental/src/main/java/org/qi4j/sample/rental/web/QuikitServlet.java
index 0c4a1dc..7a1af8f 100644
--- a/samples/rental/src/main/java/org/qi4j/sample/rental/web/QuikitServlet.java
+++ b/samples/rental/src/main/java/org/qi4j/sample/rental/web/QuikitServlet.java
@@ -194,8 +194,8 @@ public class QuikitServlet
     private void renderPage( Page page, String path, PrintWriter output, HttpServletRequest httpRequest )
         throws ParserConfigurationException, SAXException, IOException, RenderException, TransformerException
     {
-        Class<? extends Composite> pageClass = (Class<Composite>) first( Qi4j.FUNCTION_DESCRIPTOR_FOR
-                                                                             .map( page ).types() );
+        Class<? extends Composite> pageClass =
+            (Class<Composite>) first( Qi4j.FUNCTION_DESCRIPTOR_FOR.apply( page ).types() );
 
         String pageName = pageClass.getSimpleName() + ".html";
         DocumentBuilder documentBuilder = documentFactory.newDocumentBuilder();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/samples/rental/src/main/java/org/qi4j/sample/rental/web/assembly/StorageModule.java
----------------------------------------------------------------------
diff --git a/samples/rental/src/main/java/org/qi4j/sample/rental/web/assembly/StorageModule.java b/samples/rental/src/main/java/org/qi4j/sample/rental/web/assembly/StorageModule.java
index 71212cc..1288e3e 100644
--- a/samples/rental/src/main/java/org/qi4j/sample/rental/web/assembly/StorageModule.java
+++ b/samples/rental/src/main/java/org/qi4j/sample/rental/web/assembly/StorageModule.java
@@ -17,6 +17,7 @@
  */
 package org.qi4j.sample.rental.web.assembly;
 
+import java.util.function.Function;
 import org.qi4j.api.common.Visibility;
 import org.qi4j.api.structure.Application;
 import org.qi4j.api.structure.Module;
@@ -24,7 +25,6 @@ import org.qi4j.bootstrap.Assembler;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ModuleAssembly;
 import org.qi4j.entitystore.memory.MemoryEntityStoreService;
-import org.qi4j.functional.Function;
 import org.qi4j.spi.uuid.UuidIdentityGeneratorService;
 import org.qi4j.valueserialization.orgjson.OrgJsonValueSerializationAssembler;
 
@@ -43,7 +43,7 @@ public class StorageModule
             withValuesModuleFinder( new Function<Application, Module>()
         {
             @Override
-            public Module map( Application app )
+            public Module apply( Application app )
             {
                 return app.findModule( "DomainLayer", "RentalModule" );
             }


[44/50] [abbrv] zest-qi4j git commit: Replacing loop with Stream API.

Posted by ni...@apache.org.
Replacing loop with Stream API.


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/61280dc5
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/61280dc5
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/61280dc5

Branch: refs/heads/3.0
Commit: 61280dc5e42226e274e0c4c2035bcf968464ac2d
Parents: 7f04a7c
Author: Niclas Hedhman <ni...@hedhman.org>
Authored: Sat Oct 4 14:58:01 2014 +0800
Committer: Niclas Hedhman <ni...@hedhman.org>
Committed: Sat Oct 4 14:58:01 2014 +0800

----------------------------------------------------------------------
 .../java/org/qi4j/api/concern/ConcernOf.java    |  3 +-
 .../org/qi4j/api/concern/GenericConcern.java    |  3 +-
 .../ConstraintViolationException.java           | 59 ++++++++------------
 3 files changed, 26 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/61280dc5/core/api/src/main/java/org/qi4j/api/concern/ConcernOf.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/concern/ConcernOf.java b/core/api/src/main/java/org/qi4j/api/concern/ConcernOf.java
index 33cdd01..1b73ad6 100644
--- a/core/api/src/main/java/org/qi4j/api/concern/ConcernOf.java
+++ b/core/api/src/main/java/org/qi4j/api/concern/ConcernOf.java
@@ -38,7 +38,6 @@ public abstract class ConcernOf<T>
      * the next concern in the chain or the mixin
      * to be invoked.
      */
-    final
     @ConcernFor
-    protected T next = null;
+    final protected T next = null;
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/61280dc5/core/api/src/main/java/org/qi4j/api/concern/GenericConcern.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/concern/GenericConcern.java b/core/api/src/main/java/org/qi4j/api/concern/GenericConcern.java
index 2986ff8..6f675c5 100644
--- a/core/api/src/main/java/org/qi4j/api/concern/GenericConcern.java
+++ b/core/api/src/main/java/org/qi4j/api/concern/GenericConcern.java
@@ -25,8 +25,7 @@ import java.lang.reflect.InvocationHandler;
  * "next" field in {@link ConcernOf} to continue the invocation
  * chain.
  */
-public abstract class GenericConcern
-    extends ConcernOf<InvocationHandler>
+public abstract class GenericConcern extends ConcernOf<InvocationHandler>
     implements InvocationHandler
 {
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/61280dc5/core/api/src/main/java/org/qi4j/api/constraint/ConstraintViolationException.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/constraint/ConstraintViolationException.java b/core/api/src/main/java/org/qi4j/api/constraint/ConstraintViolationException.java
index 9697a8b..7fa2207 100644
--- a/core/api/src/main/java/org/qi4j/api/constraint/ConstraintViolationException.java
+++ b/core/api/src/main/java/org/qi4j/api/constraint/ConstraintViolationException.java
@@ -21,11 +21,11 @@ import java.lang.annotation.Annotation;
 import java.lang.reflect.Member;
 import java.text.MessageFormat;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Locale;
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
-import java.util.function.Function;
 import org.qi4j.api.Qi4j;
 import org.qi4j.api.composite.Composite;
 import org.qi4j.functional.Iterables;
@@ -54,7 +54,8 @@ public class ConstraintViolationException
                                          Collection<ConstraintViolation> constraintViolations
     )
     {
-        this( instance.toString(), Qi4j.FUNCTION_DESCRIPTOR_FOR.apply( instance ).types(), method, constraintViolations );
+        this( instance.toString(), Qi4j.FUNCTION_DESCRIPTOR_FOR.apply( instance )
+            .types(), method, constraintViolations );
     }
 
     public ConstraintViolationException( String instanceToString,
@@ -155,21 +156,7 @@ public class ConstraintViolationException
             Locale locale;
             if( bundle != null )
             {
-                try
-                {
-                    pattern = bundle.getString( "qi4j.constraint." + mixinTypeName + "." + methodName );
-                }
-                catch( MissingResourceException e1 )
-                {
-                    try
-                    {
-                        pattern = bundle.getString( "qi4j.constraint" );
-                    }
-                    catch( MissingResourceException e2 )
-                    {
-                        // ignore. The default pattern will be used.
-                    }
-                }
+                pattern = getResourceString( bundle, pattern );
                 locale = bundle.getLocale();
             }
             else
@@ -188,14 +175,7 @@ public class ConstraintViolationException
             }
             else
             {
-                classes = "[" + Iterables.<Class<?>>toString( instanceTypes, new Function<Class<?>, String>()
-                {
-                    @Override
-                    public String apply( Class<?> from )
-                    {
-                        return from.getSimpleName();
-                    }
-                }, "," ) + "]";
+                classes = "[" + Iterables.toString( instanceTypes, Class::getSimpleName, "," ) + "]";
             }
             Object[] args = new Object[]
                 {
@@ -216,21 +196,30 @@ public class ConstraintViolationException
         return result;
     }
 
-    public String localizedMessage()
+    private String getResourceString( ResourceBundle bundle, String pattern )
     {
-        String[] messages = localizedMessagesFrom( null );
-        StringBuilder result = new StringBuilder();
-        boolean first = true;
-        for( String message : messages )
+        try
+        {
+            pattern = bundle.getString( "qi4j.constraint." + mixinTypeName + "." + methodName );
+        }
+        catch( MissingResourceException e1 )
         {
-            if( !first )
+            try
             {
-                result.append( ',' );
+                pattern = bundle.getString( "qi4j.constraint" );
+            }
+            catch( MissingResourceException e2 )
+            {
+                // ignore. The default pattern will be used.
             }
-            first = false;
-            result.append( message );
         }
-        return result.toString();
+        return pattern;
+    }
+
+    public String localizedMessage()
+    {
+        String[] messages = localizedMessagesFrom( null );
+        return Arrays.stream( messages ).reduce( ( left, right ) -> left + "," + right ).get();
     }
 
     @Override


[42/50] [abbrv] zest-qi4j git commit: Added Time API support to the PropertyMapper, which is used in Condiguration properties file input.

Posted by ni...@apache.org.
Added Time API support to the PropertyMapper, which is used in Condiguration properties file input.


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/dc69fba3
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/dc69fba3
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/dc69fba3

Branch: refs/heads/3.0
Commit: dc69fba3900e3011718b8173517c8376025fd492
Parents: 978c18c
Author: Niclas Hedhman <ni...@hedhman.org>
Authored: Sat Oct 4 14:35:50 2014 +0800
Committer: Niclas Hedhman <ni...@hedhman.org>
Committed: Sat Oct 4 14:35:50 2014 +0800

----------------------------------------------------------------------
 .../org/qi4j/api/composite/PropertyMapper.java  | 228 ++++++++++++++++---
 1 file changed, 193 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/dc69fba3/core/api/src/main/java/org/qi4j/api/composite/PropertyMapper.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/composite/PropertyMapper.java b/core/api/src/main/java/org/qi4j/api/composite/PropertyMapper.java
index 87352a1..a730270 100644
--- a/core/api/src/main/java/org/qi4j/api/composite/PropertyMapper.java
+++ b/core/api/src/main/java/org/qi4j/api/composite/PropertyMapper.java
@@ -9,6 +9,20 @@ import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
 import java.math.BigDecimal;
 import java.math.BigInteger;
+import java.time.Duration;
+import java.time.Instant;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.MonthDay;
+import java.time.OffsetDateTime;
+import java.time.OffsetTime;
+import java.time.Period;
+import java.time.Year;
+import java.time.YearMonth;
+import java.time.ZoneId;
+import java.time.ZoneOffset;
+import java.time.ZonedDateTime;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
@@ -51,6 +65,21 @@ public final class PropertyMapper
         STRATEGY.put( List.class, new ListMapper() );
         STRATEGY.put( Set.class, new SetMapper() );
         STRATEGY.put( ValueComposite.class, new ValueCompositeMapper() );
+
+        STRATEGY.put( OffsetDateTime.class, new OffsetDateTimeMapper() );
+        STRATEGY.put( OffsetTime.class, new OffsetTimeMapper() );
+        STRATEGY.put( LocalDate.class, new LocalDateMapper() );
+        STRATEGY.put( LocalTime.class, new LocalTimeMapper() );
+        STRATEGY.put( LocalDateTime.class, new LocalDateTimeMapper() );
+        STRATEGY.put( Year.class, new YearMapper() );
+        STRATEGY.put( YearMonth.class, new YearMonthMapper() );
+        STRATEGY.put( MonthDay.class, new MonthDayMapper() );
+        STRATEGY.put( Instant.class, new InstantMapper() );
+        STRATEGY.put( Period.class, new PeriodMapper() );
+        STRATEGY.put( Duration.class, new DurationMapper() );
+        STRATEGY.put( ZonedDateTime.class, new ZonedDateTimeMapper() );
+        STRATEGY.put( ZoneId.class, new ZoneIdMapper() );
+        STRATEGY.put( ZoneOffset.class, new ZoneOffsetMapper() );
     }
 
     /**
@@ -76,7 +105,7 @@ public final class PropertyMapper
 
                 value = mapToType( composite, propertyType, value.toString() );
 
-                @SuppressWarnings( "unchecked" )
+                @SuppressWarnings("unchecked")
                 Property<Object> property = (Property<Object>) propertyMethod.invoke( composite );
                 property.set( value );
             }
@@ -98,7 +127,7 @@ public final class PropertyMapper
         }
     }
 
-    @SuppressWarnings( "raw" )
+    @SuppressWarnings("raw")
     private static Object mapToType( Composite composite, Type propertyType, Object value )
     {
         final String stringValue = value.toString();
@@ -116,9 +145,16 @@ public final class PropertyMapper
             }
             else
             {
-                strategy = STRATEGY.get( type );
+                if( ( !type.equals( ZoneOffset.class ) ) && ZoneId.class.isAssignableFrom( type ) )
+                {
+                    strategy = STRATEGY.get( ZoneId.class );
+                }
+                else
+                {
+                    strategy = STRATEGY.get( type );
+                }
             }
-            if( strategy == null  ) // If null, try with the ValueComposite Mapper...
+            if( strategy == null ) // If null, try with the ValueComposite Mapper...
             {
                 strategy = STRATEGY.get( ValueComposite.class );
             }
@@ -200,6 +236,7 @@ public final class PropertyMapper
      *
      * @return properties instance
      */
+    @SuppressWarnings( "UnusedDeclaration" )
     public static Properties toJavaProperties( final Composite composite )
     {
         return new Properties()
@@ -413,11 +450,151 @@ public final class PropertyMapper
         }
     }
 
+    private static class OffsetDateTimeMapper
+        implements MappingStrategy
+    {
+        @Override
+        public Object map( Composite composite, Type type, String value )
+        {
+            return OffsetDateTime.parse( value.trim() );
+        }
+    }
+
+    private static class OffsetTimeMapper
+        implements MappingStrategy
+    {
+        @Override
+        public Object map( Composite composite, Type type, String value )
+        {
+            return OffsetTime.parse( value.trim() );
+        }
+    }
+
+    private static class LocalDateTimeMapper
+        implements MappingStrategy
+    {
+        @Override
+        public Object map( Composite composite, Type type, String value )
+        {
+            return LocalDateTime.parse( value.trim() );
+        }
+    }
+
+    private static class LocalDateMapper
+        implements MappingStrategy
+    {
+        @Override
+        public Object map( Composite composite, Type type, String value )
+        {
+            return LocalDate.parse( value.trim() );
+        }
+    }
+
+    private static class LocalTimeMapper
+        implements MappingStrategy
+    {
+        @Override
+        public Object map( Composite composite, Type type, String value )
+        {
+            return LocalTime.parse( value.trim() );
+        }
+    }
+
+    private static class ZonedDateTimeMapper
+        implements MappingStrategy
+    {
+        @Override
+        public Object map( Composite composite, Type type, String value )
+        {
+            return ZonedDateTime.parse( value.trim() );
+        }
+    }
+
+    private static class InstantMapper
+        implements MappingStrategy
+    {
+        @Override
+        public Object map( Composite composite, Type type, String value )
+        {
+            return Instant.parse( value.trim() );
+        }
+    }
+
+    private static class PeriodMapper
+        implements MappingStrategy
+    {
+        @Override
+        public Object map( Composite composite, Type type, String value )
+        {
+            return Period.parse( value.trim() );
+        }
+    }
+
+    private static class DurationMapper
+        implements MappingStrategy
+    {
+        @Override
+        public Object map( Composite composite, Type type, String value )
+        {
+            return Duration.parse( value.trim() );
+        }
+    }
+
+    private static class YearMapper
+        implements MappingStrategy
+    {
+        @Override
+        public Object map( Composite composite, Type type, String value )
+        {
+            return Year.parse( value.trim() );
+        }
+    }
+
+    private static class YearMonthMapper
+        implements MappingStrategy
+    {
+        @Override
+        public Object map( Composite composite, Type type, String value )
+        {
+            return YearMonth.parse( value.trim() );
+        }
+    }
+
+    private static class MonthDayMapper
+        implements MappingStrategy
+    {
+        @Override
+        public Object map( Composite composite, Type type, String value )
+        {
+            return MonthDay.parse( value.trim() );
+        }
+    }
+
+    private static class ZoneIdMapper
+        implements MappingStrategy
+    {
+        @Override
+        public Object map( Composite composite, Type type, String value )
+        {
+            return ZoneId.of( value.trim() );
+        }
+    }
+
+    private static class ZoneOffsetMapper
+        implements MappingStrategy
+    {
+        @Override
+        public Object map( Composite composite, Type type, String value )
+        {
+            return ZoneOffset.of( value.trim() );
+        }
+    }
+
     private static class EnumMapper
         implements MappingStrategy
     {
         @Override
-        @SuppressWarnings( "unchecked" )
+        @SuppressWarnings("unchecked")
         public Object map( Composite composite, Type type, String value )
         {
             return Enum.valueOf( (Class<Enum>) type, value );
@@ -428,10 +605,12 @@ public final class PropertyMapper
         implements MappingStrategy
     {
         @Override
-        @SuppressWarnings( "unchecked" )
+        @SuppressWarnings("unchecked")
         public Object map( Composite composite, Type type, String value )
         {
-            return Qi4j.FUNCTION_COMPOSITE_INSTANCE_OF.apply( composite ).module().newValueFromSerializedState( (Class<Object>) type, value );
+            return Qi4j.FUNCTION_COMPOSITE_INSTANCE_OF.apply( composite )
+                .module()
+                .newValueFromSerializedState( (Class<Object>) type, value );
         }
     }
 
@@ -439,19 +618,12 @@ public final class PropertyMapper
         implements MappingStrategy
     {
         @Override
-        @SuppressWarnings( {"raw", "unchecked"} )
+        @SuppressWarnings({ "raw", "unchecked" })
         public Object map( final Composite composite, Type type, String value )
         {
             final Class arrayType = ( (Class) type ).getComponentType();
             final ArrayList result = new ArrayList();
-            tokenize( value, false, new TokenizerCallback()
-            {
-                @Override
-                public void token( String token )
-                {
-                    result.add( mapToType( composite, arrayType, token ) );
-                }
-            } );
+            tokenize( value, false, token -> result.add( mapToType( composite, arrayType, token ) ) );
             return result.toArray( (Object[]) Array.newInstance( arrayType, result.size() ) );
         }
     }
@@ -470,19 +642,12 @@ public final class PropertyMapper
         implements MappingStrategy
     {
         @Override
-        @SuppressWarnings( {"raw", "unchecked"} )
+        @SuppressWarnings({ "raw", "unchecked" })
         public Object map( final Composite composite, Type type, String value )
         {
             final Type dataType = ( (ParameterizedType) type ).getActualTypeArguments()[ 0 ];
             final Collection result = new ArrayList();
-            tokenize( value, false, new TokenizerCallback()
-            {
-                @Override
-                public void token( String token )
-                {
-                    result.add( mapToType( composite, dataType, token ) );
-                }
-            } );
+            tokenize( value, false, token -> result.add( mapToType( composite, dataType, token ) ) );
             return result;
         }
     }
@@ -491,19 +656,12 @@ public final class PropertyMapper
         implements MappingStrategy
     {
         @Override
-        @SuppressWarnings( {"raw", "unchecked"} )
+        @SuppressWarnings({ "raw", "unchecked" })
         public Object map( final Composite composite, Type type, String value )
         {
             final Type dataType = ( (ParameterizedType) type ).getActualTypeArguments()[ 0 ];
             final Collection result = new HashSet();
-            tokenize( value, false, new TokenizerCallback()
-            {
-                @Override
-                public void token( String token )
-                {
-                    result.add( mapToType( composite, dataType, token ) );
-                }
-            } );
+            tokenize( value, false, token -> result.add( mapToType( composite, dataType, token ) ) );
             return result;
         }
     }
@@ -512,7 +670,7 @@ public final class PropertyMapper
         implements MappingStrategy
     {
         @Override
-        @SuppressWarnings( {"raw", "unchecked"} )
+        @SuppressWarnings({ "raw", "unchecked" })
         public Object map( final Composite composite, Type generictype, String value )
         {
             ParameterizedType type = (ParameterizedType) generictype;


[34/50] [abbrv] zest-qi4j git commit: Replaced Joda Time with Java 8 Time API.

Posted by ni...@apache.org.
http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/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 4f89795..9404166 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
@@ -17,14 +17,11 @@
 
 package org.qi4j.library.rest.common.table;
 
-import java.text.SimpleDateFormat;
 import java.util.Collections;
 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;
 
@@ -35,191 +32,200 @@ import static java.util.Collections.reverseOrder;
  */
 public class TableBuilder
 {
-   protected ValueBuilderFactory vbf;
-   private Map<String, TableBuilderFactory.Column> columns;
-   private TableQuery tableQuery;
-
-   protected ValueBuilder<Table> tableBuilder;
-
-   protected ValueBuilder<Row> rowBuilder;
-
-   public TableBuilder(ValueBuilderFactory vbf)
-   {
-      this.vbf = vbf;
-
-      tableBuilder = vbf.newValueBuilder(Table.class);
-   }
-
-   public TableBuilder(ValueBuilderFactory vbf, Map<String, TableBuilderFactory.Column> columns, TableQuery tableQuery)
-   {
-      this.vbf = vbf;
-      this.columns = columns;
-      this.tableQuery = tableQuery;
-
-      tableBuilder = vbf.newValueBuilder(Table.class);
-
-      if (tableQuery.select().equals("*"))
-      {
-         for (TableBuilderFactory.Column column : columns.values())
-         {
-            column(column.getId(), column.getLabel(), column.getType());
-         }
-      } else
-      {
-         for (String columnName : tableQuery.select().split("[, ]"))
-         {
-            TableBuilderFactory.Column column = columns.get(columnName.trim());
-            if (column != null)
-               column(column.getId(), column.getLabel(), column.getType());
-         }
-      }
-   }
-
-   public TableBuilder column(String id, String label, String type)
-   {
-      ValueBuilder<Column> builder = vbf.newValueBuilder(Column.class);
-      builder.prototype().id().set(id);
-
-      if (tableQuery != null && tableQuery.label() != null)
-      {
-         // TODO Fix label selection
-      }
-
-      builder.prototype().label().set(label);
-      builder.prototype().columnType().set(type);
-      tableBuilder.prototype().cols().get().add(builder.newInstance());
-      return this;
-   }
-
-   public TableBuilder rows(Iterable<?> rowObjects)
-   {
-      boolean no_format = false;
-      boolean no_values = false;
-      if (tableQuery != null && tableQuery.options() != null)
-      {
-         if (tableQuery.options().contains("no_format"))
-            no_format = true;
-         if (tableQuery != null && tableQuery.options().contains("no_values"))
-            no_values = true;
-      }
-
-      for (Object rowObject : rowObjects)
-      {
-         row();
-         for (Column column : tableBuilder.prototype().cols().get())
-         {
-            Object v = null;
-            String f = null;
-            Function valueFunction = columns.get( column.id().get()).getValueFunction();
-            if (!no_values && valueFunction != null)
-               v = valueFunction.apply(rowObject);
-            Function formattedFunction = columns.get( column.id().get()).getFormattedFunction();
-            if (!no_format && formattedFunction != null)
-               f = (String) formattedFunction.apply(rowObject);
-            else if (v != null)
+    protected ValueBuilderFactory vbf;
+    private Map<String, TableBuilderFactory.Column> columns;
+    private TableQuery tableQuery;
+
+    protected ValueBuilder<Table> tableBuilder;
+
+    protected ValueBuilder<Row> rowBuilder;
+
+    public TableBuilder( ValueBuilderFactory vbf )
+    {
+        this.vbf = vbf;
+
+        tableBuilder = vbf.newValueBuilder( Table.class );
+    }
+
+    public TableBuilder( ValueBuilderFactory vbf,
+                         Map<String, TableBuilderFactory.Column> columns,
+                         TableQuery tableQuery
+    )
+    {
+        this.vbf = vbf;
+        this.columns = columns;
+        this.tableQuery = tableQuery;
+
+        tableBuilder = vbf.newValueBuilder( Table.class );
+
+        if( tableQuery.select().equals( "*" ) )
+        {
+            for( TableBuilderFactory.Column column : columns.values() )
             {
-               if ( column.columnType().get().equals( Table.DATETIME))
-                  f = Dates.toUtcString( (Date) v );
-               else if ( column.columnType().get().equals( Table.DATE))
-                  f = new SimpleDateFormat( "yyyy-MM-dd").format((Date) v);
-               else if ( column.columnType().get().equals( Table.TIME_OF_DAY))
-                  f = new SimpleDateFormat( "HH:mm:ss").format((Date) v);
-               else
-                  f = v.toString();
+                column( column.getId(), column.getLabel(), column.getType() );
             }
-
-            cell(v, f);
-         }
-         endRow();
-      }
-
-      return this;
-   }
-
-   public TableBuilder row()
-   {
-      if (rowBuilder != null)
-         endRow();
-
-      rowBuilder = vbf.newValueBuilder(Row.class);
-      return this;
-   }
-
-   public TableBuilder endRow()
-   {
-      tableBuilder.prototype().rows().get().add(rowBuilder.newInstance());
-      rowBuilder = null;
-      return this;
-   }
-
-   public TableBuilder cell(Object v, String f)
-   {
-      ValueBuilder<Cell> cellBuilder = vbf.newValueBuilder(Cell.class);
-      cellBuilder.prototype().v().set(v);
-      cellBuilder.prototype().f().set(f);
-      rowBuilder.prototype().c().get().add(cellBuilder.newInstance());
-      return this;
-   }
-
-   public TableBuilder orderBy()
-   {
-      if (tableQuery.orderBy() != null)
-      {
-         // Sort table
-         // Find sort column index
-
-         String[] orderBy = tableQuery.orderBy().split(" ");
-         boolean descending = orderBy.length == 2 && orderBy[1].equals("desc");
-
-         int sortIndex = -1;
-         List<Column> columns = tableBuilder.prototype().cols().get();
-         for (int i = 0; i < columns.size(); i++)
-         {
-            Column column = columns.get(i);
-            if ( column.id().get().equals(orderBy[0]))
+        }
+        else
+        {
+            for( String columnName : tableQuery.select().split( "[, ]" ) )
             {
-               sortIndex = i;
-               break;
+                TableBuilderFactory.Column column = columns.get( columnName.trim() );
+                if( column != null )
+                {
+                    column( column.getId(), column.getLabel(), column.getType() );
+                }
             }
+        }
+    }
+
+    public TableBuilder column( String id, String label, String type )
+    {
+        ValueBuilder<Column> builder = vbf.newValueBuilder( Column.class );
+        builder.prototype().id().set( id );
+
+        if( tableQuery != null && tableQuery.label() != null )
+        {
+            // TODO Fix label selection
+        }
+
+        builder.prototype().label().set( label );
+        builder.prototype().columnType().set( type );
+        tableBuilder.prototype().cols().get().add( builder.newInstance() );
+        return this;
+    }
+
+    public TableBuilder rows( Iterable<?> rowObjects )
+    {
+        boolean no_format = false;
+        boolean no_values = false;
+        if( tableQuery != null && tableQuery.options() != null )
+        {
+            if( tableQuery.options().contains( "no_format" ) )
+            {
+                no_format = true;
+            }
+            if( tableQuery != null && tableQuery.options().contains( "no_values" ) )
+            {
+                no_values = true;
+            }
+        }
 
-         }
-
-         if (sortIndex != -1)
-         {
-            final int idx = sortIndex;
-            Comparator<Row> comparator = new Comparator<Row>()
+        for( Object rowObject : rowObjects )
+        {
+            row();
+            for( Column column : tableBuilder.prototype().cols().get() )
             {
-               @Override
-               public int compare(Row o1, Row o2)
-               {
-                  Object o = o1.c().get().get(idx).v().get();
-
-                  if (o != null && o instanceof Comparable)
-                  {
-                     Comparable c1 = (Comparable) o;
-                     Comparable c2 = (Comparable) o2.c().get().get(idx).v().get();
-                     return c1.compareTo(c2);
-                  } else
-                  {
-                     String f1 = o1.c().get().get(idx).f().get();
-                     String f2 = o2.c().get().get(idx).f().get();
-                     return f1.compareTo(f2);
-                  }
-               }
-            };
-
-            if (descending)
+                Object v = null;
+                String f = null;
+                Function valueFunction = columns.get( column.id().get() ).getValueFunction();
+                if( !no_values && valueFunction != null )
+                {
+                    v = valueFunction.apply( rowObject );
+                }
+                Function formattedFunction = columns.get( column.id().get() ).getFormattedFunction();
+                if( !no_format && formattedFunction != null )
+                {
+                    f = (String) formattedFunction.apply( rowObject );
+                }
+                else if( v != null )
+                {
+                    f = v.toString();
+                }
+
+                cell( v, f );
+            }
+            endRow();
+        }
+
+        return this;
+    }
+
+    public TableBuilder row()
+    {
+        if( rowBuilder != null )
+        {
+            endRow();
+        }
+
+        rowBuilder = vbf.newValueBuilder( Row.class );
+        return this;
+    }
+
+    public TableBuilder endRow()
+    {
+        tableBuilder.prototype().rows().get().add( rowBuilder.newInstance() );
+        rowBuilder = null;
+        return this;
+    }
+
+    public TableBuilder cell( Object v, String f )
+    {
+        ValueBuilder<Cell> cellBuilder = vbf.newValueBuilder( Cell.class );
+        cellBuilder.prototype().v().set( v );
+        cellBuilder.prototype().f().set( f );
+        rowBuilder.prototype().c().get().add( cellBuilder.newInstance() );
+        return this;
+    }
+
+    public TableBuilder orderBy()
+    {
+        if( tableQuery.orderBy() != null )
+        {
+            // Sort table
+            // Find sort column index
+
+            String[] orderBy = tableQuery.orderBy().split( " " );
+            boolean descending = orderBy.length == 2 && orderBy[ 1 ].equals( "desc" );
+
+            int sortIndex = -1;
+            List<Column> columns = tableBuilder.prototype().cols().get();
+            for( int i = 0; i < columns.size(); i++ )
             {
-               // Flip it
-               comparator = reverseOrder(comparator);
+                Column column = columns.get( i );
+                if( column.id().get().equals( orderBy[ 0 ] ) )
+                {
+                    sortIndex = i;
+                    break;
+                }
             }
 
-            Collections.sort(tableBuilder.prototype().rows().get(), comparator);
-         }
-      }
+            if( sortIndex != -1 )
+            {
+                final int idx = sortIndex;
+                Comparator<Row> comparator = new Comparator<Row>()
+                {
+                    @Override
+                    public int compare( Row o1, Row o2 )
+                    {
+                        Object o = o1.c().get().get( idx ).v().get();
+
+                        if( o != null && o instanceof Comparable )
+                        {
+                            Comparable c1 = (Comparable) o;
+                            Comparable c2 = (Comparable) o2.c().get().get( idx ).v().get();
+                            return c1.compareTo( c2 );
+                        }
+                        else
+                        {
+                            String f1 = o1.c().get().get( idx ).f().get();
+                            String f2 = o2.c().get().get( idx ).f().get();
+                            return f1.compareTo( f2 );
+                        }
+                    }
+                };
+
+                if( descending )
+                {
+                    // Flip it
+                    comparator = reverseOrder( comparator );
+                }
+
+                Collections.sort( tableBuilder.prototype().rows().get(), comparator );
+            }
+        }
 
-      return this;
-   }
+        return this;
+    }
 
 //   public TableBuilder orderBy()
 //   {
@@ -270,33 +276,40 @@ public class TableBuilder
 //      return this;
 //   }
 
-   public TableBuilder paging()
-   {
-      // Paging
-      int start = 0;
-      int end = tableBuilder.prototype().rows().get().size();
-      if (tableQuery.offset() != null)
-         start = Integer.parseInt(tableQuery.offset());
-      if (tableQuery.limit() != null)
-         end = Math.min(end, start + Integer.parseInt(tableQuery.limit()));
-
-      if (!(start == 0 && end == tableBuilder.prototype().rows().get().size()))
-         tableBuilder.prototype().rows().set(tableBuilder.prototype().rows().get().subList(start, end));
-
-      return this;
-
-   }
-
-   public Table newTable()
-   {
-      if (rowBuilder != null)
-         endRow();
-
-      return tableBuilder.newInstance();
-   }
-
-   public void abortRow()
-   {
-      rowBuilder = null;
-   }
+    public TableBuilder paging()
+    {
+        // Paging
+        int start = 0;
+        int end = tableBuilder.prototype().rows().get().size();
+        if( tableQuery.offset() != null )
+        {
+            start = Integer.parseInt( tableQuery.offset() );
+        }
+        if( tableQuery.limit() != null )
+        {
+            end = Math.min( end, start + Integer.parseInt( tableQuery.limit() ) );
+        }
+
+        if( !( start == 0 && end == tableBuilder.prototype().rows().get().size() ) )
+        {
+            tableBuilder.prototype().rows().set( tableBuilder.prototype().rows().get().subList( start, end ) );
+        }
+
+        return this;
+    }
+
+    public Table newTable()
+    {
+        if( rowBuilder != null )
+        {
+            endRow();
+        }
+
+        return tableBuilder.newInstance();
+    }
+
+    public void abortRow()
+    {
+        rowBuilder = null;
+    }
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/rest-server/src/main/java/org/qi4j/library/rest/server/api/ResourceValidity.java
----------------------------------------------------------------------
diff --git a/libraries/rest-server/src/main/java/org/qi4j/library/rest/server/api/ResourceValidity.java b/libraries/rest-server/src/main/java/org/qi4j/library/rest/server/api/ResourceValidity.java
index 2715756..e16a8d6 100644
--- a/libraries/rest-server/src/main/java/org/qi4j/library/rest/server/api/ResourceValidity.java
+++ b/libraries/rest-server/src/main/java/org/qi4j/library/rest/server/api/ResourceValidity.java
@@ -63,7 +63,7 @@ public class ResourceValidity
         if( entity != null )
         {
             EntityState state = spi.entityStateOf( entity );
-            Date lastModified = new Date( state.lastModified() );
+            Date lastModified = new Date( state.lastModified().toEpochMilli() );
             Tag tag = new Tag( state.identity().identity() + "/" + state.version() );
             response.getEntity().setModificationDate( lastModified );
             response.getEntity().setTag( tag );
@@ -78,7 +78,7 @@ public class ResourceValidity
         if( modificationDate != null )
         {
             EntityState state = spi.entityStateOf( entity );
-            Date lastModified = new Date( ( state.lastModified() / 1000 ) * 1000 ); // Cut off milliseconds
+            Date lastModified = new Date( ( state.lastModified().toEpochMilli() / 1000 ) * 1000 ); // Cut off milliseconds
             if( lastModified.after( modificationDate ) )
             {
                 throw new ResourceException( Status.CLIENT_ERROR_CONFLICT );
@@ -90,7 +90,7 @@ public class ResourceValidity
         if( modificationDate != null )
         {
             EntityState state = spi.entityStateOf( entity );
-            Date lastModified = new Date( ( state.lastModified() / 1000 ) * 1000 ); // Cut off milliseconds
+            Date lastModified = new Date( ( state.lastModified().toEpochMilli() / 1000 ) * 1000 ); // Cut off milliseconds
             if( !lastModified.after( modificationDate ) )
             {
                 throw new ResourceException( Status.REDIRECTION_NOT_MODIFIED );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/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 ca63132..c29412e 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
@@ -2,8 +2,12 @@ package org.qi4j.library.rest.server.restlet.requestreader;
 
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Method;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.OffsetDateTime;
+import java.time.ZonedDateTime;
 import java.util.Collections;
-import java.util.Date;
 import java.util.Map;
 import java.util.function.Function;
 import org.qi4j.api.association.AssociationDescriptor;
@@ -15,7 +19,6 @@ import org.qi4j.api.injection.scope.Structure;
 import org.qi4j.api.property.PropertyDescriptor;
 import org.qi4j.api.service.qualifier.Tagged;
 import org.qi4j.api.structure.Module;
-import org.qi4j.api.util.Dates;
 import org.qi4j.api.value.ValueBuilder;
 import org.qi4j.api.value.ValueComposite;
 import org.qi4j.api.value.ValueDeserializer;
@@ -446,9 +449,25 @@ public class DefaultRequestReader
                     arg = Boolean.valueOf( argString );
                 }
             }
-            else if( Date.class.isAssignableFrom( parameterType ) )
+            else if( LocalDate.class.isAssignableFrom( parameterType ) )
             {
-                arg = Dates.fromString( argString );
+                arg = LocalDate.parse( argString );
+            }
+            else if( LocalTime.class.isAssignableFrom( parameterType ) )
+            {
+                arg = LocalTime.parse( argString );
+            }
+            else if( LocalDateTime.class.isAssignableFrom( parameterType ) )
+            {
+                arg = LocalDateTime.parse( argString );
+            }
+            else if( ZonedDateTime.class.isAssignableFrom( parameterType ) )
+            {
+                arg = ZonedDateTime.parse( argString );
+            }
+            else if( OffsetDateTime.class.isAssignableFrom( parameterType ) )
+            {
+                arg = OffsetDateTime.parse( argString );
             }
             else if( parameterType.isInterface() )
             {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/rest-server/src/main/java/org/qi4j/library/rest/server/restlet/responsewriter/TableResponseWriter.java
----------------------------------------------------------------------
diff --git a/libraries/rest-server/src/main/java/org/qi4j/library/rest/server/restlet/responsewriter/TableResponseWriter.java b/libraries/rest-server/src/main/java/org/qi4j/library/rest/server/restlet/responsewriter/TableResponseWriter.java
index 32ca740..8e300c6 100644
--- a/libraries/rest-server/src/main/java/org/qi4j/library/rest/server/restlet/responsewriter/TableResponseWriter.java
+++ b/libraries/rest-server/src/main/java/org/qi4j/library/rest/server/restlet/responsewriter/TableResponseWriter.java
@@ -23,14 +23,12 @@ import java.io.IOException;
 import java.io.Writer;
 import java.text.SimpleDateFormat;
 import java.util.Arrays;
-import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import org.json.JSONException;
 import org.json.JSONWriter;
 import org.qi4j.api.injection.scope.Service;
-import org.qi4j.api.util.Dates;
 import org.qi4j.library.rest.common.table.Cell;
 import org.qi4j.library.rest.common.table.Column;
 import org.qi4j.library.rest.common.table.Row;
@@ -126,21 +124,21 @@ public class TableResponseWriter extends AbstractResponseWriter
                                             .get()
                                             .equals( Table.DATETIME ) && value != null )
                                     {
-                                        value = Dates.toUtcString( (Date) value );
+                                        value = value.toString();
                                     }
                                     else if( columnList.get( idx )
                                                  .columnType()
                                                  .get()
                                                  .equals( Table.DATE ) && value != null )
                                     {
-                                        value = new SimpleDateFormat( "yyyy-MM-dd" ).format( (Date) value );
+                                        value = value.toString();
                                     }
                                     else if( columnList.get( idx )
                                                  .columnType()
                                                  .get()
                                                  .equals( Table.TIME_OF_DAY ) && value != null )
                                     {
-                                        value = new SimpleDateFormat( "HH:mm:ss" ).format( (Date) value );
+                                        value = value.toString();
                                     }
 
                                     if( value != null )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/rest/src/main/java/org/qi4j/library/rest/admin/EntityResource.java
----------------------------------------------------------------------
diff --git a/libraries/rest/src/main/java/org/qi4j/library/rest/admin/EntityResource.java b/libraries/rest/src/main/java/org/qi4j/library/rest/admin/EntityResource.java
index 3474970..9ec95e3 100644
--- a/libraries/rest/src/main/java/org/qi4j/library/rest/admin/EntityResource.java
+++ b/libraries/rest/src/main/java/org/qi4j/library/rest/admin/EntityResource.java
@@ -22,6 +22,7 @@ import java.io.IOException;
 import java.io.PrintWriter;
 import java.io.StringReader;
 import java.io.Writer;
+import java.time.Instant;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.Date;
@@ -107,7 +108,7 @@ public class EntityResource
         throws ResourceException
     {
         Usecase usecase = UsecaseBuilder.newUsecase( "Remove entity" );
-        EntityStoreUnitOfWork uow = entityStore.newUnitOfWork( usecase, module, System.currentTimeMillis() );
+        EntityStoreUnitOfWork uow = entityStore.newUnitOfWork( usecase, module, Instant.now() );
         try
         {
             EntityReference identityRef = EntityReference.parseEntityReference( identity );
@@ -130,7 +131,7 @@ public class EntityResource
     {
         EntityStoreUnitOfWork uow = entityStore.newUnitOfWork( UsecaseBuilder.newUsecase( "Get entity" ),
                                                                module,
-                                                               System.currentTimeMillis() );
+                                                               Instant.now() );
 
         try
         {
@@ -140,7 +141,7 @@ public class EntityResource
             Date lastModified = getRequest().getConditions().getModifiedSince();
             if( lastModified != null )
             {
-                if( lastModified.getTime() / 1000 == entityState.lastModified() / 1000 )
+                if( lastModified.getTime() / 1000 == entityState.lastModified().toEpochMilli() / 1000 )
                 {
                     throw new ResourceException( Status.REDIRECTION_NOT_MODIFIED );
                 }
@@ -187,7 +188,7 @@ public class EntityResource
 
     private Representation entityHeaders( Representation representation, EntityState entityState )
     {
-        representation.setModificationDate( new Date( entityState.lastModified() ) );
+        representation.setModificationDate( new Date( entityState.lastModified().toEpochMilli() ) );
         representation.setTag( new Tag( "" + entityState.version() ) );
         representation.setCharacterSet( CharacterSet.UTF_8 );
         representation.setLanguages( Collections.singletonList( Language.ENGLISH ) );
@@ -354,7 +355,7 @@ public class EntityResource
         throws ResourceException
     {
         Usecase usecase = UsecaseBuilder.newUsecase( "Update entity" );
-        EntityStoreUnitOfWork unitOfWork = entityStore.newUnitOfWork( usecase, module, System.currentTimeMillis() );
+        EntityStoreUnitOfWork unitOfWork = entityStore.newUnitOfWork( usecase, module, Instant.now() );
         EntityState entity = getEntityState( unitOfWork );
 
         Form form = new Form( entityRepresentation );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/Scheduler.java
----------------------------------------------------------------------
diff --git a/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/Scheduler.java b/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/Scheduler.java
index 5052055..a6ad4e4 100644
--- a/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/Scheduler.java
+++ b/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/Scheduler.java
@@ -18,7 +18,7 @@
  */
 package org.qi4j.library.scheduler;
 
-import org.joda.time.DateTime;
+import java.time.Instant;
 import org.qi4j.api.concern.Concerns;
 import org.qi4j.api.structure.Application;
 import org.qi4j.api.unitofwork.concern.UnitOfWorkConcern;
@@ -67,7 +67,7 @@ public interface Scheduler
      * @return The newly created Schedule
      */
     @UnitOfWorkPropagation( MANDATORY )
-    Schedule scheduleOnce( Task task, DateTime runAt, boolean durable );
+    Schedule scheduleOnce( Task task, Instant runAt, boolean durable );
 
     /**
      * Schedule a Task using a CronExpression.
@@ -105,5 +105,5 @@ public interface Scheduler
      * @return The newly created Schedule
      */
     @UnitOfWorkPropagation( MANDATORY )
-    Schedule scheduleCron( Task task, @CronExpression String cronExpression, DateTime start, boolean durable );
+    Schedule scheduleCron( Task task, @CronExpression String cronExpression, Instant start, boolean durable );
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/SchedulerMixin.java
----------------------------------------------------------------------
diff --git a/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/SchedulerMixin.java b/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/SchedulerMixin.java
index 9058f45..864658b 100644
--- a/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/SchedulerMixin.java
+++ b/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/SchedulerMixin.java
@@ -18,6 +18,9 @@
  */
 package org.qi4j.library.scheduler;
 
+import java.time.Instant;
+import java.time.ZoneOffset;
+import java.time.temporal.ChronoUnit;
 import java.util.SortedSet;
 import java.util.TreeSet;
 import java.util.concurrent.LinkedBlockingQueue;
@@ -28,7 +31,6 @@ import java.util.concurrent.ScheduledThreadPoolExecutor;
 import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
-import org.joda.time.DateTime;
 import org.qi4j.api.configuration.Configuration;
 import org.qi4j.api.injection.scope.Service;
 import org.qi4j.api.injection.scope.Structure;
@@ -84,7 +86,8 @@ public class SchedulerMixin
     public Schedule scheduleOnce( Task task, int initialSecondsDelay, boolean durable )
     {
         long now = System.currentTimeMillis();
-        Schedule schedule = scheduleFactory.newOnceSchedule( task, new DateTime( now + initialSecondsDelay * 1000 ), durable );
+        Schedule schedule = scheduleFactory.newOnceSchedule( task, Instant.now()
+            .plusSeconds( initialSecondsDelay ), durable );
         if( durable )
         {
             Schedules schedules = module.currentUnitOfWork().get( Schedules.class, getSchedulesIdentity( me ) );
@@ -95,7 +98,7 @@ public class SchedulerMixin
     }
 
     @Override
-    public Schedule scheduleOnce( Task task, DateTime runAt, boolean durable )
+    public Schedule scheduleOnce( Task task, Instant runAt, boolean durable )
     {
         Schedule schedule = scheduleFactory.newOnceSchedule( task, runAt, durable );
         dispatchForExecution( schedule );
@@ -110,8 +113,7 @@ public class SchedulerMixin
     @Override
     public Schedule scheduleCron( Task task, String cronExpression, boolean durable )
     {
-        DateTime now = new DateTime();
-        Schedule schedule = scheduleFactory.newCronSchedule( task, cronExpression, now, durable );
+        Schedule schedule = scheduleFactory.newCronSchedule( task, cronExpression, Instant.now(), durable );
         if( durable )
         {
             Schedules schedules = module.currentUnitOfWork().get( Schedules.class, getSchedulesIdentity( me ) );
@@ -122,7 +124,7 @@ public class SchedulerMixin
     }
 
     @Override
-    public Schedule scheduleCron( Task task, @CronExpression String cronExpression, DateTime start, boolean durable )
+    public Schedule scheduleCron( Task task, @CronExpression String cronExpression, Instant start, boolean durable )
     {
         Schedule schedule = scheduleFactory.newCronSchedule( task, cronExpression, start, durable );
         if( durable )
@@ -137,7 +139,7 @@ public class SchedulerMixin
     @Override
     public Schedule scheduleCron( Task task, String cronExpression, long initialDelay, boolean durable )
     {
-        DateTime start = new DateTime( System.currentTimeMillis() + initialDelay );
+        Instant start = Instant.now().plusMillis( initialDelay );
         Schedule schedule = scheduleFactory.newCronSchedule( task, cronExpression, start, durable );
         if( durable )
         {
@@ -150,17 +152,16 @@ public class SchedulerMixin
 
     private void dispatchForExecution( Schedule schedule )
     {
-        long now = System.currentTimeMillis();
         synchronized( timingQueue )
         {
             if( timingQueue.size() == 0 )
             {
-                long nextRun = schedule.nextRun( now );
-                if( nextRun < 0 )
+                Instant nextRun = schedule.nextRun( Instant.now() );
+                if( nextRun.isBefore( Instant.now() ) )
                 {
                     return;
                 }
-                System.out.println( "Next run at: " + new DateTime( nextRun ) );
+                System.out.println( "Next run at: " + nextRun.atOffset( ZoneOffset.UTC ) );
                 timingQueue.add( new ScheduleTime( schedule.identity().get(), nextRun ) );
                 if( scheduleHandler == null )
                 {
@@ -170,12 +171,12 @@ public class SchedulerMixin
             else
             {
                 ScheduleTime first = timingQueue.first();
-                long nextRun = schedule.nextRun( now );
-                if( nextRun < 0 )
+                Instant nextRun = schedule.nextRun( Instant.now() );
+                if( nextRun.isBefore( Instant.now() ) )
                 {
                     return;
                 }
-                System.out.println( "Next run at: " + new DateTime( nextRun ) );
+                System.out.println( "Next run at: " + nextRun.atOffset( ZoneOffset.UTC ) );
                 timingQueue.add( new ScheduleTime( schedule.identity().get(), nextRun ) );
                 ScheduleTime newFirst = timingQueue.first();
                 if( !first.equals( newFirst ) )
@@ -192,7 +193,8 @@ public class SchedulerMixin
     private void dispatchHandler()
     {
         scheduleHandler = new ScheduleHandler();
-        managementExecutor.schedule( scheduleHandler, timingQueue.first().nextTime - System.currentTimeMillis(), TimeUnit.MILLISECONDS );
+        long delay = Instant.now().until( timingQueue.first().nextTime, ChronoUnit.MILLIS );
+        managementExecutor.schedule( scheduleHandler, delay, TimeUnit.MILLISECONDS );
     }
 
     @Override
@@ -296,7 +298,7 @@ public class SchedulerMixin
                 else
                 {
                     ScheduleTime nextTime = timingQueue.first();
-                    future = managementExecutor.schedule( scheduleHandler, nextTime.nextTime, TimeUnit.MILLISECONDS );
+                    future = managementExecutor.schedule( scheduleHandler, nextTime.nextTime.toEpochMilli(), TimeUnit.MILLISECONDS );
                 }
             }
         }
@@ -357,5 +359,4 @@ public class SchedulerMixin
             }
         }
     }
-
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/schedule/Schedule.java
----------------------------------------------------------------------
diff --git a/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/schedule/Schedule.java b/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/schedule/Schedule.java
index 5fba485..e4f8cc2 100644
--- a/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/schedule/Schedule.java
+++ b/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/schedule/Schedule.java
@@ -18,7 +18,7 @@
  */
 package org.qi4j.library.scheduler.schedule;
 
-import org.joda.time.DateTime;
+import java.time.Instant;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.entity.Identity;
 import org.qi4j.api.property.Immutable;
@@ -41,7 +41,7 @@ public interface Schedule
      * @return The property containing the first time this Schedule will be run.
      */
     @Immutable
-    Property<DateTime> start();
+    Property<Instant> start();
 
     /**
      * Called just before the {@link org.qi4j.library.scheduler.Task#run()} method is called.
@@ -73,7 +73,7 @@ public interface Schedule
      *
      * @return The exact absolute time when this Schedule is to be run next time.
      */
-    long nextRun( long from );
+    Instant nextRun( Instant from );
 
     /**
      * Return a representation of the Schedule in a human understandable format.

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/schedule/ScheduleFactory.java
----------------------------------------------------------------------
diff --git a/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/schedule/ScheduleFactory.java b/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/schedule/ScheduleFactory.java
index 7f5b88c..b9b777b 100644
--- a/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/schedule/ScheduleFactory.java
+++ b/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/schedule/ScheduleFactory.java
@@ -15,7 +15,7 @@
  */
 package org.qi4j.library.scheduler.schedule;
 
-import org.joda.time.DateTime;
+import java.time.Instant;
 import org.qi4j.api.entity.EntityBuilder;
 import org.qi4j.api.injection.scope.Service;
 import org.qi4j.api.injection.scope.Structure;
@@ -33,9 +33,9 @@ import org.slf4j.LoggerFactory;
 @Mixins( ScheduleFactory.Mixin.class )
 public interface ScheduleFactory
 {
-    Schedule newCronSchedule( Task task, String cronExpression, DateTime start, boolean durable );
+    Schedule newCronSchedule( Task task, String cronExpression, Instant start, boolean durable );
 
-    Schedule newOnceSchedule( Task task, DateTime runAt, boolean durable );
+    Schedule newOnceSchedule( Task task, Instant runAt, boolean durable );
 
     class Mixin
         implements ScheduleFactory
@@ -49,7 +49,7 @@ public interface ScheduleFactory
         private SchedulerService scheduler;
 
         @Override
-        public CronSchedule newCronSchedule( Task task, String cronExpression, DateTime start, boolean durable )
+        public CronSchedule newCronSchedule( Task task, String cronExpression, Instant start, boolean durable )
         {
             if( durable )
             {
@@ -59,7 +59,7 @@ public interface ScheduleFactory
         }
 
         @Override
-        public Schedule newOnceSchedule( Task task, DateTime runAt, boolean durable )
+        public Schedule newOnceSchedule( Task task, Instant runAt, boolean durable )
         {
             if( durable )
             {
@@ -68,7 +68,7 @@ public interface ScheduleFactory
             return newTransientOnceSchedule( task, runAt );
         }
 
-        private CronSchedule newTransientCronSchedule( Task task, String cronExpression, DateTime start )
+        private CronSchedule newTransientCronSchedule( Task task, String cronExpression, Instant start )
         {
             ValueBuilder<CronSchedule> builder = module.newValueBuilder( CronSchedule.class );
             CronSchedule prototype = builder.prototype();
@@ -80,7 +80,7 @@ public interface ScheduleFactory
             return schedule;
         }
 
-        private CronSchedule newPersistentCronSchedule( Task task, String cronExpression, DateTime start )
+        private CronSchedule newPersistentCronSchedule( Task task, String cronExpression, Instant start )
         {
             UnitOfWork uow = module.currentUnitOfWork();
             EntityBuilder<CronSchedule> builder = uow.newEntityBuilder( CronSchedule.class );
@@ -93,7 +93,7 @@ public interface ScheduleFactory
             return schedule;
         }
 
-        private Schedule newTransientOnceSchedule( Task task, DateTime runAt )
+        private Schedule newTransientOnceSchedule( Task task, Instant runAt )
         {
             ValueBuilder<OnceSchedule> builder = module.newValueBuilder( OnceSchedule.class );
             OnceSchedule builderInstance = builder.prototype();
@@ -104,7 +104,7 @@ public interface ScheduleFactory
             return schedule;
         }
 
-        private Schedule newPersistentOnceSchedule( Task task, DateTime runAt )
+        private Schedule newPersistentOnceSchedule( Task task, Instant runAt )
         {
             UnitOfWork uow = module.currentUnitOfWork();
             EntityBuilder<OnceSchedule> builder = uow.newEntityBuilder( OnceSchedule.class );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/schedule/ScheduleTime.java
----------------------------------------------------------------------
diff --git a/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/schedule/ScheduleTime.java b/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/schedule/ScheduleTime.java
index 7bf07d9..01de000 100644
--- a/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/schedule/ScheduleTime.java
+++ b/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/schedule/ScheduleTime.java
@@ -16,13 +16,15 @@
  */
 package org.qi4j.library.scheduler.schedule;
 
+import java.time.Instant;
+
 public final class ScheduleTime
     implements Comparable<ScheduleTime>
 {
     public String scheduleIdentity;
-    public long nextTime;
+    public Instant nextTime;
 
-    public ScheduleTime( String scheduleIdentity, long nextTime )
+    public ScheduleTime( String scheduleIdentity, Instant nextTime )
     {
         if( scheduleIdentity == null )
         {
@@ -43,38 +45,45 @@ public final class ScheduleTime
         {
             return false;
         }
+
         ScheduleTime that = (ScheduleTime) o;
-        if( nextTime != that.nextTime )
+
+        if( nextTime != null ? !nextTime.equals( that.nextTime ) : that.nextTime != null )
+        {
+            return false;
+        }
+        if( !scheduleIdentity.equals( that.scheduleIdentity ) )
         {
             return false;
         }
-        return scheduleIdentity.equals( that.scheduleIdentity );
+
+        return true;
     }
 
     @Override
     public int hashCode()
     {
         int result = scheduleIdentity.hashCode();
-        result = 31 * result + (int) ( nextTime ^ ( nextTime >>> 32 ) );
+        result = 31 * result + ( nextTime != null ? nextTime.hashCode() : 0 );
         return result;
     }
 
     @Override
     public int compareTo( ScheduleTime another )
     {
-        if( this.nextTime < another.nextTime )
+        if( this.nextTime.isBefore( another.nextTime ) )
         {
             return -1;
         }
         else
         {
-            if( this.nextTime == another.nextTime )
+            if( this.nextTime.isAfter( another.nextTime ) )
             {
-                return 0;
+                return 1;
             }
             else
             {
-                return 1;
+                return 0;
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/schedule/cron/CronSchedule.java
----------------------------------------------------------------------
diff --git a/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/schedule/cron/CronSchedule.java b/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/schedule/cron/CronSchedule.java
index a1645bf..e8baff5 100644
--- a/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/schedule/cron/CronSchedule.java
+++ b/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/schedule/cron/CronSchedule.java
@@ -16,6 +16,7 @@
  */
 package org.qi4j.library.scheduler.schedule.cron;
 
+import java.time.Instant;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.property.Immutable;
 import org.qi4j.api.property.Property;
@@ -76,16 +77,15 @@ public interface CronSchedule
         }
 
         @Override
-        public long nextRun( long from )
+        public Instant nextRun( Instant from )
         {
-            long firstRun = start().get().getMillis();
-            if( firstRun > from )
+            if( start().get().isAfter( from ) )
             {
-                from = firstRun;
+                from = start().get();
             }
-            Long nextRun = new org.codeartisans.sked.cron.CronSchedule( cronExpression().get() ).firstRunAfter( from );
-            LOGGER.info( "Schedule.firstRunAfter({}) CronSchedule result is {}", from, firstRun );
-            return nextRun;
+            Long nextRun = new org.codeartisans.sked.cron.CronSchedule( cronExpression().get() ).firstRunAfter( from.toEpochMilli() );
+            LOGGER.info( "Schedule.firstRunAfter({}) CronSchedule result is {}", from, nextRun );
+            return Instant.ofEpochMilli( nextRun );
         }
     }
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/schedule/once/OnceSchedule.java
----------------------------------------------------------------------
diff --git a/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/schedule/once/OnceSchedule.java b/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/schedule/once/OnceSchedule.java
index 637e3d2..0a98b1c 100644
--- a/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/schedule/once/OnceSchedule.java
+++ b/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/schedule/once/OnceSchedule.java
@@ -16,6 +16,7 @@
  */
 package org.qi4j.library.scheduler.schedule.once;
 
+import java.time.Instant;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.library.scheduler.schedule.Schedule;
 
@@ -53,14 +54,13 @@ public interface OnceSchedule
         }
 
         @Override
-        public long nextRun( long from )
+        public Instant nextRun( Instant from )
         {
-            long runAt = start().get().getMillis();
-            if( runAt >= from )
+            if( ! start().get().isBefore(from) )
             {
-                return runAt;
+                return start().get();
             }
-            return -1;
+            return Instant.MIN;
         }
 
         @Override

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/timeline/Timeline.java
----------------------------------------------------------------------
diff --git a/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/timeline/Timeline.java b/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/timeline/Timeline.java
index 9c77162..bb79057 100644
--- a/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/timeline/Timeline.java
+++ b/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/timeline/Timeline.java
@@ -18,7 +18,7 @@
  */
 package org.qi4j.library.scheduler.timeline;
 
-import org.joda.time.DateTime;
+import java.time.Instant;
 import org.qi4j.api.unitofwork.concern.UnitOfWorkPropagation;
 
 /**
@@ -57,17 +57,6 @@ public interface Timeline
      */
     @UnitOfWorkPropagation( UnitOfWorkPropagation.Propagation.MANDATORY )
 // START SNIPPET: timeline
-    Iterable<TimelineRecord> getRecords( DateTime from, DateTime to );
-// END SNIPPET: timeline
-
-    /**
-     * @param from Lower limit
-     * @param to   Upper limit
-     *
-     * @return Records between the given dates
-     */
-    @UnitOfWorkPropagation( UnitOfWorkPropagation.Propagation.MANDATORY )
-// START SNIPPET: timeline
-    Iterable<TimelineRecord> getRecords( long from, long to );
+    Iterable<TimelineRecord> getRecords( Instant from, Instant to );
 }
 // END SNIPPET: timeline

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/timeline/TimelineForScheduleConcern.java
----------------------------------------------------------------------
diff --git a/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/timeline/TimelineForScheduleConcern.java b/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/timeline/TimelineForScheduleConcern.java
index 60bedba..6165bdd 100644
--- a/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/timeline/TimelineForScheduleConcern.java
+++ b/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/timeline/TimelineForScheduleConcern.java
@@ -20,6 +20,7 @@ package org.qi4j.library.scheduler.timeline;
 import java.io.BufferedOutputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.PrintStream;
+import java.time.Instant;
 import java.util.List;
 import org.qi4j.api.concern.ConcernOf;
 import org.qi4j.api.injection.scope.Structure;
@@ -69,7 +70,7 @@ public abstract class TimelineForScheduleConcern
         prototype.taskName().set( task().get().name().get() );
         List<String> tags = task().get().tags().get();
         prototype.taskTags().set( tags );
-        prototype.timestamp().set( System.currentTimeMillis() );
+        prototype.timestamp().set( Instant.now() );
         prototype.scheduleIdentity().set( this.identity().get() );
         prototype.details().set( details );
         TimelineRecord record = builder.newInstance();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/timeline/TimelineRecord.java
----------------------------------------------------------------------
diff --git a/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/timeline/TimelineRecord.java b/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/timeline/TimelineRecord.java
index f4ac63f..fc3ae61 100644
--- a/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/timeline/TimelineRecord.java
+++ b/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/timeline/TimelineRecord.java
@@ -18,6 +18,7 @@
  */
 package org.qi4j.library.scheduler.timeline;
 
+import java.time.Instant;
 import java.util.List;
 import org.qi4j.api.common.UseDefaults;
 import org.qi4j.api.entity.Queryable;
@@ -43,7 +44,7 @@ public interface TimelineRecord
     /**
      * @return Timestamp of this record
      */
-    Property<Long> timestamp();
+    Property<Instant> timestamp();
 
     /**
      * @return Name of the associated {@link org.qi4j.library.scheduler.Task}

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/timeline/TimelineScheduleMixin.java
----------------------------------------------------------------------
diff --git a/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/timeline/TimelineScheduleMixin.java b/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/timeline/TimelineScheduleMixin.java
index eb91f1c..38a6978 100644
--- a/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/timeline/TimelineScheduleMixin.java
+++ b/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/timeline/TimelineScheduleMixin.java
@@ -15,12 +15,12 @@
  */
 package org.qi4j.library.scheduler.timeline;
 
+import java.time.Instant;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 import java.util.SortedSet;
 import java.util.TreeSet;
-import org.joda.time.DateTime;
 import org.qi4j.api.injection.scope.Structure;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.structure.Module;
@@ -60,7 +60,7 @@ public class TimelineScheduleMixin
     public Iterable<TimelineRecord> getNextRecords( int maxResults )
     {
         SortedSet<TimelineRecord> result = new TreeSet<>();
-        long time = System.currentTimeMillis();
+        Instant time = Instant.now();
         for( int i = 0; i < maxResults; i++ )
         {
             time = me.nextRun( time );
@@ -70,29 +70,23 @@ public class TimelineScheduleMixin
     }
 
     @Override
-    public Iterable<TimelineRecord> getRecords( DateTime from, DateTime to )
+    public Iterable<TimelineRecord> getRecords( Instant from, Instant to )
     {
-        return getRecords( from.getMillis(), to.getMillis() );
-    }
-
-    @Override
-    public Iterable<TimelineRecord> getRecords( long from, long to )
-    {
-        long now = System.currentTimeMillis();
+        Instant now = Instant.now();
         SortedSet<TimelineRecord> result = new TreeSet<>();
         result.addAll( getPastRecords( from ) );
         result.addAll( getFutureRecords( now, to ) );
         return result;
     }
 
-    private Collection<? extends TimelineRecord> getPastRecords( long from )
+    private Collection<? extends TimelineRecord> getPastRecords( Instant from )
     {
         SortedSet<TimelineRecord> result = new TreeSet<>();
         List<TimelineRecord> timelineRecords = state.history().get();
         for( TimelineRecord record : timelineRecords )
         {
-            Long timestamp = record.timestamp().get();
-            if( timestamp >= from )
+            Instant timestamp = record.timestamp().get();
+            if( ! timestamp.isBefore(from) )
             {
                 result.add( record );
             }
@@ -100,19 +94,19 @@ public class TimelineScheduleMixin
         return result;
     }
 
-    private Collection<? extends TimelineRecord> getFutureRecords( long now, long to )
+    private Collection<? extends TimelineRecord> getFutureRecords( Instant now, Instant to )
     {
-        if( now > to )
+        if( now.isAfter(to) )
         {
             return Collections.emptyList();
         }
 
         SortedSet<TimelineRecord> result = new TreeSet<>();
-        long time = now;
-        while( time <= to )
+        Instant time = now;
+        while( ! time.isAfter(to) )
         {
             time = me.nextRun( time );
-            if( time <= to )
+            if( ! time.isAfter(to) )
             {
                 result.add( createFutureRecord( time ) );
             }
@@ -120,7 +114,7 @@ public class TimelineScheduleMixin
         return result;
     }
 
-    private TimelineRecord createFutureRecord( long when )
+    private TimelineRecord createFutureRecord( Instant when )
     {
         ValueBuilder<TimelineRecord> builder = module.newValueBuilder( TimelineRecord.class );
         TimelineRecord prototype = builder.prototype();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/timeline/TimelineSchedulerServiceMixin.java
----------------------------------------------------------------------
diff --git a/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/timeline/TimelineSchedulerServiceMixin.java b/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/timeline/TimelineSchedulerServiceMixin.java
index 8a55520..24fa33a 100644
--- a/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/timeline/TimelineSchedulerServiceMixin.java
+++ b/libraries/scheduler/src/main/java/org/qi4j/library/scheduler/timeline/TimelineSchedulerServiceMixin.java
@@ -15,9 +15,9 @@
  */
 package org.qi4j.library.scheduler.timeline;
 
+import java.time.Instant;
 import java.util.SortedSet;
 import java.util.TreeSet;
-import org.joda.time.DateTime;
 import org.qi4j.api.injection.scope.Service;
 import org.qi4j.api.injection.scope.Structure;
 import org.qi4j.api.service.ServiceComposite;
@@ -76,24 +76,7 @@ public abstract class TimelineSchedulerServiceMixin
     }
 
     @Override
-    public Iterable<TimelineRecord> getRecords( DateTime from, DateTime to )
-    {
-        SortedSet<TimelineRecord> result = new TreeSet<>();
-
-        UnitOfWork uow = module.currentUnitOfWork();
-        String schedulesName = SchedulerMixin.getSchedulesIdentity( scheduler );
-        Schedules schedules = uow.get( Schedules.class, schedulesName );
-        for( Schedule schedule : schedules.schedules() )
-        {
-            Timeline timeline = (Timeline) schedule;
-            Iterable<TimelineRecord> lastRecords = timeline.getRecords( from, to );
-            Iterables.addAll( result, lastRecords );
-        }
-        return result;
-    }
-
-    @Override
-    public Iterable<TimelineRecord> getRecords( long from, long to )
+    public Iterable<TimelineRecord> getRecords( Instant from, Instant to )
     {
         SortedSet<TimelineRecord> result = new TreeSet<>();
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/scheduler/src/test/java/org/qi4j/library/scheduler/SchedulerTest.java
----------------------------------------------------------------------
diff --git a/libraries/scheduler/src/test/java/org/qi4j/library/scheduler/SchedulerTest.java b/libraries/scheduler/src/test/java/org/qi4j/library/scheduler/SchedulerTest.java
index ac38d8e..4228c19 100644
--- a/libraries/scheduler/src/test/java/org/qi4j/library/scheduler/SchedulerTest.java
+++ b/libraries/scheduler/src/test/java/org/qi4j/library/scheduler/SchedulerTest.java
@@ -18,9 +18,10 @@
  */
 package org.qi4j.library.scheduler;
 
+import java.time.Instant;
+import java.time.ZonedDateTime;
+import java.time.temporal.ChronoUnit;
 import java.util.concurrent.Callable;
-import org.joda.time.DateTime;
-import org.joda.time.Interval;
 import org.junit.Test;
 import org.qi4j.api.common.Visibility;
 import org.qi4j.api.unitofwork.UnitOfWork;
@@ -87,7 +88,7 @@ public class SchedulerTest
         throws UnitOfWorkCompletionException
     {
         Usecase usecase = UsecaseBuilder.newUsecase( "TestMinutely" );
-        DateTime start = new DateTime();
+        ZonedDateTime start = ZonedDateTime.now();
         String taskIdentity;
         long sleepMillis;
         try( UnitOfWork uow = module.newUnitOfWork( usecase ) )
@@ -97,13 +98,13 @@ public class SchedulerTest
             FooTask task = createFooTask( uow, usecase.name(), BAZAR );
             taskIdentity = task.identity().get();
 
-            DateTime expectedRun = start.withMillisOfSecond( 0 ).withSecondOfMinute( 0 ).plusMinutes( 1 );
+            ZonedDateTime expectedRun = start.withNano( 0 ).withSecond( 0 ).plusMinutes( 1 );
             scheduler.scheduleCron( task, "@minutely", true );
 
             uow.complete();
 
-            sleepMillis = new Interval( start, expectedRun ).toDurationMillis();
-            LOGGER.info( "Task scheduled on {} to be run at {}", start.getMillis(), expectedRun.getMillis() );
+            sleepMillis = start.until(expectedRun, ChronoUnit.MILLIS);
+            LOGGER.info( "Task scheduled on {} to be run at {}", start, expectedRun );
         }
 
         await( usecase.name() ).
@@ -113,22 +114,22 @@ public class SchedulerTest
         try( UnitOfWork uow = module.newUnitOfWork( usecase ) )
         {
             Timeline timeline = module.findService( Timeline.class ).get();
-            DateTime now = new DateTime();
 
             // Queries returning past records
             assertThat( count( timeline.getLastRecords( 5 ) ),
                         is( 2L ) );
-            assertThat( count( timeline.getRecords( start.getMillis(), now.getMillis() ) ),
+            Instant now = Instant.now();
+            assertThat( count( timeline.getRecords( start.toInstant(), now ) ),
                         is( 2L ) );
 
             // Queries returning future records
             assertThat( count( timeline.getNextRecords( 4 ) ),
                         is( 4L ) );
-            assertThat( count( timeline.getRecords( now.getMillis() + 100, now.plusMinutes( 5 ).getMillis() ) ),
+            assertThat( count( timeline.getRecords( now.plusMillis( 100 ), now.plusSeconds( 300 ) ) ),
                         is( 5L ) );
 
             // Queries returning mixed past and future records
-            assertThat( count( timeline.getRecords( start.getMillis(), now.plusMinutes( 5 ).getMillis() ) ),
+            assertThat( count( timeline.getRecords( start.toInstant(), now.plusSeconds( 300 ) ) ),
                         is( 7L ) );
         }
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/manual/src/main/java/org/qi4j/manual/recipes/createEntity/Accident.java
----------------------------------------------------------------------
diff --git a/manual/src/main/java/org/qi4j/manual/recipes/createEntity/Accident.java b/manual/src/main/java/org/qi4j/manual/recipes/createEntity/Accident.java
index 8276510..f36f185 100644
--- a/manual/src/main/java/org/qi4j/manual/recipes/createEntity/Accident.java
+++ b/manual/src/main/java/org/qi4j/manual/recipes/createEntity/Accident.java
@@ -1,14 +1,14 @@
 package org.qi4j.manual.recipes.createEntity;
 
+import java.time.ZonedDateTime;
 import org.qi4j.api.property.Property;
-import java.util.Date;
 
 // START SNIPPET: entity
 public interface Accident
 {
     Property<String> description();
-    Property<Date> occured();
-    Property<Date> repaired();
+    Property<ZonedDateTime> occured();
+    Property<ZonedDateTime> repaired();
 }
 
 // END SNIPPET: entity
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/pathfinder_a/api/TransitEdge.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/pathfinder_a/api/TransitEdge.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/pathfinder_a/api/TransitEdge.java
index 51315de..f85e028 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/pathfinder_a/api/TransitEdge.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/pathfinder_a/api/TransitEdge.java
@@ -18,7 +18,7 @@
 package org.qi4j.sample.dcicargo.pathfinder_a.api;
 
 import java.io.Serializable;
-import java.util.Date;
+import java.time.ZonedDateTime;
 
 /**
  * Represents an edge in a path through a graph,
@@ -30,8 +30,8 @@ public final class TransitEdge implements Serializable
     private final String voyageNumber;
     private final String fromUnLocode;
     private final String toUnLocode;
-    private final Date fromDate;
-    private final Date toDate;
+    private final ZonedDateTime fromDate;
+    private final ZonedDateTime toDate;
 
     /**
      * Constructor.
@@ -45,8 +45,8 @@ public final class TransitEdge implements Serializable
     public TransitEdge( final String voyageNumber,
                         final String fromUnLocode,
                         final String toUnLocode,
-                        final Date fromDate,
-                        final Date toDate
+                        final ZonedDateTime fromDate,
+                        final ZonedDateTime toDate
     )
     {
         this.voyageNumber = voyageNumber;
@@ -71,12 +71,12 @@ public final class TransitEdge implements Serializable
         return toUnLocode;
     }
 
-    public Date getFromDate()
+    public ZonedDateTime getFromDate()
     {
         return fromDate;
     }
 
-    public Date getToDate()
+    public ZonedDateTime getToDate()
     {
         return toDate;
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/pathfinder_a/internal/GraphTraversalServiceImpl.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/pathfinder_a/internal/GraphTraversalServiceImpl.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/pathfinder_a/internal/GraphTraversalServiceImpl.java
index 41237c6..e5f92d6 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/pathfinder_a/internal/GraphTraversalServiceImpl.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/pathfinder_a/internal/GraphTraversalServiceImpl.java
@@ -17,9 +17,9 @@
  */
 package org.qi4j.sample.dcicargo.pathfinder_a.internal;
 
+import java.time.ZonedDateTime;
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Date;
 import java.util.List;
 import java.util.Random;
 import org.qi4j.sample.dcicargo.pathfinder_a.api.GraphTraversalService;
@@ -42,7 +42,7 @@ public class GraphTraversalServiceImpl
 
     public List<TransitPath> findShortestPath( String originUnLocode, String destinationUnLocode )
     {
-        Date date = nextDate( new Date() );
+        ZonedDateTime date = nextDate( ZonedDateTime.now() );
 
         List<String> allVertices = dao.listLocations();
         allVertices.remove( originUnLocode );
@@ -57,8 +57,8 @@ public class GraphTraversalServiceImpl
             final List<TransitEdge> transitEdges = new ArrayList<TransitEdge>( allVertices.size() - 1 );
             final String firstLegTo = allVertices.get( 0 );
 
-            Date fromDate = nextDate( date );
-            Date toDate = nextDate( fromDate );
+            ZonedDateTime fromDate = nextDate( date );
+            ZonedDateTime toDate = nextDate( fromDate );
             date = nextDate( toDate );
 
             transitEdges.add( new TransitEdge(
@@ -88,9 +88,9 @@ public class GraphTraversalServiceImpl
         return candidates;
     }
 
-    private Date nextDate( Date date )
+    private ZonedDateTime nextDate( ZonedDateTime date )
     {
-        return new Date( date.getTime() + ONE_DAY_MS + ( random.nextInt( 1000 ) - 500 ) * ONE_MIN_MS );
+        return date.plusDays( 1 + random.nextInt(30) );
     }
 
     private int getRandomNumberOfCandidates()

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/bootstrap/DCISampleApplication_a.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/bootstrap/DCISampleApplication_a.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/bootstrap/DCISampleApplication_a.java
index 690261d..70f61ba 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/bootstrap/DCISampleApplication_a.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/bootstrap/DCISampleApplication_a.java
@@ -17,7 +17,6 @@
  */
 package org.qi4j.sample.dcicargo.sample_a.bootstrap;
 
-import java.util.Date;
 import org.apache.wicket.ConverterLocator;
 import org.apache.wicket.Page;
 import org.apache.wicket.datetime.PatternDateConverter;
@@ -53,9 +52,6 @@ public class DCISampleApplication_a
 
         // Show/hide wicket tags in html code
         getMarkupSettings().setStripWicketTags( true );
-
-        // Default date format (we don't care for now about the hour of the day)
-        ( (ConverterLocator) getConverterLocator() ).set( Date.class, new PatternDateConverter( "yyyy-MM-dd", true ) );
     }
 
     private void mountPages()

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/bootstrap/sampledata/BaseData.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/bootstrap/sampledata/BaseData.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/bootstrap/sampledata/BaseData.java
index ac474a6..a46a8c5 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/bootstrap/sampledata/BaseData.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/bootstrap/sampledata/BaseData.java
@@ -17,12 +17,10 @@
  */
 package org.qi4j.sample.dcicargo.sample_a.bootstrap.sampledata;
 
+import java.time.ZonedDateTime;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Date;
 import java.util.List;
-import org.joda.time.DateTime;
-import org.joda.time.LocalDate;
 import org.qi4j.api.structure.Module;
 import org.qi4j.api.value.ValueBuilder;
 import org.qi4j.sample.dcicargo.sample_a.data.shipping.cargo.RouteSpecification;
@@ -39,6 +37,8 @@ import org.qi4j.sample.dcicargo.sample_a.data.shipping.voyage.Voyage;
  */
 public abstract class BaseData
 {
+    private static final ZonedDateTime TODAY = ZonedDateTime.now().withHour( 0 ).withMinute( 0 ).withSecond( 0 );
+
     protected Module module;
 
     protected static UnLocode AUMEL;
@@ -67,7 +67,11 @@ public abstract class BaseData
         return unlocode.newInstance();
     }
 
-    protected CarrierMovement carrierMovement( Location depLoc, Location arrLoc, Date depTime, Date arrTime )
+    protected CarrierMovement carrierMovement( Location depLoc,
+                                               Location arrLoc,
+                                               ZonedDateTime depTime,
+                                               ZonedDateTime arrTime
+    )
     {
         ValueBuilder<CarrierMovement> carrierMovement = module.newValueBuilder( CarrierMovement.class );
         carrierMovement.prototype().departureLocation().set( depLoc );
@@ -86,7 +90,7 @@ public abstract class BaseData
         return schedule.newInstance();
     }
 
-    protected Leg leg( Voyage voyage, Location load, Location unload, Date loadTime, Date unloadTime )
+    protected Leg leg( Voyage voyage, Location load, Location unload, ZonedDateTime loadTime, ZonedDateTime unloadTime )
     {
         ValueBuilder<Leg> leg = module.newValueBuilder( Leg.class );
         leg.prototype().voyage().set( voyage );
@@ -106,7 +110,7 @@ public abstract class BaseData
         return itinerary.newInstance();
     }
 
-    protected RouteSpecification routeSpecification( Location origin, Location destination, Date deadline )
+    protected RouteSpecification routeSpecification( Location origin, Location destination, ZonedDateTime deadline )
     {
         ValueBuilder<RouteSpecification> routeSpec = module.newValueBuilder( RouteSpecification.class );
         routeSpec.prototype().origin().set( origin );
@@ -115,8 +119,8 @@ public abstract class BaseData
         return routeSpec.newInstance();
     }
 
-    protected static Date day( int days )
+    protected static ZonedDateTime day( int days )
     {
-        return LocalDate.now().plusDays( days ).toDate();
+        return TODAY.plusDays( days );
     }
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/bootstrap/sampledata/BaseDataService.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/bootstrap/sampledata/BaseDataService.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/bootstrap/sampledata/BaseDataService.java
index 116b733..9178997 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/bootstrap/sampledata/BaseDataService.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/bootstrap/sampledata/BaseDataService.java
@@ -26,9 +26,7 @@ import org.qi4j.api.service.ServiceComposite;
 import org.qi4j.api.service.ServiceReference;
 import org.qi4j.api.structure.Module;
 import org.qi4j.api.unitofwork.UnitOfWork;
-import org.qi4j.api.unitofwork.UnitOfWorkFactory;
 import org.qi4j.api.value.ValueBuilder;
-import org.qi4j.api.value.ValueBuilderFactory;
 import org.qi4j.sample.dcicargo.sample_a.data.entity.CargosEntity;
 import org.qi4j.sample.dcicargo.sample_a.data.entity.HandlingEventsEntity;
 import org.qi4j.sample.dcicargo.sample_a.data.shipping.location.Location;
@@ -44,26 +42,25 @@ import static org.qi4j.api.usecase.UsecaseBuilder.newUsecase;
 /**
  * Create basic sample data
  */
-@Mixins( BaseDataService.Mixin.class )
-@Activators( BaseDataService.Activator.class )
+@Mixins(BaseDataService.Mixin.class)
+@Activators(BaseDataService.Activator.class)
 public interface BaseDataService
     extends ServiceComposite
 {
 
-    void createBaseData() 
-    		throws Exception;
+    void createBaseData()
+        throws Exception;
 
     class Activator
-            extends ActivatorAdapter<ServiceReference<BaseDataService>>
+        extends ActivatorAdapter<ServiceReference<BaseDataService>>
     {
 
         @Override
         public void afterActivation( ServiceReference<BaseDataService> activated )
-                throws Exception
+            throws Exception
         {
             activated.get().createBaseData();
         }
-
     }
 
     public abstract class Mixin extends BaseData
@@ -78,28 +75,28 @@ public interface BaseDataService
 
         @Override
         public void createBaseData()
-        	throws Exception
+            throws Exception
         {
             logger.debug( "CREATING BASIC DATA..." );
             UnitOfWork uow = module.newUnitOfWork( newUsecase( "Open uow for " ) );
             try
             {
-	            // UnLocode value objects
-	            AUMEL = unlocode( "AUMEL" ); // Melbourne
-	            CNHGH = unlocode( "CNHGH" ); // Hangzou
-	            CNHKG = unlocode( "CNHKG" ); // Hong Kong
-	            CNSHA = unlocode( "CNSHA" ); // Shanghai
-	            DEHAM = unlocode( "DEHAM" ); // Hamburg
-	            FIHEL = unlocode( "FIHEL" ); // Helsinki
-	            JNTKO = unlocode( "JNTKO" ); // Tokyo
-	            NLRTM = unlocode( "NLRTM" ); // Rotterdam
-	            SEGOT = unlocode( "SEGOT" ); // Gothenburg
-	            SESTO = unlocode( "SESTO" ); // Stockholm
-	            USCHI = unlocode( "USCHI" ); // Chicago
-	            USDAL = unlocode( "USDAL" ); // Dallas
-	            USNYC = unlocode( "USNYC" ); // New York
-	
-	            // Location entity objects
+                // UnLocode value objects
+                AUMEL = unlocode( "AUMEL" ); // Melbourne
+                CNHGH = unlocode( "CNHGH" ); // Hangzou
+                CNHKG = unlocode( "CNHKG" ); // Hong Kong
+                CNSHA = unlocode( "CNSHA" ); // Shanghai
+                DEHAM = unlocode( "DEHAM" ); // Hamburg
+                FIHEL = unlocode( "FIHEL" ); // Helsinki
+                JNTKO = unlocode( "JNTKO" ); // Tokyo
+                NLRTM = unlocode( "NLRTM" ); // Rotterdam
+                SEGOT = unlocode( "SEGOT" ); // Gothenburg
+                SESTO = unlocode( "SESTO" ); // Stockholm
+                USCHI = unlocode( "USCHI" ); // Chicago
+                USDAL = unlocode( "USDAL" ); // Dallas
+                USNYC = unlocode( "USNYC" ); // New York
+
+                // Location entity objects
                 Location MELBOURNE = location( AUMEL, "Melbourne" );
                 Location HANGZHOU = location( CNHGH, "Hangzhou" );
                 Location HONGKONG = location( CNHKG, "Hongkong" );
@@ -114,43 +111,43 @@ public interface BaseDataService
                 Location DALLAS = location( USDAL, "Dallas" );
                 Location NEWYORK = location( USNYC, "New York" );
 
-	            // Voyage entity objects
+                // Voyage entity objects
                 Voyage V100S = voyage( "V100S", schedule(
-	                carrierMovement( NEWYORK, CHICAGO, day( 1 ), day( 2 ) ),
-	                carrierMovement( CHICAGO, DALLAS, day( 8 ), day( 9 ) )
-	            ) );
+                    carrierMovement( NEWYORK, CHICAGO, day( 1 ), day( 2 ) ),
+                    carrierMovement( CHICAGO, DALLAS, day( 8 ), day( 9 ) )
+                ) );
                 Voyage V200T = voyage( "V200T", schedule(
-	                carrierMovement( NEWYORK, CHICAGO, day( 7 ), day( 8 ) ),
-	                carrierMovement( CHICAGO, DALLAS, day( 8 ), day( 9 ) )
-	            ) );
+                    carrierMovement( NEWYORK, CHICAGO, day( 7 ), day( 8 ) ),
+                    carrierMovement( CHICAGO, DALLAS, day( 8 ), day( 9 ) )
+                ) );
                 Voyage V300A = voyage( "V300A", schedule(
-	                carrierMovement( DALLAS, HAMBURG, day( 10 ), day( 14 ) ),
-	                carrierMovement( HAMBURG, STOCKHOLM, day( 15 ), day( 16 ) ),
-	                carrierMovement( STOCKHOLM, HELSINKI, day( 17 ), day( 18 ) )
-	            ) );
+                    carrierMovement( DALLAS, HAMBURG, day( 10 ), day( 14 ) ),
+                    carrierMovement( HAMBURG, STOCKHOLM, day( 15 ), day( 16 ) ),
+                    carrierMovement( STOCKHOLM, HELSINKI, day( 17 ), day( 18 ) )
+                ) );
                 Voyage V400S = voyage( "V400S", schedule(
-	                carrierMovement( TOKYO, ROTTERDAM, day( 9 ), day( 15 ) ),
-	                carrierMovement( ROTTERDAM, HAMBURG, day( 15 ), day( 16 ) ),
-	                carrierMovement( HAMBURG, MELBOURNE, day( 17 ), day( 26 ) ),
-	                carrierMovement( MELBOURNE, TOKYO, day( 27 ), day( 33 ) )
-	            ) );
+                    carrierMovement( TOKYO, ROTTERDAM, day( 9 ), day( 15 ) ),
+                    carrierMovement( ROTTERDAM, HAMBURG, day( 15 ), day( 16 ) ),
+                    carrierMovement( HAMBURG, MELBOURNE, day( 17 ), day( 26 ) ),
+                    carrierMovement( MELBOURNE, TOKYO, day( 27 ), day( 33 ) )
+                ) );
                 Voyage V500S = voyage( "V500S", schedule(
-	                carrierMovement( HAMBURG, STOCKHOLM, day( 17 ), day( 19 ) ),
-	                carrierMovement( STOCKHOLM, HELSINKI, day( 20 ), day( 21 ) )
-	            ) );
+                    carrierMovement( HAMBURG, STOCKHOLM, day( 17 ), day( 19 ) ),
+                    carrierMovement( STOCKHOLM, HELSINKI, day( 20 ), day( 21 ) )
+                ) );
 
-	            // Cargo and HandlingEvent factories
+                // Cargo and HandlingEvent factories
                 CargosEntity CARGOS = uow.newEntity( CargosEntity.class, CargosEntity.CARGOS_ID );
                 uow.newEntity( HandlingEventsEntity.class, HandlingEventsEntity.HANDLING_EVENTS_ID );
-	
-	            logger.debug( "BASIC DATA CREATED" );
-	            uow.complete();
+
+                logger.debug( "BASIC DATA CREATED" );
+                uow.complete();
             }
-            catch(Exception e)
+            catch( Exception e )
             {
-            	uow.discard();
-            	logger.error("CANNOT CREATE BASIC DATA");
-            	throw e;
+                uow.discard();
+                logger.error( "CANNOT CREATE BASIC DATA" );
+                throw e;
             }
         }
 
@@ -177,6 +174,5 @@ public interface BaseDataService
             voyage.instance().schedule().set( schedule );
             return voyage.newInstance();
         }
-
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/bootstrap/sampledata/SampleDataService.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/bootstrap/sampledata/SampleDataService.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/bootstrap/sampledata/SampleDataService.java
index c991893..359be79 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/bootstrap/sampledata/SampleDataService.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/bootstrap/sampledata/SampleDataService.java
@@ -17,13 +17,11 @@
  */
 package org.qi4j.sample.dcicargo.sample_a.bootstrap.sampledata;
 
+import java.time.ZonedDateTime;
 import java.util.ArrayList;
-import java.util.Date;
 import java.util.List;
 import java.util.Random;
 import java.util.UUID;
-import org.joda.time.LocalDate;
-import org.joda.time.LocalTime;
 import org.qi4j.api.activation.ActivatorAdapter;
 import org.qi4j.api.activation.Activators;
 import org.qi4j.api.injection.scope.Service;
@@ -55,26 +53,25 @@ import static org.qi4j.sample.dcicargo.sample_a.infrastructure.dci.Context.prepa
 /**
  * Create sample Cargos in different delivery stages
  */
-@Mixins( SampleDataService.Mixin.class )
-@Activators( SampleDataService.Activator.class )
+@Mixins(SampleDataService.Mixin.class)
+@Activators(SampleDataService.Activator.class)
 public interface SampleDataService
     extends ServiceComposite
 {
 
     void insertSampleData()
-            throws Exception;
+        throws Exception;
 
     class Activator
-            extends ActivatorAdapter<ServiceReference<SampleDataService>>
+        extends ActivatorAdapter<ServiceReference<SampleDataService>>
     {
 
         @Override
         public void afterActivation( ServiceReference<SampleDataService> activated )
-                throws Exception
+            throws Exception
         {
             activated.get().insertSampleData();
         }
-
     }
 
     public abstract class Mixin
@@ -87,7 +84,7 @@ public interface SampleDataService
         UnitOfWorkFactory uowf;
 
         @Service // We depend on BaseData to be inserted
-        BaseDataService baseDataService;
+            BaseDataService baseDataService;
 
         private static final Logger logger = LoggerFactory.getLogger( SampleDataService.class );
 
@@ -112,7 +109,7 @@ public interface SampleDataService
                 {
                     String trackingId = cargo.trackingId().get().id().get();
                     ExpectedHandlingEvent nextEvent;
-                    Date time;
+                    ZonedDateTime time;
                     String port;
                     String voyage;
                     HandlingEventType type;
@@ -131,7 +128,7 @@ public interface SampleDataService
                     {
                         nextEvent = cargo.delivery().get().nextExpectedHandlingEvent().get();
                         port = nextEvent.location().get().getCode();
-                        Date mockTime = new Date();
+                        ZonedDateTime mockTime = ZonedDateTime.now();
                         new RegisterHandlingEvent( mockTime, mockTime, trackingId, "RECEIVE", port, null ).register();
                     }
 
@@ -283,7 +280,7 @@ public interface SampleDataService
             Location origin;
             Location destination;
             Random random = new Random();
-            Date deadline;
+            ZonedDateTime deadline;
             String uuid;
             String id;
             try
@@ -299,9 +296,7 @@ public interface SampleDataService
                     }
                     while( destination.equals( origin ) );
 
-                    deadline = new LocalDate().plusDays( 15 + random.nextInt( 10 ) )
-                        .toDateTime( new LocalTime() )
-                        .toDate();
+                    deadline = ZonedDateTime.now().plusDays( 15 + random.nextInt( 10 ) );
 
                     // Build sortable random tracking ids
                     uuid = UUID.randomUUID().toString().toUpperCase();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/query/dto/HandlingEventDTO.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/query/dto/HandlingEventDTO.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/query/dto/HandlingEventDTO.java
index b8e3a76..cbf85d2 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/query/dto/HandlingEventDTO.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/query/dto/HandlingEventDTO.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_a.communication.query.dto;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.property.Property;
 import org.qi4j.library.conversion.values.Unqualified;
@@ -36,7 +36,7 @@ import org.qi4j.sample.dcicargo.sample_a.infrastructure.conversion.DTO;
 @Unqualified
 public interface HandlingEventDTO extends DTO
 {
-    Property<Date> completionTime();
+    Property<ZonedDateTime> completionTime();
 
     Property<TrackingId> trackingId();
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/booking/BookNewCargoPage.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/booking/BookNewCargoPage.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/booking/BookNewCargoPage.java
index ccb6946..6a0df02 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/booking/BookNewCargoPage.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/booking/BookNewCargoPage.java
@@ -17,6 +17,9 @@
  */
 package org.qi4j.sample.dcicargo.sample_a.communication.web.booking;
 
+import java.time.Instant;
+import java.time.ZoneId;
+import java.time.ZonedDateTime;
 import java.util.Date;
 import java.util.List;
 import org.apache.wicket.Session;
@@ -27,7 +30,6 @@ import org.apache.wicket.markup.html.form.Form;
 import org.apache.wicket.markup.html.panel.ComponentFeedbackPanel;
 import org.apache.wicket.markup.html.panel.FeedbackPanel;
 import org.apache.wicket.request.mapper.parameter.PageParameters;
-import org.joda.time.LocalDate;
 import org.qi4j.sample.dcicargo.sample_a.communication.query.CommonQueries;
 import org.qi4j.sample.dcicargo.sample_a.context.shipping.booking.BookNewCargo;
 import org.qi4j.sample.dcicargo.sample_a.data.shipping.cargo.TrackingId;
@@ -58,7 +60,7 @@ public class BookNewCargoPage extends BookingBasePage
     {
         // Set by Wicket property resolvers:
         private String origin, destination;
-        private Date deadline;
+        private Date wicketSetDeadline;
 
         public BookNewCargoForm()
         {
@@ -108,7 +110,7 @@ public class BookNewCargoPage extends BookingBasePage
 
             // Deadline
             final DateTextFieldWithPicker deadlineField = new DateTextFieldWithPicker( "deadline", "Arrival deadline", this );
-            deadlineField.earliestDate( new LocalDate().plusDays( 1 ) );
+            deadlineField.earliestDate( ZonedDateTime.now().plusDays( 1 ) );
 
             final ComponentFeedbackPanel deadlineFeedback = new ComponentFeedbackPanel(
                 "deadlineFeedback", deadlineField );
@@ -124,6 +126,8 @@ public class BookNewCargoPage extends BookingBasePage
                     try
                     {
                         // Perform use case
+                        Instant instant = Instant.ofEpochMilli( wicketSetDeadline.getTime() );
+                        ZonedDateTime deadline = ZonedDateTime.ofInstant( instant, ZoneId.systemDefault() );
                         TrackingId trackingId = new BookNewCargo( origin, destination, deadline ).book();
 
                         // Add new tracking id to list in session

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/booking/CargoDetailsPage.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/booking/CargoDetailsPage.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/booking/CargoDetailsPage.java
index 2b44087..dee31f1 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/booking/CargoDetailsPage.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/booking/CargoDetailsPage.java
@@ -17,6 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_a.communication.web.booking;
 
+import java.time.LocalTime;
 import java.util.Date;
 import java.util.List;
 import org.apache.wicket.AttributeModifier;
@@ -140,14 +141,14 @@ public class CargoDetailsPage extends BookingBasePage
                     Leg leg = item.getModelObject();
 
                     item.add( new Label( "loadLocation", leg.loadLocation().get().getCode() ) );
-                    item.add( new Label( "loadTime", new Model<Date>( leg.loadTime().get() ) ) );
+                    item.add( new Label( "loadTime", new Model<Date>( new Date( leg.loadTime().get().toInstant().toEpochMilli() )) ) );
                     item.add( new Label( "voyage", leg.voyage().get().voyageNumber().get().number().get() ) );
 
                     Boolean isMisrouted = routingStatus == RoutingStatus.MISROUTED && item.getIndex() == ( getList().size() - 1 );
                     item.add( new Label( "unloadLocation", leg.unloadLocation().get().getCode() )
                                   .add( new ErrorColor( isMisrouted ) ) );
 
-                    item.add( new Label( "unloadTime", new Model<Date>( leg.unloadTime().get() ) ) );
+                    item.add( new Label( "unloadTime", new Model<Date>( new Date( leg.unloadTime().get().toInstant().toEpochMilli() ) ) ) );
                 }
             } );
         }


[19/50] [abbrv] zest-qi4j git commit: Fixed all JavaDoc ERRORS reported by DocLint in Java 8.

Posted by ni...@apache.org.
http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial10/HelloWorldComposite.java
----------------------------------------------------------------------
diff --git a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial10/HelloWorldComposite.java b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial10/HelloWorldComposite.java
index f421c21..35c3fd9 100644
--- a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial10/HelloWorldComposite.java
+++ b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial10/HelloWorldComposite.java
@@ -6,12 +6,12 @@ import org.qi4j.api.mixin.Mixins;
 // START SNIPPET: solution
 
 /**
- * This Composite interface declares transitively
- * all the Fragments of the HelloWorld composite.
- * <p/>
+ * This Composite interface declares transitively all the Fragments of the HelloWorld composite.
+ * <p>
  * The Fragments are all abstract, so it's ok to
  * put the domain methods here. Otherwise the Fragments
  * would have to implement all methods, including those in Composite.
+ * </p>
  */
 @Mixins( { HelloWorldMixin.class } )
 public interface HelloWorldComposite

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial2/package.html
----------------------------------------------------------------------
diff --git a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial2/package.html b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial2/package.html
index fd147b4..1487ad7 100644
--- a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial2/package.html
+++ b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial2/package.html
@@ -1,6 +1,6 @@
 <body>
 <h1>Tutorial 2 - Creating a Composite</h1>
-
+<p>
 In this tutorial we will create a TransientComposite interface that ties all pieces together.
 The TransientComposite interface is a regular Java interface which extends the interfaces you
 want to expose from your domain model, and which uses various annotations to declare
@@ -8,11 +8,14 @@ what Fragments to include. Fragments include Mixins, Concerns, SideEffects and C
 In this tutorial we will only use Mixins. When a TransientComposite is instantiated at runtime
 the framework will inspect the interface to determine what the TransientComposite instance should
 look like in terms of used Fragments.
-<p/>
+</p>
+<p>
 In Qi4j all method parameters are considered mandatory unless marked as @Optional. Therefore you can
 remove the null checks in the Mixin. If a null value is passed in an exception will be thrown by Qi4j.
-<p/>
+</p>
+<p>
 Steps for this tutorial:
+</p>
 <ol>
     <li>Create an interface that extends the domain interface HelloWorld and
         org.qi4j.api.composite.TransientComposite.

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial3/HelloWorldComposite.java
----------------------------------------------------------------------
diff --git a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial3/HelloWorldComposite.java b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial3/HelloWorldComposite.java
index bde392b..af32039 100644
--- a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial3/HelloWorldComposite.java
+++ b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial3/HelloWorldComposite.java
@@ -6,10 +6,10 @@ import org.qi4j.api.mixin.Mixins;
 // START SNIPPET: solution
 
 /**
- * This Composite interface declares all the Fragments
- * of the HelloWorld composite.
- * <p/>
+ * This Composite interface declares all the Fragments of the HelloWorld composite.
+ * <p>
  * Currently it only declares one Mixin.
+ * </p>
  */
 @Mixins( HelloWorldMixin.class )
 public interface HelloWorldComposite

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial3/package.html
----------------------------------------------------------------------
diff --git a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial3/package.html b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial3/package.html
index b463d66..a0d2273 100644
--- a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial3/package.html
+++ b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial3/package.html
@@ -1,13 +1,15 @@
 <body>
 <h1>Tutorial 3 - Mixins</h1>
-
+<p>
 In this tutorial we refactor the Mixin from the previous steps into two, one which serves
 the behaviour interface and one which serves the state interface. This makes it possible to
 reuse the interfaces independently and also makes it easier to exchange one interface implementation
 with another. This also allows us to specify the new Mixins as default implementations of
 the interfaces by adding @Mixins annotations on them.
-<p/>
+</p>
+<p>
 Steps for this tutorial:
+</p>
 <ol>
     <li>Refactor the Mixin into one which implement the behaviour interface and one which implements the state
         interface. Use the @This injection annotation to allow the behaviour to access the state.

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial4/HelloWorldBehaviour.java
----------------------------------------------------------------------
diff --git a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial4/HelloWorldBehaviour.java b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial4/HelloWorldBehaviour.java
index 49174d0..1a096ae 100644
--- a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial4/HelloWorldBehaviour.java
+++ b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial4/HelloWorldBehaviour.java
@@ -5,10 +5,10 @@ import org.qi4j.api.mixin.Mixins;
 // START SNIPPET: solution
 
 /**
- * This interface contains only the behaviour
- * of the HelloWorld object.
- * <p/>
+ * This interface contains only the behaviour of the HelloWorld object.
+ * <p>
  * It declares what Mixin to use as default implementation.
+ * </p>
  */
 @Mixins( HelloWorldBehaviourMixin.class )
 public interface HelloWorldBehaviour

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial4/HelloWorldBehaviourMixin.java
----------------------------------------------------------------------
diff --git a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial4/HelloWorldBehaviourMixin.java b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial4/HelloWorldBehaviourMixin.java
index 31bb921..3a73e94 100644
--- a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial4/HelloWorldBehaviourMixin.java
+++ b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial4/HelloWorldBehaviourMixin.java
@@ -5,14 +5,14 @@ import org.qi4j.api.injection.scope.This;
 // START SNIPPET: solution
 
 /**
- * This is the implementation of the HelloWorld
- * behaviour interface.
- * <p/>
+ * This is the implementation of the HelloWorld behaviour interface.
+ * <p>
  * It uses a @This Dependency Injection
  * annotation to access the state of the Composite. The field
  * will be automatically injected when the Composite
  * is instantiated. Injections of resources or references
  * can be provided either to fields, constructor parameters or method parameters.
+ * </p>
  */
 public class HelloWorldBehaviourMixin
     implements HelloWorldBehaviour

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial4/HelloWorldComposite.java
----------------------------------------------------------------------
diff --git a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial4/HelloWorldComposite.java b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial4/HelloWorldComposite.java
index 0f11316..e104a96 100644
--- a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial4/HelloWorldComposite.java
+++ b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial4/HelloWorldComposite.java
@@ -7,11 +7,12 @@ import org.qi4j.api.composite.TransientComposite;
 /**
  * This Composite interface declares all the Fragments
  * of the HelloWorld composite.
- * <p/>
+ * <p>
  * The Mixins annotation has been moved to the respective sub-interfaces.
  * The sub-interfaces therefore declare themselves what mixin implementation
  * is preferred. This interface could still have its own Mixins annotation
  * with overrides of those defaults however.
+ * </p>
  */
 public interface HelloWorldComposite
     extends HelloWorld, TransientComposite

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial4/package.html
----------------------------------------------------------------------
diff --git a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial4/package.html b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial4/package.html
index 203287b..dd69d87 100644
--- a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial4/package.html
+++ b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial4/package.html
@@ -1,18 +1,20 @@
 <body>
 <h1>Tutorial 4 - Concerns</h1>
-
+<p>
 In this tutorial we refactor the mixin from the previous steps so that the result of the say() method
 is modified to be prefixed with "Simon says:". To do this we need to implement a Concern for
 the say() method. Concerns are a type of Modifier which modify the behaviour of
 the methods in Mixins. They do this by intercepting the invocation of the TransientComposite. This allows
 them to change the invocation parameters, return their own values or throw their own exceptions,
 and do other things which directly affect the invocation of the method.
-<p/>
+</p>
+<p>
 Concerns should not perform any side-effects, such as updating state in another TransientComposite, Mixin
 or similar. Any side-effects are done in SideEffects, which is another type of Modifier, which are
 allowed to perform side-effects but, in contrast to Concerns, cannot change the parameters or
 in any other way change the result of the invocation.
-<p/>
+</p>
+<p>
 Concerns are implemented in one of two ways: either create a class which directly implements
 the interface whose methods should be modified, or create a generic Modifier by implementing
 the InvocationHandler interface (or subclass GenericConcern which does this for you).
@@ -21,11 +23,14 @@ which has the same type as the interface the Concern implements. When the Transi
 the Concern will be called, allowing it to perform it's work. If the call should proceed, then
 invoke the method again on the injected object. The preferred way to do all of this is to subclass
 ConcernOf which does all of this for you.
-<p/>
+</p>
+<p>
 Concerns are applied by adding an @Concerns annotation on the TransientComposite, the domain interface,
 or the Mixin implementation. Any of these works, and where to put it is a matter of design choice.
-<p/>
+</p>
+<p>
 Steps for this tutorial:
+</p>
 <ol>
     <li>Create a typed concern, implement the HelloWorldBehaviour and let it modify the result
         of the base method by prefix the result with "Simon says:".

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial5/HelloWorldBehaviour.java
----------------------------------------------------------------------
diff --git a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial5/HelloWorldBehaviour.java b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial5/HelloWorldBehaviour.java
index 2435747..0392284 100644
--- a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial5/HelloWorldBehaviour.java
+++ b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial5/HelloWorldBehaviour.java
@@ -5,8 +5,9 @@ import org.qi4j.api.mixin.Mixins;
 /**
  * This interface contains only the behaviour
  * of the HelloWorld object.
- * <p/>
+ * <p>
  * It declares what Mixin to use as default implementation.
+ * </p>
  */
 @Mixins( HelloWorldBehaviourMixin.class )
 public interface HelloWorldBehaviour

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial5/HelloWorldBehaviourMixin.java
----------------------------------------------------------------------
diff --git a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial5/HelloWorldBehaviourMixin.java b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial5/HelloWorldBehaviourMixin.java
index a1841cc..e632894 100644
--- a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial5/HelloWorldBehaviourMixin.java
+++ b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial5/HelloWorldBehaviourMixin.java
@@ -8,12 +8,13 @@ import org.qi4j.api.injection.scope.This;
 /**
  * This is the implementation of the HelloWorld
  * behaviour interface.
- * <p/>
+ * <p>
  * It uses a @This Dependency Injection
  * annotation to access the state of the Composite. The field
  * will be automatically injected when the Composite
  * is instantiated. Injections of resources or references
  * can be provided either to fields, constructor parameters or method parameters.
+ * </p>
  */
 @Concerns( HelloWorldBehaviourConcern.class )
 public class HelloWorldBehaviourMixin

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial5/HelloWorldComposite.java
----------------------------------------------------------------------
diff --git a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial5/HelloWorldComposite.java b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial5/HelloWorldComposite.java
index 197de50..5d52df1 100644
--- a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial5/HelloWorldComposite.java
+++ b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial5/HelloWorldComposite.java
@@ -5,11 +5,12 @@ import org.qi4j.api.composite.TransientComposite;
 /**
  * This Composite interface declares transitively
  * all the Fragments of the HelloWorld composite.
- * <p/>
+ * <p>
  * What Mixins to use and what Assertions should
  * apply to the methods can be found by exploring
  * the interfaces extended by this Composite interface,
  * and by looking at the declared Mixins.
+ * </p>
  */
 public interface HelloWorldComposite
     extends HelloWorld, TransientComposite

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial5/HelloWorldState.java
----------------------------------------------------------------------
diff --git a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial5/HelloWorldState.java b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial5/HelloWorldState.java
index c31c41d..8871fab 100644
--- a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial5/HelloWorldState.java
+++ b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial5/HelloWorldState.java
@@ -5,8 +5,9 @@ import org.qi4j.api.mixin.Mixins;
 /**
  * This interface contains only the state
  * of the HelloWorld object.
- * <p/>
+ * <p>
  * It declares what Mixin to use as default implementation.
+ * </p>
  */
 @Mixins( HelloWorldStateMixin.class )
 public interface HelloWorldState

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial5/package.html
----------------------------------------------------------------------
diff --git a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial5/package.html b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial5/package.html
index 566059c..11ecec6 100644
--- a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial5/package.html
+++ b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial5/package.html
@@ -1,38 +1,44 @@
 <body>
 <h1>Tutorial 5 - Constraints</h1>
-
+<p>
 In this tutorial we will look at how to use Constraints. When we pass parameters to
 methods in regular Java code the only restriction we can make is to denote a type.
 Any other constraints on the input value, such as whether the parameter is optional, integer ranges,
 string regular expressions, and so on, cannot be expressed, and so we have to put this into Javadoc, and
 then manually add these checks in the implementation class.
-<p/>
+</p>
+<p>
 In Qi4j there is the option to use Constraints, which are further restrictions on the parameters.
 This is implemented by having an annotation that describes what the Constraint does, and then
 an implementation class that checks whether a specific value fulfills the Constraint or not.
-<p/>
+</p>
+<p>
 There are a number of pre-written constraints in Qi4j which you can use. The null check of the original
 HelloWorld version is already handled by default since Qi4j considers method parameters to be mandatory if not
 explicitly marked with the @Optional annotation. So, instead of doing that check we will add
 other checks that are useful to make, such as ensuring that the passed in string is not empty.
-<p/>
+</p>
+<p>
 The only thing you have to do is add the annotation @NotEmpty to the method parameters you want to
 constrain in this way. The annotation has a default implementation declared in it by using the @Constraints
 annotation. You can either just use this, which is the common case, or override it by declaring your
 own @Constraints annotation in the TransientComposite type.
-<p/>
+</p>
+<p>
 You can add as many Constraint annotations you want to a parameter. All of them will be checked whenever a method is
 called.
-<p/>
+</p>
+<p>
 Steps for this tutorial:
+</p>
 <ol>
     <li>Add @NotEmpty to the state parameters.</li>
 </ol>
-<p><em>Note:</em><br/>
+<p><em>Note:</em></p>
+<p>
     The previous steps had a dependency to the <code>qi4j-core-api</code> only. The constraints
     you've used in this step, introduce a new dependency to the <code>qi4j-lib-constraints</code>
     library, where all the constraint related classes reside. So update your classpath settings
     accordingly.
 </p>
 </body>
-        
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial6/HelloWorldBehaviour.java
----------------------------------------------------------------------
diff --git a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial6/HelloWorldBehaviour.java b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial6/HelloWorldBehaviour.java
index 7312c45..ba34e73 100644
--- a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial6/HelloWorldBehaviour.java
+++ b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial6/HelloWorldBehaviour.java
@@ -8,9 +8,10 @@ import org.qi4j.api.mixin.Mixins;
 /**
  * This interface contains only the behaviour
  * of the HelloWorld object.
- * <p/>
+ * <p>
  * It declares what Mixin to use as default implementation, and also the extra
  * concern to be applied.
+ * </p>
  */
 @Concerns( HelloWorldBehaviourConcern.class )
 @Mixins( HelloWorldBehaviourMixin.class )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial6/HelloWorldBehaviourMixin.java
----------------------------------------------------------------------
diff --git a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial6/HelloWorldBehaviourMixin.java b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial6/HelloWorldBehaviourMixin.java
index 1d59c6e..73ad983 100644
--- a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial6/HelloWorldBehaviourMixin.java
+++ b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial6/HelloWorldBehaviourMixin.java
@@ -7,12 +7,13 @@ import org.qi4j.api.injection.scope.This;
 /**
  * This is the implementation of the HelloWorld
  * behaviour interface.
- * <p/>
+ * <p>
  * It uses a @This DependencyModel Injection
  * annotation to access the state of the Composite. The field
  * will be automatically injected when the Composite
  * is instantiated. Injections of resources or references
  * can be provided either to fields, constructor parameters or method parameters.
+ * </p>
  */
 public class HelloWorldBehaviourMixin
     implements HelloWorldBehaviour

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial6/HelloWorldComposite.java
----------------------------------------------------------------------
diff --git a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial6/HelloWorldComposite.java b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial6/HelloWorldComposite.java
index 87c3c74..18c772d 100644
--- a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial6/HelloWorldComposite.java
+++ b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial6/HelloWorldComposite.java
@@ -5,11 +5,12 @@ import org.qi4j.api.composite.TransientComposite;
 /**
  * This Composite interface declares transitively
  * all the Fragments of the HelloWorld composite.
- * <p/>
+ * <p>
  * What Mixins to use and what Concerns should
  * apply to the methods can be found by exploring
  * the interfaces extended by this Composite interface,
  * and by looking at the declared @Mixins annotations.
+ * </p>
  */
 public interface HelloWorldComposite
     extends HelloWorld, TransientComposite

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial6/HelloWorldState.java
----------------------------------------------------------------------
diff --git a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial6/HelloWorldState.java b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial6/HelloWorldState.java
index 6cb6467..0f80254a 100644
--- a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial6/HelloWorldState.java
+++ b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial6/HelloWorldState.java
@@ -8,9 +8,10 @@ import org.qi4j.library.constraints.annotation.NotEmpty;
 /**
  * This interface contains only the state
  * of the HelloWorld object.
- * <p/>
+ * <p>
  * The parameters are declared as @NotEmpty, so the client cannot pass in empty strings
  * as values.
+ * </p>
  */
 @Mixins( HelloWorldStateMixin.class )
 public interface HelloWorldState

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial6/package.html
----------------------------------------------------------------------
diff --git a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial6/package.html b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial6/package.html
index 1a381d9..20e0a01 100644
--- a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial6/package.html
+++ b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial6/package.html
@@ -1,18 +1,20 @@
 <body>
 <h1>Tutorial 6 - SideEffects</h1>
-
+<p>
 The current say() method has a Concern that modifies its value. What if we instead want
 the value to be intact, but log that value to System.out? That would be considered a side-effect
 of the say() method, and should hence not be done in a Concern. It would be better to implement
 this in a SideEffect. SideEffects are executed after the Mixin and all Concerns for a method are done,
 which means that the final result has been computed. A SideEffect can access this result value, and
 then use that for further computation, but it should not change the value or throw an exception.
-<p/>
+</p>
+<p>
 SideEffects can be either typed or generic, just like Concerns. In the typed case we are
 interested in specifying SideEffects for one or more particular methods, whereas in the generic
 case the SideEffect is not really relying on what method is being invoked. Both are useful
 in different scenarios.
-<p/>
+</p>
+<p>
 The easiest way to implement a typed SideEffect is to subclass the SideEffectOf class. This gives
 you access to the result of the real method invocation by using the "result" field, which has the same
 type as the interface of the method you want the code to be a side-effect of. Note that calling "result"
@@ -20,11 +22,14 @@ does not actually do anything, it only returns the value (or throws the exceptio
 from the original method) that has already been computed. Similarly, since the method is already done,
 you can return anything from the SideEffect method. The framework will simply throw it away, and also
 ignore any exceptions that you throw in your code.
-<p/>
+</p>
+<p>
 To declare that the SideEffect should be used you add the @SideEffects annotation to either the
 TransientComposite type, the Mixin type, or the Mixin implementation. Either works.
-<p/>
+</p>
+<p>
 Steps for this tutorial:
+</p>
 <ol>
     <li>Create the SideEffect class that logs the result of say() to System.out.</li>
     <li>Add a @SideEffects annotation with the SideEffect to the HelloWorldComposite interface.</li>

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial7/HelloWorldBehaviourMixin.java
----------------------------------------------------------------------
diff --git a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial7/HelloWorldBehaviourMixin.java b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial7/HelloWorldBehaviourMixin.java
index bbbc50e..726b3f6 100644
--- a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial7/HelloWorldBehaviourMixin.java
+++ b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial7/HelloWorldBehaviourMixin.java
@@ -5,12 +5,13 @@ import org.qi4j.api.injection.scope.This;
 /**
  * This is the implementation of the HelloWorld
  * behaviour interface.
- * <p/>
+ * <p>
  * It uses a @This DependencyModel Injection
  * annotation to access the state of the Composite. The field
  * will be automatically injected when the Composite
  * is instantiated. Injections of resources or references
  * can be provided either to fields, constructor parameters or method parameters.
+ * </p>
  */
 public class HelloWorldBehaviourMixin
     implements HelloWorldBehaviour

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial7/HelloWorldComposite.java
----------------------------------------------------------------------
diff --git a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial7/HelloWorldComposite.java b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial7/HelloWorldComposite.java
index 23b00bd..c73efdb 100644
--- a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial7/HelloWorldComposite.java
+++ b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial7/HelloWorldComposite.java
@@ -9,8 +9,9 @@ import org.qi4j.api.sideeffect.SideEffects;
 /**
  * This Composite interface declares transitively
  * all the Fragments of the HelloWorld composite.
- * <p/>
+ * <p>
  * It declares that the HelloWorldBehaviourSideEffect should be applied.
+ * </p>
  */
 @Mixins( { HelloWorldBehaviourMixin.class, HelloWorldStateMixin.class } )
 @SideEffects( HelloWorldBehaviourSideEffect.class )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial7/HelloWorldState.java
----------------------------------------------------------------------
diff --git a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial7/HelloWorldState.java b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial7/HelloWorldState.java
index 8b81c07..a3143fb 100644
--- a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial7/HelloWorldState.java
+++ b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial7/HelloWorldState.java
@@ -7,9 +7,10 @@ import org.qi4j.library.constraints.annotation.NotEmpty;
 /**
  * This interface contains only the state
  * of the HelloWorld object.
- * <p/>
+ * <p>
  * The parameters are declared as @NotEmpty, so the client cannot pass in empty strings
  * as values.
+ * </p>
  */
 public interface HelloWorldState
 {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial7/package.html
----------------------------------------------------------------------
diff --git a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial7/package.html b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial7/package.html
index b9ca91e..57609da 100644
--- a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial7/package.html
+++ b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial7/package.html
@@ -1,37 +1,47 @@
 <body>
 <h1>Tutorial 7 - Properties</h1>
-
+<p>
 One of the goals of Qi4j is to give you domain modeling tools that allow you to more concisely use
 domain concepts in code. One of the things we do rather often is model Properties of objects as getters
 and setters. But this is a very weak model, and does not give you any access to metadata about the property,
 and also makes common tasks like UI binding non-trivial. There is also a lot of repetition of code, which
 is unnecessary. Using JavaBeans conventions one typically have to have code in five places for one property,
 whereas in Qi4j the same thing can be achieved with one line of code.
-<p/>
+</p>
+<p>
 But lets start out easy. To declare a property you have to make a method in a mixin type that returns a value
 of the type Property, and which does not take any parameters. Here's a simple example:
+</p>
 <pre>
     Property&lt;String&gt; name();
 </pre>
+<p>
 This declares a Property of type String with the name "name". The Property interface has methods "get" and "set"
 to access and mutate the value, respectively.
-<p/>
+</p>
+<p>
 For now you will be responsible for implementing these methods, but later on these will be handled automatically,
 thus reducing Properties to one-liners!
-<p/>
+</p>
+<p>
 In the Mixin implementation of the interface with the Property declaration you should have an injection
 of the Property, which is created for you by Qi4j. The injection can be done in a field like this:
+</p>
 <pre>
     &#64;State Property&lt;String&gt; name;
 </pre>
+<p>
 The State dependency injection annotation means that Qi4j will inject the Property for you. The field
 has the name "name", which matches the name in the interface, and therefore that Property is injected. You can
 then implement the method trivially by just returning the "name" field.
-<p/>
+</p>
+<p>
 Properties can have Constraints just like method parameters. Simply set them on the Property method instead,
 and they will be applied just as before when you call "set".
-<p/>
+</p>
+<p>
 Steps for this tutorial:
+</p>
 <ol>
     <li>Remove JavaBeans properties from HelloWorldState.</li>
     <li>Remove HelloWorld and add the HelloWorldState and HelloWorldBehavior to the HelloWorldComposite interface.</li>

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial8/HelloWorldBehaviourMixin.java
----------------------------------------------------------------------
diff --git a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial8/HelloWorldBehaviourMixin.java b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial8/HelloWorldBehaviourMixin.java
index 936fdf4..226dc0a 100644
--- a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial8/HelloWorldBehaviourMixin.java
+++ b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial8/HelloWorldBehaviourMixin.java
@@ -7,8 +7,9 @@ import org.qi4j.api.injection.scope.This;
 /**
  * This is the implementation of the HelloWorld
  * behaviour interface.
- * <p/>
+ * <p>
  * This version access the state using Qi4j Properties.
+ * </p>
  */
 public class HelloWorldBehaviourMixin
     implements HelloWorldBehaviour

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial8/HelloWorldState.java
----------------------------------------------------------------------
diff --git a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial8/HelloWorldState.java b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial8/HelloWorldState.java
index d5ec464..c85d600 100644
--- a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial8/HelloWorldState.java
+++ b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial8/HelloWorldState.java
@@ -8,9 +8,10 @@ import org.qi4j.library.constraints.annotation.NotEmpty;
 /**
  * This interface contains only the state
  * of the HelloWorld object.
- * <p/>
+ * <p>
  * The state is now declared using Properties. The @NotEmpty annotation is applied to the
  * method instead, and has the same meaning as before.
+ * </p>
  */
 public interface HelloWorldState
 {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial8/package.html
----------------------------------------------------------------------
diff --git a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial8/package.html b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial8/package.html
index db07cdd..00a0c5a 100644
--- a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial8/package.html
+++ b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial8/package.html
@@ -1,6 +1,6 @@
 <body>
 <h1>Tutorial 8 - Generic mixins</h1>
-
+<p>
 In this tutorial we will look at how to use generic Fragments. So far all Fragments, i.e.
 the Concerns, SideEffects, and Mixins, have directly implemented the domain interface. But sometimes it is
 useful to be able to provide a generic implementation of an interface. An example of this is
@@ -8,19 +8,24 @@ the HelloWorldState interface. Since it only handles properties, and the old ver
 for naming getters and setters we could create a mixin that handles invocations of such methods
 automatically for us by storing the properties in a map and use the methods
 to look them up.
-<p/>
+</p>
+<p>
 Implementing a generic Fragment is done by creating a class that implements the interface
 java.lang.proxy.InvocationHandler. This has a single "invoke" method which is passed the
 object that was invoked (the TransientComposite in this case), the method, and the arguments. The
 Fragment is then allowed to implement the method any way it wants.
-<p/>
+</p>
+<p>
 Since interfaces with only Properties is such a common case Qi4j already has a generic Mixin
 that implements the Properties management described above, but for the builtin Property type instead
 of the getter/setter variant. The class is aptly named PropertyMixin.
-<p/>
+</p>
+<p>
 While we could use it, for now we will implement it ourselves to get a feel for how generic Mixins work.
-<p/>
+</p>
+<p>
 Steps for this tutorial:
+</p>
 <ol>
     <li>Remove the HelloWorldStateMixin</li>
     <li>Add a GenericPropertyMixin, and have it implement InvocationHandler</li>

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial9/HelloWorldComposite.java
----------------------------------------------------------------------
diff --git a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial9/HelloWorldComposite.java b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial9/HelloWorldComposite.java
index 5430a11..938d988 100644
--- a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial9/HelloWorldComposite.java
+++ b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial9/HelloWorldComposite.java
@@ -8,10 +8,11 @@ import org.qi4j.api.mixin.Mixins;
 /**
  * This Composite interface declares transitively
  * all the Fragments of the HelloWorld composite.
- * <p/>
+ * <p>
  * All standard declarations have been moved to
  * the StandardAbstractEntityComposite so we don't have to repeat
  * them in all Composites.
+ * </p>
  */
 @Mixins( { HelloWorldBehaviourMixin.class, GenericPropertyMixin.class } )
 public interface HelloWorldComposite

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial9/HelloWorldState.java
----------------------------------------------------------------------
diff --git a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial9/HelloWorldState.java b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial9/HelloWorldState.java
index ada7eb4..51aee06 100644
--- a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial9/HelloWorldState.java
+++ b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial9/HelloWorldState.java
@@ -6,9 +6,10 @@ import org.qi4j.library.constraints.annotation.NotEmpty;
 /**
  * This interface contains only the state
  * of the HelloWorld object.
- * <p/>
+ * <p>
  * The state is declared using Properties. The @NotEmpty annotation is applied to the
  * method to check that the properties are not set to empty strings.
+ * </p>
  */
 public interface HelloWorldState
 {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial9/package.html
----------------------------------------------------------------------
diff --git a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial9/package.html b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial9/package.html
index 93b3387..ea21e57 100644
--- a/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial9/package.html
+++ b/tutorials/composites/src/main/java/org/qi4j/tutorials/composites/tutorial9/package.html
@@ -1,11 +1,12 @@
 <body>
 <h1>Tutorial 9 - Private and abstract mixins</h1>
-
+<p>
 Now we're going to turn around and see how we can reduce the code needed to implement the
 HelloWorld example. We will also look at how to hide the Properties from the client code,
 since Properties are often considered to be implementation details that should not be exposed
 to clients.
-<p/>
+</p>
+<p>
 The first thing we will do is remove the behaviour interface, and move the say() method
 to the TransientComposite type. This forces the mixin to implement the TransientComposite type, which would
 normally mean that it would have to implement all methods, including those found in the TransientComposite
@@ -17,7 +18,8 @@ only map it to that specific method. In order to instantiate the Mixin it will g
 which implements the remaining methods in the TransientComposite type, as no-ops. These will never be called however,
 and is there purely for the purpose of being able to instantiate the Mixin. The Mixin is considered
 to be an Abstract Fragment.
-<p/>
+</p>
+<p>
 To hide the state from the client we need to use what is called Private Mixins. A Private Mixin is
 any mixin that is referenced by another Mixin by using the @This injection, but which is not included
 in the TransientComposite type. As long as there is a Mixin implementation declared for the interface specified
@@ -26,13 +28,16 @@ it is not extended by the TransientComposite type there is no way for a user of
 That
 Mixin becomes an implementation detail. This can be used either for encapsulation purposes, or for referencing
 utility mixins that help the rest of the code implement some interface, but which itself should not be exposed.
-<p/>
+</p>
+<p>
 Since the state is now hidden the initialization of the TransientComposite is a bit more tricky. Instead of just
 instantiating it you have to create a TransientBuilder first, then set the state using .prototypeFor(), and then
 call newInstance(). This ensures that the state can be set during construction, but not at any later point, other
 than through publicly exposed methods.
-<p/>
+</p>
+<p>
 Steps for this tutorial:
+</p>
 <ol>
     <li>Move the say() method into the TransientComposite interface.</li>
     <li>Remove the behaviour interface.</li>

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tutorials/composites/src/main/javadoc/overview.html
----------------------------------------------------------------------
diff --git a/tutorials/composites/src/main/javadoc/overview.html b/tutorials/composites/src/main/javadoc/overview.html
index bd78ee6..cc4b5de 100644
--- a/tutorials/composites/src/main/javadoc/overview.html
+++ b/tutorials/composites/src/main/javadoc/overview.html
@@ -8,20 +8,21 @@ Description of tutorials.
 <h2>Qi4j tutorials</h2>
 
 <h3>Composite tutorials</h3>
-
+<p>
 Throughout this set of tutorials it will be shown how to create and work with Composites, which
 is the basic element in Qi4j. We will refactor one HelloWorld class to take advantage of the various
 features in Qi4j. These refactorings will make it easier to reuse parts of the class,
 and introduce new features without having to change existing code. We will also look
 at some of the existing classes, or Fragments, available in Qi4j that you can reuse
 so that you don't have to write everything yourself.
-<p/>
+</p>
+<p>
 Each tutorial in this series starts with the result from the previous tutorial, so you can
 always look at the next tutorial step for guidance on what to do.
-
+</p>
 <h2>Related Documentation</h2>
-
+<p>
 For more information on Qi4j see <a target="_blank" href="http://www.qi4j.org">the website</a>.
-
+</p>
 </body>
 </html>

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/3bf71dfe/tutorials/hello/src/main/java/org/qi4j/tutorials/hello/Hello.java
----------------------------------------------------------------------
diff --git a/tutorials/hello/src/main/java/org/qi4j/tutorials/hello/Hello.java b/tutorials/hello/src/main/java/org/qi4j/tutorials/hello/Hello.java
index b8cee65..6a716a7 100644
--- a/tutorials/hello/src/main/java/org/qi4j/tutorials/hello/Hello.java
+++ b/tutorials/hello/src/main/java/org/qi4j/tutorials/hello/Hello.java
@@ -24,7 +24,6 @@ import org.qi4j.library.constraints.annotation.NotEmpty;
 /**
  * This Composite interface declares a simple "Hello World" interface with a single say() method. What is being
  * said is defined in the HelloWorldState interface, which is a private mixin.
- * <p/>
  */
 @Mixins( { Hello.HelloWorldMixin.class } )
 public interface Hello


[40/50] [abbrv] zest-qi4j git commit: Removal of warnings.

Posted by ni...@apache.org.
Removal of warnings.


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/90f612e4
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/90f612e4
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/90f612e4

Branch: refs/heads/3.0
Commit: 90f612e44ced7f8f6ab0341e0184ad0cf4ae67c8
Parents: aee712a
Author: Niclas Hedhman <ni...@hedhman.org>
Authored: Sat Oct 4 14:17:59 2014 +0800
Committer: Niclas Hedhman <ni...@hedhman.org>
Committed: Sat Oct 4 14:17:59 2014 +0800

----------------------------------------------------------------------
 core/api/src/main/java/org/qi4j/api/common/QualifiedName.java | 2 ++
 core/api/src/main/java/org/qi4j/api/common/TypeName.java      | 2 ++
 2 files changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/90f612e4/core/api/src/main/java/org/qi4j/api/common/QualifiedName.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/common/QualifiedName.java b/core/api/src/main/java/org/qi4j/api/common/QualifiedName.java
index cb66205..6fed8d9 100644
--- a/core/api/src/main/java/org/qi4j/api/common/QualifiedName.java
+++ b/core/api/src/main/java/org/qi4j/api/common/QualifiedName.java
@@ -98,6 +98,7 @@ public final class QualifiedName
      *
      * @throws NullArgumentException if any of the two arguments are {@code null} or either string is empty.
      */
+    @SuppressWarnings( "UnusedDeclaration" )
     public static QualifiedName fromName( String type, String name )
     {
         return new QualifiedName( TypeName.nameOf( type ), name );
@@ -240,6 +241,7 @@ public final class QualifiedName
     }
 
     @Override
+    @SuppressWarnings( "NullableProblems" )
     public int compareTo( QualifiedName other )
     {
         final int result = typeName.compareTo( other.typeName );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/90f612e4/core/api/src/main/java/org/qi4j/api/common/TypeName.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/common/TypeName.java b/core/api/src/main/java/org/qi4j/api/common/TypeName.java
index c351b8a..b47a95c 100644
--- a/core/api/src/main/java/org/qi4j/api/common/TypeName.java
+++ b/core/api/src/main/java/org/qi4j/api/common/TypeName.java
@@ -56,6 +56,7 @@ public final class TypeName
         return name;
     }
 
+    @SuppressWarnings( "UnusedDeclaration" )
     public boolean isClass( final Class<?> type )
     {
         return type.getName().equals( name );
@@ -85,6 +86,7 @@ public final class TypeName
     }
 
     @Override
+    @SuppressWarnings( "NullableProblems" )
     public int compareTo( final TypeName typeName )
     {
         return this.name.compareTo( typeName.name );


[36/50] [abbrv] zest-qi4j git commit: Replaced Joda Time with Java 8 Time API.

Posted by ni...@apache.org.
http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/testsupport/src/main/java/org/qi4j/test/entity/AbstractEntityStoreTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/qi4j/test/entity/AbstractEntityStoreTest.java b/core/testsupport/src/main/java/org/qi4j/test/entity/AbstractEntityStoreTest.java
index 1917853..05d2229 100644
--- a/core/testsupport/src/main/java/org/qi4j/test/entity/AbstractEntityStoreTest.java
+++ b/core/testsupport/src/main/java/org/qi4j/test/entity/AbstractEntityStoreTest.java
@@ -21,13 +21,12 @@ package org.qi4j.test.entity;
 
 import java.math.BigDecimal;
 import java.math.BigInteger;
-import java.util.Date;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.ZonedDateTime;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import org.joda.time.DateTime;
-import org.joda.time.LocalDate;
-import org.joda.time.LocalDateTime;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -54,7 +53,6 @@ import org.qi4j.test.AbstractQi4jTest;
 
 import static org.hamcrest.CoreMatchers.equalTo;
 import static org.hamcrest.CoreMatchers.not;
-import static org.joda.time.DateTimeZone.UTC;
 import static org.junit.Assert.assertThat;
 import static org.junit.Assert.fail;
 
@@ -97,7 +95,7 @@ public abstract class AbstractEntityStoreTest
     {
         // Create entity
         EntityBuilder<TestEntity> builder = unitOfWork.newEntityBuilder( TestEntity.class );
-        builder.instance().dateValue().set( new Date() );
+        builder.instance().dateValue().set( LocalDate.now() );
         TestEntity instance = builder.newInstance();
 
         instance.name().set( "Test" );
@@ -108,10 +106,10 @@ public abstract class AbstractEntityStoreTest
         instance.booleanValue().set( Boolean.TRUE );
         instance.bigIntegerValue().set( new BigInteger( "42" ) );
         instance.bigDecimalValue().set( new BigDecimal( "42" ) );
-        instance.dateValue().set( new DateTime( "2020-03-04T13:24:35", UTC ).toDate() );
-        instance.dateTimeValue().set( new DateTime( "2020-03-04T13:24:35", UTC ) );
-        instance.localDateTimeValue().set( new LocalDateTime( "2020-03-04T13:23:00" ) );
-        instance.localDateValue().set( new LocalDate( "2020-03-04" ) );
+        instance.dateValue().set( LocalDate.parse( "2020-03-04" ));
+        instance.dateTimeValue().set( ZonedDateTime.parse( "2020-03-04T13:24:35Z" ) );
+        instance.localDateTimeValue().set( LocalDateTime.parse( "2020-03-04T13:23:00" ) );
+        instance.localDateValue().set( LocalDate.parse( "2020-03-04" ) );
         instance.association().set( instance );
 
         ValueBuilder<Tjabba> valueBuilder4 = module.newValueBuilder( Tjabba.class );
@@ -195,19 +193,19 @@ public abstract class AbstractEntityStoreTest
 
             assertThat( "property 'dateValue' has correct value",
                         instance.dateValue().get(),
-                        equalTo( new DateTime( "2020-03-04T13:24:35", UTC ).toDate() ) );
+                        equalTo( LocalDate.parse( "2020-03-04") ) );
 
             assertThat( "property 'dateTimeValue' has correct value",
                         instance.dateTimeValue().get(),
-                        equalTo( new DateTime( "2020-03-04T13:24:35", UTC ) ) );
+                        equalTo( ZonedDateTime.parse( "2020-03-04T13:24:35Z" ) ) );
 
             assertThat( "property 'localDateTimeValue' has correct value",
                         instance.localDateTimeValue().get(),
-                        equalTo( new LocalDateTime( "2020-03-04T13:23:00", UTC ) ) );
+                        equalTo( LocalDateTime.parse( "2020-03-04T13:23:00" ) ) );
 
             assertThat( "property 'localDateValue' has correct value",
                         instance.localDateValue().get(),
-                        equalTo( new LocalDate( "2020-03-04" ) ) );
+                        equalTo( LocalDate.parse( "2020-03-04" ) ) );
 
             assertThat( "property 'name' has correct value",
                         instance.name().get(),
@@ -481,10 +479,10 @@ public abstract class AbstractEntityStoreTest
         Property<BigDecimal> bigDecimalValue();
 
         @Optional
-        Property<Date> dateValue();
+        Property<LocalDate> dateValue();
 
         @Optional
-        Property<DateTime> dateTimeValue();
+        Property<ZonedDateTime> dateTimeValue();
 
         @Optional
         Property<LocalDateTime> localDateTimeValue();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractQueryTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractQueryTest.java b/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractQueryTest.java
index 38e36d8..00c4a21 100644
--- a/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractQueryTest.java
+++ b/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractQueryTest.java
@@ -22,11 +22,11 @@ package org.qi4j.test.indexing;
 import java.io.IOException;
 import java.math.BigDecimal;
 import java.math.BigInteger;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.ZonedDateTime;
 import java.util.HashMap;
 import java.util.Map;
-import org.joda.time.DateTime;
-import org.joda.time.LocalDate;
-import org.joda.time.LocalDateTime;
 import org.junit.Ignore;
 import org.junit.Test;
 import org.qi4j.api.query.NotQueryableException;
@@ -47,8 +47,6 @@ import org.qi4j.test.indexing.model.QueryParam;
 
 import static org.hamcrest.core.Is.is;
 import static org.hamcrest.core.IsEqual.equalTo;
-import static org.joda.time.DateTimeZone.UTC;
-import static org.joda.time.DateTimeZone.forID;
 import static org.junit.Assert.assertThat;
 import static org.qi4j.api.query.QueryExpressions.and;
 import static org.qi4j.api.query.QueryExpressions.contains;
@@ -569,7 +567,7 @@ public abstract class AbstractQueryTest
         QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
         Query<Person> query = unitOfWork.newQuery( qb.where(
-            eq( person.dateValue(), new DateTime( "2010-03-04T13:24:35", UTC ).toDate() ) ) );
+            eq( person.dateValue(), LocalDate.parse( "2010-03-04" ) ) ) );
         System.out.println( "*** script40_Date: " + query );
 
         verifyUnorderedResults( query, "Jack Doe" );
@@ -581,7 +579,7 @@ public abstract class AbstractQueryTest
         QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
         Query<Person> query = unitOfWork.newQuery( qb.where(
-            ne( person.dateValue(), new DateTime( "2010-03-04T13:24:35", UTC ).toDate() ) ) );
+            ne( person.dateValue(), LocalDate.parse( "2010-03-04" ) ) ) );
         System.out.println( "*** script41_Date: " + query );
 
         verifyUnorderedResults( query, "Joe Doe" );
@@ -593,7 +591,7 @@ public abstract class AbstractQueryTest
         QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
         Query<Person> query = unitOfWork.newQuery( qb.where(
-            ne( person.dateValue(), new DateTime( "2010-03-04T14:24:35", forID( "CET" ) ).toDate() ) ) );
+            ne( person.dateValue(), LocalDate.parse( "2010-03-04" ) ) ) );
         System.out.println( "*** script42_Date: " + query );
 
         verifyUnorderedResults( query, "Joe Doe" );
@@ -605,8 +603,8 @@ public abstract class AbstractQueryTest
         QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
         Query<Person> query = unitOfWork.newQuery( qb.where(
-            and( gt( person.dateValue(), new DateTime( "2005-03-04T13:24:35", UTC ).toDate() ),
-                 lt( person.dateValue(), new DateTime( "2015-03-04T13:24:35", UTC ).toDate() ) ) ) );
+            and( gt( person.dateValue(), LocalDate.parse( "2005-03-04" ) ),
+                 lt( person.dateValue(), LocalDate.parse( "2015-03-04" ) ) ) ) );
         System.out.println( "*** script43_Date: " + query );
 
         verifyUnorderedResults( query, "Jack Doe" );
@@ -618,7 +616,7 @@ public abstract class AbstractQueryTest
         QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
         Query<Person> query = unitOfWork.newQuery( qb.where(
-            eq( person.dateTimeValue(), new DateTime( "2010-03-04T13:24:35", UTC ) ) ) );
+            eq( person.dateTimeValue(), ZonedDateTime.parse( "2010-03-04T13:24:35Z" ) ) ) );
         System.out.println( "*** script40_DateTime: " + query );
 
         verifyUnorderedResults( query, "Jack Doe" );
@@ -630,7 +628,7 @@ public abstract class AbstractQueryTest
         QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
         Query<Person> query = unitOfWork.newQuery( qb.where(
-            ne( person.dateTimeValue(), new DateTime( "2010-03-04T13:24:35", UTC ) ) ) );
+            ne( person.dateTimeValue(), ZonedDateTime.parse( "2010-03-04T13:24:35Z" ) ) ) );
         System.out.println( "*** script41_DateTime: " + query );
 
         verifyUnorderedResults( query, "Joe Doe" );
@@ -642,7 +640,7 @@ public abstract class AbstractQueryTest
         QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
         Query<Person> query = unitOfWork.newQuery( qb.where(
-            ne( person.dateTimeValue(), new DateTime( "2010-03-04T14:24:35", forID( "CET" ) ) ) ) );
+            ne( person.dateTimeValue(), ZonedDateTime.parse( "2010-03-04T14:24:35+01:00" ) ) ) );
         System.out.println( "*** script42_DateTime: " + query );
 
         verifyUnorderedResults( query, "Jack Doe", "Joe Doe" );
@@ -654,8 +652,8 @@ public abstract class AbstractQueryTest
         QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
         Query<Person> query = unitOfWork.newQuery( qb.where(
-            and( gt( person.dateTimeValue(), new DateTime( "2005-03-04T13:24:35", UTC ) ),
-                 lt( person.dateTimeValue(), new DateTime( "2015-03-04T13:24:35", UTC ) ) ) ) );
+            and( gt( person.dateTimeValue(), ZonedDateTime.parse( "2005-03-04T13:24:35Z" ) ),
+                 lt( person.dateTimeValue(), ZonedDateTime.parse( "2015-03-04T13:24:35Z" ) ) ) ) );
         System.out.println( "*** script43_DateTime: " + query );
 
         verifyUnorderedResults( query, "Jack Doe" );
@@ -667,7 +665,7 @@ public abstract class AbstractQueryTest
         QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
         Query<Person> query = unitOfWork.newQuery( qb.where(
-            eq( person.localDateTimeValue(), new LocalDateTime( "2010-03-04T13:23:00", UTC ) ) ) );
+            eq( person.localDateTimeValue(), LocalDateTime.parse( "2010-03-04T13:23:00" ) ) ) );
         System.out.println( "*** script40_LocalDateTime: " + query );
 
         verifyUnorderedResults( query, "Jack Doe" );
@@ -679,7 +677,7 @@ public abstract class AbstractQueryTest
         QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
         Query<Person> query = unitOfWork.newQuery( qb.where(
-            ne( person.localDateTimeValue(), new LocalDateTime( "2010-03-04T13:23:00", UTC ) ) ) );
+            ne( person.localDateTimeValue(), LocalDateTime.parse( "2010-03-04T13:23:00" ) ) ) );
         System.out.println( "*** script41_LocalDateTime: " + query );
 
         verifyUnorderedResults( query, "Joe Doe" );
@@ -691,7 +689,7 @@ public abstract class AbstractQueryTest
         QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
         Query<Person> query = unitOfWork.newQuery( qb.where(
-            ne( person.localDateTimeValue(), new LocalDateTime( "2010-03-04T13:23:00", forID( "CET" ) ) ) ) );
+            ne( person.localDateTimeValue(), LocalDateTime.parse( "2010-03-04T13:23:00" ) ) ) );
         System.out.println( "*** script42_LocalDateTime: " + query );
 
         verifyUnorderedResults( query, "Joe Doe" );
@@ -703,8 +701,8 @@ public abstract class AbstractQueryTest
         QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
         Query<Person> query = unitOfWork.newQuery( qb.where(
-            and( gt( person.localDateTimeValue(), new LocalDateTime( "2005-03-04T13:24:35", UTC ) ),
-                 lt( person.localDateTimeValue(), new LocalDateTime( "2015-03-04T13:24:35", UTC ) ) ) ) );
+            and( gt( person.localDateTimeValue(), LocalDateTime.parse( "2005-03-04T13:24:35" ) ),
+                 lt( person.localDateTimeValue(), LocalDateTime.parse( "2015-03-04T13:24:35" ) ) ) ) );
         System.out.println( "*** script43_LocalDateTime: " + query );
 
         verifyUnorderedResults( query, "Jack Doe" );
@@ -716,7 +714,7 @@ public abstract class AbstractQueryTest
         QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
         Query<Person> query = unitOfWork.newQuery( qb.where(
-            eq( person.localDateValue(), new LocalDate( "2010-03-04", UTC ) ) ) );
+            eq( person.localDateValue(), LocalDate.parse( "2010-03-04" ) ) ) );
         System.out.println( "*** script40_LocalDate: " + query );
 
         verifyUnorderedResults( query, "Jack Doe" );
@@ -728,7 +726,7 @@ public abstract class AbstractQueryTest
         QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
         Query<Person> query = unitOfWork.newQuery( qb.where(
-            ne( person.localDateValue(), new LocalDate( "2010-03-04", UTC ) ) ) );
+            ne( person.localDateValue(), LocalDate.parse( "2010-03-04" ) ) ) );
         System.out.println( "*** script41_LocalDate: " + query );
 
         verifyUnorderedResults( query, "Joe Doe" );
@@ -740,7 +738,7 @@ public abstract class AbstractQueryTest
         QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
         Query<Person> query = unitOfWork.newQuery( qb.where(
-            ne( person.localDateValue(), new LocalDate( "2010-03-04", forID( "CET" ) ) ) ) );
+            ne( person.localDateValue(), LocalDate.parse( "2010-03-04" ) ) ) );
         System.out.println( "*** script42_LocalDate: " + query );
 
         verifyUnorderedResults( query, "Joe Doe" );
@@ -752,8 +750,8 @@ public abstract class AbstractQueryTest
         QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
         Query<Person> query = unitOfWork.newQuery( qb.where(
-            and( gt( person.localDateValue(), new LocalDate( "2005-03-04", UTC ) ),
-                 lt( person.localDateValue(), new LocalDate( "2015-03-04", UTC ) ) ) ) );
+            and( gt( person.localDateValue(), LocalDate.parse( "2005-03-04" ) ),
+                 lt( person.localDateValue(), LocalDate.parse( "2015-03-04" ) ) ) ) );
         System.out.println( "*** script43_LocalDate: " + query );
 
         verifyUnorderedResults( query, "Jack Doe" );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/testsupport/src/main/java/org/qi4j/test/indexing/TestData.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/qi4j/test/indexing/TestData.java b/core/testsupport/src/main/java/org/qi4j/test/indexing/TestData.java
index 72dfe88..491d847 100644
--- a/core/testsupport/src/main/java/org/qi4j/test/indexing/TestData.java
+++ b/core/testsupport/src/main/java/org/qi4j/test/indexing/TestData.java
@@ -20,12 +20,12 @@ package org.qi4j.test.indexing;
 
 import java.math.BigDecimal;
 import java.math.BigInteger;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.ZonedDateTime;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
-import org.joda.time.DateTime;
-import org.joda.time.LocalDate;
-import org.joda.time.LocalDateTime;
 import org.qi4j.api.entity.EntityBuilder;
 import org.qi4j.api.structure.Module;
 import org.qi4j.api.unitofwork.UnitOfWork;
@@ -46,8 +46,6 @@ import org.qi4j.test.indexing.model.entities.CatEntity;
 import org.qi4j.test.indexing.model.entities.FemaleEntity;
 import org.qi4j.test.indexing.model.entities.MaleEntity;
 
-import static org.joda.time.DateTimeZone.UTC;
-
 /**
  * Utility class to populate Index/Query tests data.
  */
@@ -179,10 +177,10 @@ class TestData
                 joeDoe.address().set( address );
                 joeDoe.bigInteger().set( new BigInteger( "23232323232323232323232323" ) );
                 joeDoe.bigDecimal().set( new BigDecimal( "23.4276931348623157e+309" ) );
-                joeDoe.dateValue().set( new DateTime( "2020-03-04T13:24:35", UTC ).toDate() );
-                joeDoe.dateTimeValue().set( new DateTime( "2020-03-04T13:24:35", UTC ) );
-                joeDoe.localDateTimeValue().set( new LocalDateTime( "2020-03-04T13:23:00" ) );
-                joeDoe.localDateValue().set( new LocalDate( "2020-03-04" ) );
+                joeDoe.dateValue().set( LocalDate.parse( "2020-03-04" ));
+                joeDoe.dateTimeValue().set( ZonedDateTime.parse( "2020-03-04T13:24:35Z" ) );
+                joeDoe.localDateTimeValue().set( LocalDateTime.parse( "2020-03-04T13:23:00" ) );
+                joeDoe.localDateValue().set( LocalDate.parse( "2020-03-04" ) );
                 NameableAssert.trace( joeDoe );
             }
 
@@ -204,10 +202,10 @@ class TestData
                 jackDoe.address().set( address );
                 jackDoe.bigInteger().set( new BigInteger( "42424242424242424242424242" ) );
                 jackDoe.bigDecimal().set( new BigDecimal( "42.2376931348623157e+309" ) );
-                jackDoe.dateValue().set( new DateTime( "2010-03-04T13:24:35", UTC ).toDate() );
-                jackDoe.dateTimeValue().set( new DateTime( "2010-03-04T13:24:35", UTC ) );
-                jackDoe.localDateTimeValue().set( new LocalDateTime( "2010-03-04T13:23:00" ) );
-                jackDoe.localDateValue().set( new LocalDate( "2010-03-04" ) );
+                jackDoe.dateValue().set( LocalDate.parse( "2010-03-04" ) );
+                jackDoe.dateTimeValue().set( ZonedDateTime.parse( "2010-03-04T13:24:35Z" ) );
+                jackDoe.localDateTimeValue().set( LocalDateTime.parse( "2010-03-04T13:23:00" ) );
+                jackDoe.localDateValue().set( LocalDate.parse( "2010-03-04" ) );
 
                 ValueBuilder<URL> urlBuilder = module.newValueBuilder( URL.class );
                 ValueBuilder<Protocol> protocolBuilder = module.newValueBuilder( Protocol.class );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/testsupport/src/main/java/org/qi4j/test/indexing/model/Person.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/qi4j/test/indexing/model/Person.java b/core/testsupport/src/main/java/org/qi4j/test/indexing/model/Person.java
index 1b1819a..b6b947a 100644
--- a/core/testsupport/src/main/java/org/qi4j/test/indexing/model/Person.java
+++ b/core/testsupport/src/main/java/org/qi4j/test/indexing/model/Person.java
@@ -20,12 +20,10 @@ package org.qi4j.test.indexing.model;
 
 import java.math.BigDecimal;
 import java.math.BigInteger;
-import java.util.Date;
-import java.util.List;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.ZonedDateTime;
 import java.util.Map;
-import org.joda.time.DateTime;
-import org.joda.time.LocalDate;
-import org.joda.time.LocalDateTime;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.association.ManyAssociation;
 import org.qi4j.api.association.NamedAssociation;
@@ -86,10 +84,10 @@ public interface Person
     Property<BigDecimal> bigDecimal();
 
     @Optional
-    Property<Date> dateValue();
+    Property<LocalDate> dateValue();
 
     @Optional
-    Property<DateTime> dateTimeValue();
+    Property<ZonedDateTime> dateTimeValue();
 
     @Optional
     Property<LocalDateTime> localDateTimeValue();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/testsupport/src/main/java/org/qi4j/test/value/AbstractJsonDateFormatTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/qi4j/test/value/AbstractJsonDateFormatTest.java b/core/testsupport/src/main/java/org/qi4j/test/value/AbstractJsonDateFormatTest.java
index 712691e..778cff9 100644
--- a/core/testsupport/src/main/java/org/qi4j/test/value/AbstractJsonDateFormatTest.java
+++ b/core/testsupport/src/main/java/org/qi4j/test/value/AbstractJsonDateFormatTest.java
@@ -17,16 +17,16 @@
  */
 package org.qi4j.test.value;
 
-import java.util.Date;
+import java.time.Instant;
+import java.time.ZonedDateTime;
 import java.util.List;
-import org.joda.time.DateTime;
-import org.joda.time.DateTimeZone;
 import org.junit.Before;
 import org.junit.Test;
 import org.qi4j.api.injection.scope.Service;
 import org.qi4j.api.type.CollectionType;
 import org.qi4j.api.type.ValueType;
 import org.qi4j.api.value.ValueDeserializer;
+import org.qi4j.api.value.ValueSerializationException;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ModuleAssembly;
 import org.qi4j.test.AbstractQi4jTest;
@@ -41,7 +41,7 @@ public class AbstractJsonDateFormatTest
     extends AbstractQi4jTest
 {
 
-    private final ValueType dateType = new ValueType( Date.class );
+    private final ValueType dateType = new ValueType( ZonedDateTime.class );
 
     @Override
     public void assemble( ModuleAssembly module )
@@ -62,27 +62,25 @@ public class AbstractJsonDateFormatTest
         throws Exception
     {
         CollectionType collectionType = new CollectionType( List.class, dateType );
-        List<Date> value = valueDeserializer.deserialize( collectionType, "[\"2009-08-12T14:54:27.895+0800\"]" );
-        assertEquals( new DateTime( "2009-08-12T06:54:27.895Z", DateTimeZone.UTC ).toDate(), value.get( 0 ) );
+        List<ZonedDateTime> value = valueDeserializer.deserialize( collectionType, "[\"2009-08-12T14:54:27.895+08:00\"]" );
+        assertEquals( ZonedDateTime.parse( "2009-08-12T06:54:27.895Z" ).toInstant(), value.get( 0 ).toInstant() );
     }
 
-    @Test
+    @Test( expected = ValueSerializationException.class)
     public void givenAtDateFormatWhenConvertingFromSerializedStateExpectValidDate()
         throws Exception
     {
-        long tstamp = System.currentTimeMillis();
+        Instant tstamp = Instant.now();
         CollectionType collectionType = new CollectionType( List.class, dateType );
-        List<Date> value = valueDeserializer.deserialize( collectionType, "[\"@" + tstamp + "@\"]" );
-        assertEquals( new Date( tstamp ), value.get( 0 ) );
+        List<Instant> value = valueDeserializer.deserialize( collectionType, "[\"@" + tstamp + "@\"]" );
     }
 
-    @Test
+    @Test( expected = ValueSerializationException.class)
     public void givenMicrosoftDateFormatWhenConvertingFromSerializedStateExpectValidDate()
         throws Exception
     {
-        long tstamp = System.currentTimeMillis();
+        Instant tstamp = Instant.now();
         CollectionType collectionType = new CollectionType( List.class, dateType );
-        List<Date> value = valueDeserializer.deserialize( collectionType, "[\"/Date(" + tstamp + ")/\"]" );
-        assertEquals( new Date( tstamp ), value.get( 0 ) );
+        List<Instant> value = valueDeserializer.deserialize( collectionType, "[\"/Date(" + tstamp + ")/\"]" );
     }
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/testsupport/src/main/java/org/qi4j/test/value/AbstractPlainValueSerializationTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/qi4j/test/value/AbstractPlainValueSerializationTest.java b/core/testsupport/src/main/java/org/qi4j/test/value/AbstractPlainValueSerializationTest.java
index a99b1f2..cecf22f 100644
--- a/core/testsupport/src/main/java/org/qi4j/test/value/AbstractPlainValueSerializationTest.java
+++ b/core/testsupport/src/main/java/org/qi4j/test/value/AbstractPlainValueSerializationTest.java
@@ -18,10 +18,10 @@ package org.qi4j.test.value;
 
 import java.math.BigDecimal;
 import java.math.BigInteger;
-import java.util.Date;
-import org.joda.time.DateTime;
-import org.joda.time.LocalDate;
-import org.joda.time.LocalDateTime;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.OffsetDateTime;
+import java.time.ZonedDateTime;
 import org.junit.Before;
 import org.junit.Test;
 import org.qi4j.api.entity.EntityReference;
@@ -31,9 +31,6 @@ import org.qi4j.test.AbstractQi4jTest;
 
 import static org.hamcrest.core.IsEqual.equalTo;
 import static org.hamcrest.core.IsNot.not;
-import static org.joda.time.DateTimeZone.UTC;
-import static org.joda.time.DateTimeZone.forID;
-import static org.joda.time.DateTimeZone.forOffsetHours;
 import static org.junit.Assert.assertThat;
 
 /**
@@ -179,42 +176,46 @@ public abstract class AbstractPlainValueSerializationTest
     @Test
     public void givenDateValueWhenSerializingAndDeserializingExpectEquals()
     {
-        String serialized = valueSerialization.serialize( new DateTime( "2020-03-04T13:24:35", forID( "CET" ) ).toDate() );
-        assertThat( serialized, equalTo( "2020-03-04T12:24:35.000Z" ) );
+        ZonedDateTime refTime = ZonedDateTime.parse( "2020-03-04T13:24:35Z" );
+        String serialized = valueSerialization.serialize( refTime );
+        assertThat( serialized, equalTo( "2020-03-04T13:24:35Z" ) );
 
-        Date deserialized = valueSerialization.deserialize( Date.class, serialized );
-        assertThat( deserialized, equalTo( new DateTime( "2020-03-04T13:24:35", forID( "CET" ) ).toDate() ) );
-        assertThat( deserialized, equalTo( new DateTime( "2020-03-04T12:24:35", UTC ).toDate() ) );
+        ZonedDateTime deserialized = valueSerialization.deserialize( ZonedDateTime.class, serialized );
+        assertThat( deserialized, equalTo( refTime ) );
+        assertThat( deserialized, equalTo( refTime ) );
     }
 
     @Test
     public void givenDateTimeValueWhenSerializingAndDeserializingExpectEquals()
     {
-        String serialized = valueSerialization.serialize( new DateTime( "2020-03-04T13:24:35", forOffsetHours( 1 ) ) );
-        assertThat( serialized, equalTo( "2020-03-04T13:24:35.000+01:00" ) );
-        DateTime deserialized = valueSerialization.deserialize( DateTime.class, serialized );
-        assertThat( deserialized, equalTo( new DateTime( "2020-03-04T13:24:35", forOffsetHours( 1 ) ) ) );
+        OffsetDateTime refTime = OffsetDateTime.parse( "2020-03-04T13:24:35+08:00" );
+        String serialized = valueSerialization.serialize( refTime );
+        assertThat( serialized, equalTo( "2020-03-04T13:24:35+08:00" ) );
+        OffsetDateTime deserialized = valueSerialization.deserialize( OffsetDateTime.class, serialized );
+        assertThat( deserialized, equalTo( refTime ));
     }
 
     @Test
     public void givenLocalDateTimeValueWhenSerializingAndDeserializingExpectEquals()
     {
         // Serialized without TimeZone
-        String serialized = valueSerialization.serialize( new LocalDateTime( "2020-03-04T13:23:00", forID( "CET" ) ) );
-        assertThat( serialized, equalTo( "2020-03-04T13:23:00.000" ) );
+        LocalDateTime refTime = LocalDateTime.parse( "2020-03-04T13:23:10" );
+        String serialized = valueSerialization.serialize( refTime );
+        assertThat( serialized, equalTo( "2020-03-04T13:23:10" ) );
 
         LocalDateTime deserialized = valueSerialization.deserialize( LocalDateTime.class, serialized );
-        assertThat( deserialized, equalTo( new LocalDateTime( "2020-03-04T13:23:00", UTC ) ) );
+        assertThat( deserialized, equalTo( refTime ) );
     }
 
     @Test
     public void givenLocalDateValueWhenSerializingAndDeserializingExpectEquals()
     {
-        String serialized = valueSerialization.serialize( new LocalDate( "2020-03-04" ) );
+        LocalDate refTime = LocalDate.parse( "2020-03-04" );
+        String serialized = valueSerialization.serialize( refTime );
         assertThat( serialized, equalTo( "2020-03-04" ) );
 
         LocalDate deserialized = valueSerialization.deserialize( LocalDate.class, serialized );
-        assertThat( deserialized, equalTo( new LocalDate( "2020-03-04" ) ) );
+        assertThat( deserialized, equalTo( refTime ) );
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/core/testsupport/src/main/java/org/qi4j/test/value/AbstractValueCompositeSerializationTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/qi4j/test/value/AbstractValueCompositeSerializationTest.java b/core/testsupport/src/main/java/org/qi4j/test/value/AbstractValueCompositeSerializationTest.java
index 933503c..af483ad 100644
--- a/core/testsupport/src/main/java/org/qi4j/test/value/AbstractValueCompositeSerializationTest.java
+++ b/core/testsupport/src/main/java/org/qi4j/test/value/AbstractValueCompositeSerializationTest.java
@@ -19,13 +19,13 @@ package org.qi4j.test.value;
 
 import java.io.ByteArrayOutputStream;
 import java.io.Serializable;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.OffsetDateTime;
+import java.time.ZonedDateTime;
 import java.util.ArrayList;
-import java.util.Date;
 import java.util.List;
 import java.util.Map;
-import org.joda.time.DateTime;
-import org.joda.time.LocalDate;
-import org.joda.time.LocalDateTime;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
@@ -164,10 +164,10 @@ public abstract class AbstractValueCompositeSerializationTest
         proto.string().set( "Foo\"Bar\"\nTest\t" );
         proto.string2().set( "/Foo/bar" );
         proto.number().set( 42L );
-        proto.date().set( new Date() );
-        proto.dateTime().set( new DateTime() );
-        proto.localDate().set( new LocalDate() );
-        proto.localDateTime().set( new LocalDateTime() );
+        proto.date().set( OffsetDateTime.now() );
+        proto.dateTime().set( ZonedDateTime.now());
+        proto.localDate().set( LocalDate.now() );
+        proto.localDateTime().set( LocalDateTime.now() );
         proto.entityReference().set( EntityReference.parseEntityReference( "12345" ) );
         proto.stringIntMap().get().put( "foo", 42 );
 
@@ -239,9 +239,9 @@ public abstract class AbstractValueCompositeSerializationTest
         @UseDefaults
         Property<Long> number();
 
-        Property<Date> date();
+        Property<OffsetDateTime> date();
 
-        Property<DateTime> dateTime();
+        Property<ZonedDateTime> dateTime();
 
         Property<LocalDate> localDate();
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityState.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityState.java b/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityState.java
index 0848a54..da4399f 100644
--- a/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityState.java
+++ b/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityState.java
@@ -21,6 +21,7 @@ package org.qi4j.entitystore.gae;
 import com.google.appengine.api.datastore.Entity;
 import com.google.appengine.api.datastore.Key;
 import com.google.appengine.api.datastore.Text;
+import java.time.Instant;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -60,7 +61,8 @@ public class GaeEntityState
                            ValueSerialization valueSerialization,
                            Key key,
                            EntityDescriptor descriptor,
-                           Module module )
+                           Module module
+    )
     {
         System.out.println( "GaeEntityState( " + unitOfWork + ", " + key + ", " + descriptor + " )" );
         this.module = module;
@@ -84,7 +86,8 @@ public class GaeEntityState
     public GaeEntityState( GaeEntityStoreUnitOfWork unitOfWork,
                            ValueSerialization valueSerialization,
                            Entity entity,
-                           Module module )
+                           Module module
+    )
     {
         System.out.println( "GaeEntityState( " + unitOfWork + ", " + entity + " )" );
         if( entity == null )
@@ -143,9 +146,9 @@ public class GaeEntityState
     }
 
     @Override
-    public long lastModified()
+    public Instant lastModified()
     {
-        Long lastModified = (Long) entity.getProperty( "$lastModified" );
+        Instant lastModified = Instant.ofEpochMilli( (Long) entity.getProperty( "$lastModified" ) );
         System.out.println( "lastModified()  -->  " + lastModified );
         return lastModified;
     }
@@ -438,7 +441,6 @@ public class GaeEntityState
         {
             return toList( assocs.keySet() ).iterator();
         }
-
     }
 
     private void markUpdated()

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreMixin.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreMixin.java b/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreMixin.java
index e4b591d..fbc8848 100644
--- a/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreMixin.java
+++ b/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreMixin.java
@@ -17,6 +17,7 @@
 package org.qi4j.entitystore.gae;
 
 import com.google.appengine.api.datastore.*;
+import java.time.Instant;
 import org.qi4j.api.entity.Identity;
 import org.qi4j.api.entity.IdentityGenerator;
 import org.qi4j.api.injection.scope.Service;
@@ -61,7 +62,7 @@ public class GaeEntityStoreMixin
    }
 
     @Override
-   public EntityStoreUnitOfWork newUnitOfWork( Usecase usecase, Module module, long currentTime )
+   public EntityStoreUnitOfWork newUnitOfWork( Usecase usecase, Module module, Instant currentTime )
    {
        return new GaeEntityStoreUnitOfWork( datastoreService, valueSerialization, generateId(), module, currentTime );
    }
@@ -76,7 +77,7 @@ public class GaeEntityStoreMixin
          {
             final GaeEntityStoreUnitOfWork euow = new GaeEntityStoreUnitOfWork( datastoreService, valueSerialization,
                                                                                 generateId(), module,
-                                                                                System.currentTimeMillis() );
+                                                                                Instant.now() );
             Query query = new Query();
             PreparedQuery q = datastoreService.prepare(query);
             final QueryResultIterable<Entity> iterable = q.asQueryResultIterable();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreUnitOfWork.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreUnitOfWork.java b/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreUnitOfWork.java
index e32786d..fad9462 100644
--- a/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreUnitOfWork.java
+++ b/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreUnitOfWork.java
@@ -19,6 +19,7 @@
 package org.qi4j.entitystore.gae;
 
 import com.google.appengine.api.datastore.*;
+import java.time.Instant;
 import java.util.LinkedList;
 import org.qi4j.api.entity.EntityDescriptor;
 import org.qi4j.api.entity.EntityReference;
@@ -38,14 +39,14 @@ public class GaeEntityStoreUnitOfWork
     private final ValueSerialization valueSerialization;
     private final String identity;
     private final Module module;
-    private final long currentTime;
+    private final Instant currentTime;
     private final LinkedList<GaeEntityState> states;
 
     public GaeEntityStoreUnitOfWork( DatastoreService datastore,
                                      ValueSerialization valueSerialization,
                                      String identity,
                                      Module module,
-                                     long currentTime )
+                                     Instant currentTime )
     {
         this.datastore = datastore;
         this.valueSerialization = valueSerialization;
@@ -62,7 +63,7 @@ public class GaeEntityStoreUnitOfWork
     }
 
     @Override
-    public long currentTime()
+    public Instant currentTime()
     {
         return currentTime;
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/entitystore-neo4j/src/main/java/org/qi4j/entitystore/neo4j/NeoEntityState.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-neo4j/src/main/java/org/qi4j/entitystore/neo4j/NeoEntityState.java b/extensions/entitystore-neo4j/src/main/java/org/qi4j/entitystore/neo4j/NeoEntityState.java
index 340f52f..15cccbe 100644
--- a/extensions/entitystore-neo4j/src/main/java/org/qi4j/entitystore/neo4j/NeoEntityState.java
+++ b/extensions/entitystore-neo4j/src/main/java/org/qi4j/entitystore/neo4j/NeoEntityState.java
@@ -1,5 +1,6 @@
 package org.qi4j.entitystore.neo4j;
 
+import java.time.Instant;
 import org.neo4j.graphdb.Direction;
 import org.neo4j.graphdb.DynamicRelationshipType;
 import org.neo4j.graphdb.Node;
@@ -32,7 +33,8 @@ public class NeoEntityState
     private EntityStatus status;
 
     NeoEntityState( ValueSerialization valueSerialization, NeoEntityStoreUnitOfWork work, Node node,
-                    EntityStatus status )
+                    EntityStatus status
+    )
     {
         this.valueSerialization = valueSerialization;
         this.uow = work;
@@ -47,7 +49,7 @@ public class NeoEntityState
             status = EntityStatus.UPDATED;
             Long version = (Long) underlyingNode.getProperty( VERSION );
             underlyingNode.setProperty( VERSION, version + 1 );
-            underlyingNode.setProperty( MODIFIED, uow.currentTime() );
+            underlyingNode.setProperty( MODIFIED, uow.currentTime().toEpochMilli() );
         }
     }
 
@@ -80,7 +82,7 @@ public class NeoEntityState
         underlyingNode.createRelationshipTo( node, namedAssociation );
         return new NeoNamedAssociationState( uow, this, node );
     }
-    
+
     @Override
     public ManyAssociationState manyAssociationValueOf( QualifiedName stateName )
     {
@@ -140,7 +142,8 @@ public class NeoEntityState
     {
         try
         {
-            PropertyDescriptor persistentProperty = entityDescriptor().state().findPropertyModelByQualifiedName( stateName );
+            PropertyDescriptor persistentProperty = entityDescriptor().state()
+                .findPropertyModelByQualifiedName( stateName );
             Object prop = underlyingNode.getProperty( "prop::" + stateName.toString(), null );
             if( prop == null )
             {
@@ -168,7 +171,8 @@ public class NeoEntityState
         {
             if( prop != null )
             {
-                PropertyDescriptor persistentProperty = entityDescriptor().state().findPropertyModelByQualifiedName( stateName );
+                PropertyDescriptor persistentProperty = entityDescriptor().state()
+                    .findPropertyModelByQualifiedName( stateName );
                 if( ValueType.isPrimitiveValueType( persistentProperty.valueType() ) )
                 {
                     underlyingNode.setProperty( "prop::" + stateName.toString(), prop );
@@ -263,10 +267,9 @@ public class NeoEntityState
     }
 
     @Override
-    public long lastModified()
+    public Instant lastModified()
     {
-        long modified = (Long) underlyingNode.getProperty( MODIFIED );
-        return modified;
+        return Instant.ofEpochMilli( (Long) underlyingNode.getProperty( MODIFIED ) );
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/entitystore-neo4j/src/main/java/org/qi4j/entitystore/neo4j/NeoEntityStoreMixin.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-neo4j/src/main/java/org/qi4j/entitystore/neo4j/NeoEntityStoreMixin.java b/extensions/entitystore-neo4j/src/main/java/org/qi4j/entitystore/neo4j/NeoEntityStoreMixin.java
index dd04f3a..412985e 100644
--- a/extensions/entitystore-neo4j/src/main/java/org/qi4j/entitystore/neo4j/NeoEntityStoreMixin.java
+++ b/extensions/entitystore-neo4j/src/main/java/org/qi4j/entitystore/neo4j/NeoEntityStoreMixin.java
@@ -1,6 +1,7 @@
 package org.qi4j.entitystore.neo4j;
 
 import java.io.File;
+import java.time.Instant;
 import java.util.UUID;
 import java.util.concurrent.atomic.AtomicInteger;
 import org.neo4j.graphdb.Direction;
@@ -74,7 +75,7 @@ public class NeoEntityStoreMixin
    }
 
     @Override
-   public EntityStoreUnitOfWork newUnitOfWork( Usecase usecase, Module module, long currentTime )
+   public EntityStoreUnitOfWork newUnitOfWork( Usecase usecase, Module module, Instant currentTime )
    {
       return new NeoEntityStoreUnitOfWork(neo, indexService, valueSerialization, newUnitOfWorkId(), module, currentTime);
    }
@@ -92,7 +93,7 @@ public class NeoEntityStoreMixin
                @Override
                public <ReceiverThrowableType extends Throwable> void sendTo(Receiver<? super EntityState, ReceiverThrowableType> receiver) throws ReceiverThrowableType, EntityStoreException
                {
-                  NeoEntityStoreUnitOfWork uow = new NeoEntityStoreUnitOfWork(neo, indexService, valueSerialization, newUnitOfWorkId(), module, System.currentTimeMillis());
+                  NeoEntityStoreUnitOfWork uow = new NeoEntityStoreUnitOfWork(neo, indexService, valueSerialization, newUnitOfWorkId(), module, Instant.now());
 
                   try
                   {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/entitystore-neo4j/src/main/java/org/qi4j/entitystore/neo4j/NeoEntityStoreUnitOfWork.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-neo4j/src/main/java/org/qi4j/entitystore/neo4j/NeoEntityStoreUnitOfWork.java b/extensions/entitystore-neo4j/src/main/java/org/qi4j/entitystore/neo4j/NeoEntityStoreUnitOfWork.java
index b372355..ad89d14 100644
--- a/extensions/entitystore-neo4j/src/main/java/org/qi4j/entitystore/neo4j/NeoEntityStoreUnitOfWork.java
+++ b/extensions/entitystore-neo4j/src/main/java/org/qi4j/entitystore/neo4j/NeoEntityStoreUnitOfWork.java
@@ -1,5 +1,6 @@
 package org.qi4j.entitystore.neo4j;
 
+import java.time.Instant;
 import javax.transaction.Transaction;
 import javax.transaction.TransactionManager;
 import org.neo4j.graphdb.Node;
@@ -25,7 +26,7 @@ public class NeoEntityStoreUnitOfWork
     private final EmbeddedGraphDatabase neo;
     private final IndexService indexService;
     private final ValueSerialization valueSerialization;
-    private long currentTime;
+    private Instant currentTime;
     private final TransactionManager tm;
 
     private final Transaction transaction;
@@ -34,7 +35,7 @@ public class NeoEntityStoreUnitOfWork
 
     NeoEntityStoreUnitOfWork( EmbeddedGraphDatabase neo, IndexService indexService, ValueSerialization valueSerialization,
                               String identity, Module module,
-                              long currentTime )
+                              Instant currentTime )
     {
         this.neo = neo;
         this.indexService = indexService;
@@ -54,7 +55,7 @@ public class NeoEntityStoreUnitOfWork
     }
 
     @Override
-    public long currentTime()
+    public Instant currentTime()
     {
         return currentTime;
     }
@@ -104,7 +105,7 @@ public class NeoEntityStoreUnitOfWork
         }
         node = neo.createNode();
         node.setProperty( NeoEntityState.VERSION, 0l );
-        node.setProperty( NeoEntityState.MODIFIED, currentTime );
+        node.setProperty( NeoEntityState.MODIFIED, currentTime.toEpochMilli() );
         node.createRelationshipTo( typeNode, RelTypes.IS_OF_TYPE );
         node.setProperty( NeoEntityState.ENTITY_ID, anIdentity.identity() );
         indexService.index( node, ENTITY_STATE_ID, anIdentity.identity() );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/entitystore-neo4j/src/test/java/org/qi4j/entitystore/neo4j/test/SimpleNeoStoreTest.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-neo4j/src/test/java/org/qi4j/entitystore/neo4j/test/SimpleNeoStoreTest.java b/extensions/entitystore-neo4j/src/test/java/org/qi4j/entitystore/neo4j/test/SimpleNeoStoreTest.java
index f7841e3..a14a8a7 100644
--- a/extensions/entitystore-neo4j/src/test/java/org/qi4j/entitystore/neo4j/test/SimpleNeoStoreTest.java
+++ b/extensions/entitystore-neo4j/src/test/java/org/qi4j/entitystore/neo4j/test/SimpleNeoStoreTest.java
@@ -30,8 +30,4 @@ public class SimpleNeoStoreTest
         new OrgJsonValueSerializationAssembler().assemble( module );
     }
 
-    @Override
-    public void givenConcurrentUnitOfWorksWhenUoWCompletesThenCheckConcurrentModification()
-    {
-    }
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/entitystore-preferences/src/main/java/org/qi4j/entitystore/prefs/PreferencesEntityStoreMixin.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-preferences/src/main/java/org/qi4j/entitystore/prefs/PreferencesEntityStoreMixin.java b/extensions/entitystore-preferences/src/main/java/org/qi4j/entitystore/prefs/PreferencesEntityStoreMixin.java
index ed48871..afc0a66 100644
--- a/extensions/entitystore-preferences/src/main/java/org/qi4j/entitystore/prefs/PreferencesEntityStoreMixin.java
+++ b/extensions/entitystore-preferences/src/main/java/org/qi4j/entitystore/prefs/PreferencesEntityStoreMixin.java
@@ -19,6 +19,7 @@
  */
 package org.qi4j.entitystore.prefs;
 
+import java.time.Instant;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
@@ -167,7 +168,7 @@ public class PreferencesEntityStoreMixin
     }
 
     @Override
-    public EntityStoreUnitOfWork newUnitOfWork( Usecase usecase, Module module, long currentTime )
+    public EntityStoreUnitOfWork newUnitOfWork( Usecase usecase, Module module, Instant currentTime )
     {
         return new DefaultEntityStoreUnitOfWork( entityStoreSpi, newUnitOfWorkId(), module, usecase, currentTime );
     }
@@ -194,7 +195,7 @@ public class PreferencesEntityStoreMixin
                             newUnitOfWorkId(),
                             module,
                             visitUsecase,
-                            System.currentTimeMillis() );
+                            Instant.now() );
                         try
                         {
                             String[] identities = root.childrenNames();
@@ -434,7 +435,7 @@ public class PreferencesEntityStoreMixin
 
             return new DefaultEntityState( desuw,
                                            entityPrefs.get( "version", "" ),
-                                           entityPrefs.getLong( "modified", unitOfWork.currentTime() ),
+                                           Instant.ofEpochMilli( entityPrefs.getLong( "modified", unitOfWork.currentTime().toEpochMilli() ) ),
                                            identity,
                                            status,
                                            entityDescriptor,
@@ -499,7 +500,7 @@ public class PreferencesEntityStoreMixin
     protected void writeEntityState( DefaultEntityState state,
                                      Preferences entityPrefs,
                                      String identity,
-                                     long lastModified
+                                     Instant lastModified
     )
         throws EntityStoreException
     {
@@ -508,7 +509,7 @@ public class PreferencesEntityStoreMixin
             // Store into Preferences API
             entityPrefs.put( "type", first( state.entityDescriptor().types() ).getName() );
             entityPrefs.put( "version", identity );
-            entityPrefs.putLong( "modified", lastModified );
+            entityPrefs.putLong( "modified", lastModified.toEpochMilli() );
 
             // Properties
             Preferences propsPrefs = entityPrefs.node( "properties" );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/SQLEntityStoreMixin.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/SQLEntityStoreMixin.java b/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/SQLEntityStoreMixin.java
index 8ba2aac..36ffb3d 100644
--- a/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/SQLEntityStoreMixin.java
+++ b/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/SQLEntityStoreMixin.java
@@ -23,6 +23,7 @@ import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
+import java.time.Instant;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
@@ -248,7 +249,7 @@ public class SQLEntityStoreMixin
     }
 
     @Override
-    public EntityStoreUnitOfWork newUnitOfWork( Usecase usecase, Module module, long currentTime )
+    public EntityStoreUnitOfWork newUnitOfWork( Usecase usecase, Module module, Instant currentTime )
     {
         return new DefaultEntityStoreUnitOfWork( entityStoreSPI, newUnitOfWorkId(), module, usecase, currentTime );
     }
@@ -300,7 +301,7 @@ public class SQLEntityStoreMixin
         Usecase usecase = builder.withMetaInfo( CacheOptions.NEVER ).newUsecase();
         final DefaultEntityStoreUnitOfWork uow = new DefaultEntityStoreUnitOfWork( entityStoreSPI,
                                                                                    newUnitOfWorkId(), module, usecase,
-                                                                                   System.currentTimeMillis() );
+                                                                                   Instant.now() );
         try
         {
             connection = database.getConnection();
@@ -348,7 +349,7 @@ public class SQLEntityStoreMixin
             EntityStatus status = EntityStatus.LOADED;
 
             String version = jsonObject.getString( JSONKeys.VERSION );
-            long modified = jsonObject.getLong( JSONKeys.MODIFIED );
+            Instant modified = Instant.ofEpochMilli( jsonObject.getLong( JSONKeys.MODIFIED ) );
             String identity = jsonObject.getString( JSONKeys.IDENTITY );
 
             // Check if version is correct
@@ -549,7 +550,7 @@ public class SQLEntityStoreMixin
                 key( JSONKeys.APPLICATION_VERSION ).value( application.version() ).
                 key( JSONKeys.TYPE ).value( first( state.entityDescriptor().types() ).getName() ).
                 key( JSONKeys.VERSION ).value( version ).
-                key( JSONKeys.MODIFIED ).value( state.lastModified() ).
+                key( JSONKeys.MODIFIED ).value( state.lastModified().toEpochMilli() ).
                 key( JSONKeys.PROPERTIES ).object();
 
             for( PropertyDescriptor persistentProperty : state.entityDescriptor().state().properties() )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/internal/DatabaseSQLService.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/internal/DatabaseSQLService.java b/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/internal/DatabaseSQLService.java
index cdbbe0f..eb641eb 100644
--- a/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/internal/DatabaseSQLService.java
+++ b/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/internal/DatabaseSQLService.java
@@ -19,6 +19,7 @@ import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
+import java.time.Instant;
 import org.qi4j.api.entity.EntityReference;
 import org.qi4j.api.service.ServiceComposite;
 
@@ -103,10 +104,10 @@ public interface DatabaseSQLService
     void populateGetAllEntitiesStatement( PreparedStatement ps )
         throws SQLException;
 
-    void populateInsertEntityStatement( PreparedStatement ps, EntityReference ref, String entity, Long lastModified )
+    void populateInsertEntityStatement( PreparedStatement ps, EntityReference ref, String entity, Instant lastModified )
         throws SQLException;
 
-    void populateUpdateEntityStatement( PreparedStatement ps, Long entityPK, Long entityOptimisticLock, EntityReference ref, String entity, Long lastModified )
+    void populateUpdateEntityStatement( PreparedStatement ps, Long entityPK, Long entityOptimisticLock, EntityReference ref, String entity, Instant lastModified )
         throws SQLException;
 
     void populateRemoveEntityStatement( PreparedStatement ps, Long entityPK, EntityReference ref )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/internal/DatabaseSQLServiceStatementsMixin.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/internal/DatabaseSQLServiceStatementsMixin.java b/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/internal/DatabaseSQLServiceStatementsMixin.java
index 532b788..c235684 100644
--- a/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/internal/DatabaseSQLServiceStatementsMixin.java
+++ b/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/internal/DatabaseSQLServiceStatementsMixin.java
@@ -17,6 +17,7 @@ package org.qi4j.entitystore.sql.internal;
 import java.sql.Connection;
 import java.sql.PreparedStatement;
 import java.sql.SQLException;
+import java.time.Instant;
 import org.qi4j.api.entity.EntityReference;
 import org.qi4j.api.injection.scope.This;
 
@@ -83,12 +84,12 @@ public abstract class DatabaseSQLServiceStatementsMixin
     }
 
     @Override
-    public void populateInsertEntityStatement( PreparedStatement ps, EntityReference ref, String entity, Long lastModified )
+    public void populateInsertEntityStatement( PreparedStatement ps, EntityReference ref, String entity, Instant lastModified )
             throws SQLException
     {
         ps.setString( 1, ref.identity() );
         ps.setString( 2, entity );
-        ps.setLong( 3, lastModified );
+        ps.setLong( 3, lastModified.toEpochMilli() );
     }
 
     @Override
@@ -99,12 +100,12 @@ public abstract class DatabaseSQLServiceStatementsMixin
     }
 
     @Override
-    public void populateUpdateEntityStatement( PreparedStatement ps, Long entityPK, Long entityOptimisticLock, EntityReference ref, String entity, Long lastModified )
+    public void populateUpdateEntityStatement( PreparedStatement ps, Long entityPK, Long entityOptimisticLock, EntityReference ref, String entity, Instant lastModified )
             throws SQLException
     {
         ps.setLong( 1, entityOptimisticLock + 1 );
         ps.setString( 2, entity );
-        ps.setLong( 3, lastModified );
+        ps.setLong( 3, lastModified.toEpochMilli() );
         ps.setLong( 4, entityPK );
         ps.setLong( 5, entityOptimisticLock );
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/internal/SQLEntityState.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/internal/SQLEntityState.java b/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/internal/SQLEntityState.java
index 1286049..aced663 100644
--- a/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/internal/SQLEntityState.java
+++ b/extensions/entitystore-sql/src/main/java/org/qi4j/entitystore/sql/internal/SQLEntityState.java
@@ -14,6 +14,7 @@
  */
 package org.qi4j.entitystore.sql.internal;
 
+import java.time.Instant;
 import org.qi4j.api.common.QualifiedName;
 import org.qi4j.api.entity.EntityDescriptor;
 import org.qi4j.api.entity.EntityReference;
@@ -124,7 +125,7 @@ public interface SQLEntityState
         }
 
         @Override
-        public long lastModified()
+        public Instant lastModified()
         {
             return state.lastModified();
         }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/ElasticSearchIndexer.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/ElasticSearchIndexer.java b/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/ElasticSearchIndexer.java
index 58172d5..ed27403 100644
--- a/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/ElasticSearchIndexer.java
+++ b/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/ElasticSearchIndexer.java
@@ -17,6 +17,7 @@
  */
 package org.qi4j.index.elasticsearch;
 
+import java.time.Instant;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
@@ -98,7 +99,7 @@ public interface ElasticSearchIndexer
             EntityStoreUnitOfWork uow = entityStore.newUnitOfWork(
                 UsecaseBuilder.newUsecase( "Load associations for indexing" ),
                 module,
-                System.currentTimeMillis()
+                Instant.now()
             );
 
             // Bulk index request builder

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/RdfQueryParserFactory.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/RdfQueryParserFactory.java b/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/RdfQueryParserFactory.java
index 93515e7..a1ec557 100644
--- a/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/RdfQueryParserFactory.java
+++ b/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/RdfQueryParserFactory.java
@@ -19,7 +19,6 @@ package org.qi4j.index.rdf.query;
 
 import org.openrdf.query.QueryLanguage;
 import org.qi4j.api.injection.scope.Service;
-import org.qi4j.api.injection.scope.Structure;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.service.ServiceComposite;
 import org.qi4j.api.service.qualifier.Tagged;
@@ -27,7 +26,6 @@ import org.qi4j.api.value.ValueSerialization;
 import org.qi4j.api.value.ValueSerializer;
 import org.qi4j.index.rdf.UnsupportedLanguageException;
 import org.qi4j.index.rdf.query.internal.RdfQueryParserImpl;
-import org.qi4j.spi.Qi4jSPI;
 
 @Mixins( RdfQueryParserFactory.RdfQueryParserFactoryMixin.class )
 public interface RdfQueryParserFactory
@@ -38,8 +36,6 @@ public interface RdfQueryParserFactory
     abstract class RdfQueryParserFactoryMixin
         implements RdfQueryParserFactory
     {
-        @Structure
-        private Qi4jSPI spi;
         @Service
         @Tagged( ValueSerialization.Formats.JSON )
         private ValueSerializer valueSerializer;
@@ -49,7 +45,7 @@ public interface RdfQueryParserFactory
         {
             if( language.equals( QueryLanguage.SPARQL ) )
             {
-                return new RdfQueryParserImpl( spi, valueSerializer );
+                return new RdfQueryParserImpl( valueSerializer );
             }
             throw new UnsupportedLanguageException( language );
         }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/internal/RdfQueryParserImpl.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/internal/RdfQueryParserImpl.java b/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/internal/RdfQueryParserImpl.java
index 30958b1..676e5e5 100644
--- a/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/internal/RdfQueryParserImpl.java
+++ b/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/internal/RdfQueryParserImpl.java
@@ -17,16 +17,12 @@
  */
 package org.qi4j.index.rdf.query.internal;
 
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
 import java.util.Arrays;
 import java.util.Collection;
-import java.util.Date;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
-import java.util.TimeZone;
 import java.util.function.Predicate;
 import org.apache.commons.lang.StringEscapeUtils;
 import org.qi4j.api.composite.Composite;
@@ -68,23 +64,11 @@ import static java.lang.String.format;
 public class RdfQueryParserImpl
     implements RdfQueryParser
 {
-    private static final ThreadLocal<DateFormat> ISO8601_UTC = new ThreadLocal<DateFormat>()
-    {
-        @Override
-        protected DateFormat initialValue()
-        {
-            SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" );
-            dateFormat.setTimeZone( TimeZone.getTimeZone( "UTC" ) );
-            return dateFormat;
-        }
-    };
-
     private static final Map<Class<? extends ComparisonSpecification>, String> OPERATORS;
     private static final Set<Character> RESERVED_CHARS;
 
     private final Namespaces namespaces = new Namespaces();
     private final Triples triples = new Triples( namespaces );
-    private final Qi4jSPI spi;
     private final ValueSerializer valueSerializer;
     private Map<String, Object> variables;
 
@@ -103,9 +87,8 @@ public class RdfQueryParserImpl
         ) );
     }
 
-    public RdfQueryParserImpl( Qi4jSPI spi, ValueSerializer valueSerializer )
+    public RdfQueryParserImpl( ValueSerializer valueSerializer )
     {
-        this.spi = spi;
         this.valueSerializer = valueSerializer;
     }
 
@@ -331,7 +314,7 @@ public class RdfQueryParserImpl
     {
         for( Integer x = 0; x < strings.length; ++x )
         {
-            builder.append( strings[ x] );
+            builder.append( strings[ x ] );
             if( x + 1 < strings.length )
             {
                 builder.append( delimiter );
@@ -357,7 +340,7 @@ public class RdfQueryParserImpl
         char[] chars = jsonStr.toCharArray();
         for( int i = 0; i < chars.length; i++ )
         {
-            char c = chars[ i];
+            char c = chars[ i ];
 
             /*
              if ( reservedJsonChars.contains( c ))
@@ -404,7 +387,7 @@ public class RdfQueryParserImpl
                 }
                 jsonStr = escapeJSONString( serialized );
             }
-            strings[ x] = this.createRegexStringForContaining( valueVariable, jsonStr );
+            strings[ x ] = this.createRegexStringForContaining( valueVariable, jsonStr );
             x++;
         }
 
@@ -554,11 +537,7 @@ public class RdfQueryParserImpl
             return null;
         }
 
-        if( value instanceof Date )
-        {
-            return ISO8601_UTC.get().format( (Date) value );
-        }
-        else if( value instanceof EntityComposite )
+        if( value instanceof EntityComposite )
         {
             return "urn:qi4j:entity:" + value.toString();
         }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/indexing-solr/src/main/java/org/qi4j/index/solr/internal/SolrEntityIndexerMixin.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-solr/src/main/java/org/qi4j/index/solr/internal/SolrEntityIndexerMixin.java b/extensions/indexing-solr/src/main/java/org/qi4j/index/solr/internal/SolrEntityIndexerMixin.java
index e038a4e..1abfa04 100644
--- a/extensions/indexing-solr/src/main/java/org/qi4j/index/solr/internal/SolrEntityIndexerMixin.java
+++ b/extensions/indexing-solr/src/main/java/org/qi4j/index/solr/internal/SolrEntityIndexerMixin.java
@@ -148,7 +148,7 @@ public abstract class SolrEntityIndexerMixin
         SolrInputDocument input = new SolrInputDocument();
         input.addField( "id", entityState.identity().identity() );
         input.addField( "type", first(entityState.entityDescriptor().types()).getName() );
-        input.addField( "lastModified", new Date( entityState.lastModified() ) );
+        input.addField( "lastModified", new Date( entityState.lastModified().toEpochMilli() ) );
 
         for( Statement statement : graph )
         {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/common/QNameInfo.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/common/QNameInfo.java b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/common/QNameInfo.java
index 265b52f..273dd0d 100644
--- a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/common/QNameInfo.java
+++ b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/common/QNameInfo.java
@@ -19,9 +19,14 @@ package org.qi4j.index.sql.support.common;
 
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.OffsetDateTime;
+import java.time.OffsetTime;
+import java.time.ZonedDateTime;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Date;
 import java.util.List;
 import org.qi4j.api.association.AssociationDescriptor;
 import org.qi4j.api.common.QualifiedName;
@@ -107,7 +112,12 @@ public final class QNameInfo
                 Number.class.isAssignableFrom( finalClass )//
                 || Boolean.class.isAssignableFrom( finalClass ) //
                 || Character.class.isAssignableFrom( finalClass ) //
-                || Date.class.isAssignableFrom( finalClass ) //
+                || LocalDate.class.isAssignableFrom( finalClass ) //
+                || LocalTime.class.isAssignableFrom( finalClass ) //
+                || LocalDateTime.class.isAssignableFrom( finalClass ) //
+                || OffsetTime.class.isAssignableFrom( finalClass ) //
+                || OffsetDateTime.class.isAssignableFrom( finalClass ) //
+                || ZonedDateTime.class.isAssignableFrom( finalClass ) //
                 || Enum.class.isAssignableFrom( finalClass ) //
                 || String.class.isAssignableFrom( finalClass )//
                 ;

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/postgresql/PostgreSQLTypeHelper.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/postgresql/PostgreSQLTypeHelper.java b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/postgresql/PostgreSQLTypeHelper.java
index e85bba2..df8f925 100644
--- a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/postgresql/PostgreSQLTypeHelper.java
+++ b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/postgresql/PostgreSQLTypeHelper.java
@@ -22,7 +22,12 @@ import java.lang.reflect.Type;
 import java.sql.PreparedStatement;
 import java.sql.SQLException;
 import java.sql.Timestamp;
-import java.util.Date;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.OffsetDateTime;
+import java.time.OffsetTime;
+import java.time.ZonedDateTime;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.mixin.Mixins;
@@ -41,10 +46,11 @@ public interface PostgreSQLTypeHelper
     /**
      * Adds the specified object at specified index in specified prepared statement.
      *
-     * @param ps The prepared statement.
-     * @param index The index for the object to be inserted in prepared statemtent ({@code > 0}).
-     * @param primitive The object to insert.
+     * @param ps            The prepared statement.
+     * @param index         The index for the object to be inserted in prepared statemtent ({@code > 0}).
+     * @param primitive     The object to insert.
      * @param primitiveType The type of object.
+     *
      * @throws SQLException If something underlying throws it.
      */
     void addPrimitiveToPS( PreparedStatement ps, Integer index, @Optional Object primitive, Type primitiveType )
@@ -66,13 +72,33 @@ public interface PostgreSQLTypeHelper
                 if( primitive instanceof Character )
                 {
                     primitive = Character.codePointAt( new char[]
-                    {
-                        (Character) primitive
-                    }, 0 );
+                                                           {
+                                                               (Character) primitive
+                                                           }, 0 );
+                }
+                else if( primitive instanceof OffsetDateTime )
+                {
+                    // TODO = Don't know SQL well enough to figure this out
+                }
+                else if( primitive instanceof OffsetTime )
+                {
+                    // TODO = Don't know SQL well enough to figure this out
+                }
+                else if( primitive instanceof LocalDateTime )
+                {
+                    // TODO = Don't know SQL well enough to figure this out
+                }
+                else if( primitive instanceof LocalTime )
+                {
+                    // TODO = Don't know SQL well enough to figure this out
                 }
-                else if( primitive instanceof Date )
+                else if( primitive instanceof LocalDate )
                 {
-                    primitive = new Timestamp( ( (Date) primitive ).getTime() );
+                    // TODO = Don't know SQL well enough to figure this out
+                }
+                else if( primitive instanceof ZonedDateTime )
+                {
+                    primitive = new Timestamp( ( (ZonedDateTime) primitive ).toInstant().toEpochMilli() );
                 }
                 else if( primitive instanceof Byte )
                 {
@@ -125,5 +151,4 @@ public interface PostgreSQLTypeHelper
             return sqlType;
         }
     }
-
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLIndexing.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLIndexing.java b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLIndexing.java
index aab952d..ac0b021 100644
--- a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLIndexing.java
+++ b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLIndexing.java
@@ -358,7 +358,7 @@ public abstract class AbstractSQLIndexing
         throws SQLException
     {
         ps.setString( startingIndex, state.identity().identity() );
-        ps.setTimestamp( startingIndex + 1, new Timestamp( state.lastModified() ) );
+        ps.setTimestamp( startingIndex + 1, new Timestamp( state.lastModified().toEpochMilli() ) );
         ps.setString( startingIndex + 2, state.version() );
         ps.setString( startingIndex + 3, this._app.version() );
     }
@@ -1004,7 +1004,7 @@ public abstract class AbstractSQLIndexing
 
         // Update state
         ps.setString( 1, state.identity().identity() );
-        ps.setTimestamp( 2, new Timestamp( state.lastModified() ) );
+        ps.setTimestamp( 2, new Timestamp( state.lastModified().toEpochMilli() ) );
         ps.setString( 3, state.version() );
         ps.setString( 4, this._app.version() );
         ps.setLong( 5, entityPK );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLStartup.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLStartup.java b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLStartup.java
index 8a62b59..5a4274d 100644
--- a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLStartup.java
+++ b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLStartup.java
@@ -30,7 +30,6 @@ import java.sql.Statement;
 import java.sql.Types;
 import java.util.ArrayDeque;
 import java.util.ArrayList;
-import java.util.Date;
 import java.util.Deque;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -292,12 +291,19 @@ public abstract class AbstractSQLStartup
         this._primitiveTypes.put( Long.class, dt.bigInt() );
         this._primitiveTypes.put( Float.class, dt.real() );
         this._primitiveTypes.put( Double.class, dt.doublePrecision() );
-        this._primitiveTypes.put( Date.class, dt.timeStamp( true ) );
         this._primitiveTypes.put( Character.class, dt.integer() );
         this._primitiveTypes.put( String.class, dt.sqlVarChar( 5000 ) );
         this._primitiveTypes.put( BigInteger.class, dt.decimal() );
         this._primitiveTypes.put( BigDecimal.class, dt.decimal() );
 
+        // TODO - ???
+//        this._primitiveTypes.put( LocalDate.class, dt.timeStamp( true ) );
+//        this._primitiveTypes.put( LocalDateTime.class, dt.timeStamp( true ) );
+//        this._primitiveTypes.put( LocalTime.class, dt.timeStamp( true ) );
+//        this._primitiveTypes.put( OffsetTime.class, dt.timeStamp( true ) );
+//        this._primitiveTypes.put( OffsetDateTime.class, dt.timeStamp( true ) );
+//        this._primitiveTypes.put( ZonedDateTime.class, dt.timeStamp( true ) );
+
         Map<Class<?>, Integer> jdbcTypes = new HashMap<>();
         jdbcTypes.put( Boolean.class, Types.BOOLEAN );
         jdbcTypes.put( Byte.class, Types.SMALLINT );
@@ -306,13 +312,20 @@ public abstract class AbstractSQLStartup
         jdbcTypes.put( Long.class, Types.BIGINT );
         jdbcTypes.put( Float.class, Types.REAL );
         jdbcTypes.put( Double.class, Types.DOUBLE );
-        jdbcTypes.put( Date.class, Types.TIMESTAMP );
         jdbcTypes.put( Character.class, Types.INTEGER );
         jdbcTypes.put( String.class, Types.VARCHAR );
         jdbcTypes.put( BigInteger.class, Types.NUMERIC );
         jdbcTypes.put( BigDecimal.class, Types.NUMERIC );
         this._state.javaTypes2SQLTypes().set( jdbcTypes );
 
+        // TODO - ???
+//        jdbcTypes.put( LocalDate.class, Types.TIMESTAMP );
+//        jdbcTypes.put( LocalDateTime.class, Types.TIMESTAMP );
+//        jdbcTypes.put( LocalTime.class, Types.TIMESTAMP );
+//        jdbcTypes.put( OffsetTime.class, Types.TIMESTAMP );
+//        jdbcTypes.put( OffsetDateTime.class, Types.TIMESTAMP );
+//        jdbcTypes.put( ZonedDateTime.class, Types.TIMESTAMP );
+
         this._customizableTypes = new HashMap<>();
         this._customizableTypes.put( //
             String.class, //
@@ -361,7 +374,7 @@ public abstract class AbstractSQLStartup
     private static class ApplicationInfo
     {
 
-        private final Map<String, EntityDescriptor> entityDescriptors = new HashMap<>();
+        private final Map<String, EntityDescriptor> entityDescriptors = new HashMap<String, EntityDescriptor>();
 
         private final Set<CompositeDescriptorInfo> usedValueComposites = new HashSet<>();
 
@@ -554,8 +567,19 @@ public abstract class AbstractSQLStartup
                                 .get( ENTITY_PK_TYPE ), false, AutoGenerationPolicy.BY_DEFAULT ) )
                         .addTableElement( d.createColumnDefinition( ENTITY_TABLE_IDENTITY_COLUMN_NAME, this._primitiveTypes
                                 .get( String.class ), false ) )
-                        .addTableElement( d.createColumnDefinition( ENTITY_TABLE_MODIFIED_COLUMN_NAME, this._primitiveTypes
-                                .get( Date.class ), false ) )
+// TODO -??
+//                        .addTableElement( d.createColumnDefinition( ENTITY_TABLE_MODIFIED_COLUMN_NAME, this._primitiveTypes
+//                                .get( LocalDate.class ), false ) )
+//                        .addTableElement( d.createColumnDefinition( ENTITY_TABLE_MODIFIED_COLUMN_NAME, this._primitiveTypes
+//                                .get( LocalDateTime.class ), false ) )
+//                        .addTableElement( d.createColumnDefinition( ENTITY_TABLE_MODIFIED_COLUMN_NAME, this._primitiveTypes
+//                                .get( LocalTime.class ), false ) )
+//                        .addTableElement( d.createColumnDefinition( ENTITY_TABLE_MODIFIED_COLUMN_NAME, this._primitiveTypes
+//                                .get( OffsetTime.class ), false ) )
+//                        .addTableElement( d.createColumnDefinition( ENTITY_TABLE_MODIFIED_COLUMN_NAME, this._primitiveTypes
+//                                .get( OffsetDateTime.class ), false ) )
+//                        .addTableElement( d.createColumnDefinition( ENTITY_TABLE_MODIFIED_COLUMN_NAME, this._primitiveTypes
+//                                .get( ZonedDateTime.class ), false ) )
                         .addTableElement( d.createColumnDefinition( ENTITY_TABLE_VERSION_COLUMN_NAME, this._primitiveTypes
                                 .get( String.class ), false ) )
                         .addTableElement( d.createColumnDefinition( ENTITY_TABLE_APPLICATION_VERSION_COLUMN_NAME, this._primitiveTypes

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/SQLCompatEntityStateWrapper.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/SQLCompatEntityStateWrapper.java b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/SQLCompatEntityStateWrapper.java
index 82fe6de..8f65d8d 100644
--- a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/SQLCompatEntityStateWrapper.java
+++ b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/SQLCompatEntityStateWrapper.java
@@ -17,6 +17,7 @@
  */
 package org.qi4j.index.sql.support.skeletons;
 
+import java.time.Instant;
 import java.util.function.Function;
 import java.util.function.Predicate;
 import org.qi4j.api.association.AssociationDescriptor;
@@ -112,7 +113,7 @@ import org.slf4j.LoggerFactory;
     }
 
     @Override
-    public long lastModified()
+    public Instant lastModified()
     {
         return wrappedEntityState.lastModified();
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries.gradle
----------------------------------------------------------------------
diff --git a/libraries.gradle b/libraries.gradle
index 97e87a0..6ea0d1b 100644
--- a/libraries.gradle
+++ b/libraries.gradle
@@ -30,7 +30,6 @@ def jedisVersion = '2.5.1'
 def jettyVersion = '9.2.1.v20140609'
 def jgoodiesLooksVersion = '2.5.3'
 def jodaMoneyVersion = '0.9.1'
-def jodaTimeVersion = '2.3'
 def jrubyVersion = '1.7.8' // 1.7.12 - Fails to run!
 def jtaVersion = '1.1'
 def leveldbVersion = '0.7'
@@ -202,7 +201,6 @@ rootProject.ext {
           // Library & Extension dependencies
           jackson_mapper: "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion",
           jodamoney: "org.joda:joda-money:$jodaMoneyVersion",
-          jodatime: "joda-time:joda-time:$jodaTimeVersion",
           ehcache: "net.sf.ehcache:ehcache:$ehcacheVersion",
           elasticsearch: "org.elasticsearch:elasticsearch:$elasticsearchVersion",
           h2: "com.h2database:h2:$h2Version",

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmEvent.java
----------------------------------------------------------------------
diff --git a/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmEvent.java b/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmEvent.java
index 7d6ea26..07d12e6 100644
--- a/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmEvent.java
+++ b/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmEvent.java
@@ -18,7 +18,7 @@
 
 package org.qi4j.library.alarm;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import java.util.Locale;
 import java.util.ResourceBundle;
 import org.qi4j.api.injection.scope.Service;
@@ -62,7 +62,7 @@ public interface AlarmEvent
      *
      * @return the timestamp when this event occurred.
      */
-    Property<Date> eventTime();
+    Property<ZonedDateTime> eventTime();
 
     /**
      * Returns the Name of the event.

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmStatus.java
----------------------------------------------------------------------
diff --git a/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmStatus.java b/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmStatus.java
index d2c7df1..00e3f2d 100644
--- a/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmStatus.java
+++ b/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmStatus.java
@@ -18,7 +18,7 @@
 
 package org.qi4j.library.alarm;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import java.util.Locale;
 import java.util.ResourceBundle;
 import org.qi4j.api.common.Optional;
@@ -60,7 +60,7 @@ public interface AlarmStatus extends ValueComposite
          * @return the timestamp of when the state was created.
          */
         @Optional
-        Property<Date> creationDate();
+        Property<ZonedDateTime> creationDate();
 
         /**
          * Returns the Name of the AlarmStatus.
@@ -101,7 +101,7 @@ public interface AlarmStatus extends ValueComposite
         {
             if( state.creationDate().get() == null )
             {
-                state.creationDate().set( new Date() );
+                state.creationDate().set( ZonedDateTime.now() );
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmSystem.java
----------------------------------------------------------------------
diff --git a/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmSystem.java b/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmSystem.java
index c3e3702..d7ec0b2 100644
--- a/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmSystem.java
+++ b/libraries/alarm/src/main/java/org/qi4j/library/alarm/AlarmSystem.java
@@ -18,8 +18,8 @@
 
 package org.qi4j.library.alarm;
 
+import java.time.ZonedDateTime;
 import java.util.ArrayList;
-import java.util.Date;
 import java.util.Iterator;
 import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
@@ -224,7 +224,7 @@ public interface AlarmSystem
             ValueBuilder<AlarmStatus> builder = vbf.newValueBuilder( AlarmStatus.class );
             AlarmStatus.State statePrototype = builder.prototypeFor( AlarmStatus.State.class );
             statePrototype.name().set( status );
-            statePrototype.creationDate().set( new Date() );
+            statePrototype.creationDate().set( ZonedDateTime.now() );
             return builder.newInstance();
         }
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/alarm/src/main/java/org/qi4j/library/alarm/ExtendedAlarmModelService.java
----------------------------------------------------------------------
diff --git a/libraries/alarm/src/main/java/org/qi4j/library/alarm/ExtendedAlarmModelService.java b/libraries/alarm/src/main/java/org/qi4j/library/alarm/ExtendedAlarmModelService.java
index dbb764e..5544fae 100644
--- a/libraries/alarm/src/main/java/org/qi4j/library/alarm/ExtendedAlarmModelService.java
+++ b/libraries/alarm/src/main/java/org/qi4j/library/alarm/ExtendedAlarmModelService.java
@@ -17,9 +17,9 @@
  */
 package org.qi4j.library.alarm;
 
+import java.time.ZonedDateTime;
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Date;
 import java.util.List;
 import java.util.Locale;
 import java.util.ResourceBundle;
@@ -406,7 +406,7 @@ public interface ExtendedAlarmModelService
             ValueBuilder<AlarmStatus> builder = vbf.newValueBuilder( AlarmStatus.class );
             AlarmStatus.State prototype = builder.prototypeFor(AlarmStatus.State.class);
             prototype.name().set( status );
-            prototype.creationDate().set( new Date() );
+            prototype.creationDate().set( ZonedDateTime.now() );
             return builder.newInstance();
         }
 
@@ -419,7 +419,7 @@ public interface ExtendedAlarmModelService
             ValueBuilder<AlarmEvent> builder = vbf.newValueBuilder( AlarmEvent.class );
             AlarmEvent prototype = builder.prototype();
             prototype.alarmIdentity().set( alarmId.identity().get() );
-            prototype.eventTime().set( new Date() );
+            prototype.eventTime().set( ZonedDateTime.now() );
             prototype.newStatus().set( newStatus );
             prototype.oldStatus().set( oldStatus );
             prototype.systemName().set( eventSystemName );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/alarm/src/main/java/org/qi4j/library/alarm/SimpleAlarmModelService.java
----------------------------------------------------------------------
diff --git a/libraries/alarm/src/main/java/org/qi4j/library/alarm/SimpleAlarmModelService.java b/libraries/alarm/src/main/java/org/qi4j/library/alarm/SimpleAlarmModelService.java
index 378709e..1eb07b6 100644
--- a/libraries/alarm/src/main/java/org/qi4j/library/alarm/SimpleAlarmModelService.java
+++ b/libraries/alarm/src/main/java/org/qi4j/library/alarm/SimpleAlarmModelService.java
@@ -17,9 +17,9 @@
  */
 package org.qi4j.library.alarm;
 
+import java.time.ZonedDateTime;
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Date;
 import java.util.List;
 import java.util.Locale;
 import java.util.ResourceBundle;
@@ -229,7 +229,7 @@ public interface SimpleAlarmModelService extends AlarmModel, ServiceComposite
             ValueBuilder<AlarmStatus> builder = vbf.newValueBuilder( AlarmStatus.class );
             AlarmStatus.State prototype = builder.prototypeFor(AlarmStatus.State.class);
             prototype.name().set( status );
-            prototype.creationDate().set( new Date() );
+            prototype.creationDate().set( ZonedDateTime.now());
             return builder.newInstance();
         }
 
@@ -241,7 +241,7 @@ public interface SimpleAlarmModelService extends AlarmModel, ServiceComposite
             ValueBuilder<AlarmEvent> builder = vbf.newValueBuilder( AlarmEvent.class );
             AlarmEvent prototype = builder.prototype();
             prototype.alarmIdentity().set( alarmId.identity().get() );
-            prototype.eventTime().set( new Date() );
+            prototype.eventTime().set( ZonedDateTime.now() );
             prototype.newStatus().set( newStatus );
             prototype.oldStatus().set( oldStatus );
             prototype.systemName().set( eventSystemName );


[07/50] [abbrv] zest-qi4j git commit: Libraries minor upgrades

Posted by ni...@apache.org.
Libraries minor upgrades


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/5dc87a2b
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/5dc87a2b
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/5dc87a2b

Branch: refs/heads/3.0
Commit: 5dc87a2b7fc8fcff368af258150a3bf7214e757d
Parents: 74f2a02
Author: Paul Merlin <pa...@nosphere.org>
Authored: Thu Jun 12 14:46:41 2014 +0200
Committer: Paul Merlin <pa...@nosphere.org>
Committed: Thu Jun 12 14:46:41 2014 +0200

----------------------------------------------------------------------
 libraries.gradle | 76 +++++++++++++++++++++++++--------------------------
 1 file changed, 38 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/5dc87a2b/libraries.gradle
----------------------------------------------------------------------
diff --git a/libraries.gradle b/libraries.gradle
index d0b8047..993c407 100644
--- a/libraries.gradle
+++ b/libraries.gradle
@@ -5,78 +5,78 @@ def bonecpVersion = '0.8.0.RELEASE'
 def bouncyVersion = '1.50'
 def c3p0Version = '0.9.1.2'
 def commonsCodecVersion = '1.8'
-def commonsDbcpVersion = '1.4' // Should be moved to org.apache.tomcat:tomcat-jdbc:7.0.47
+def commonsDbcpVersion = '1.4' // Should be moved to org.apache.tomcat:tomcat-jdbc:8.0.8
 def commonsIoVersion = '2.4'
 def commonsLangVersion = '2.6'
-def cxfVersion = '2.5.6' // 2.7.8 - Unable to resolve dependencies!
-def derbyVersion = '10.10.1.1'
-def dnsJavaVersion = '2.1.1' // 2.1.6 not published yet
-def ehcacheVersion = '2.8.0'
-def elasticsearchVersion = '1.0.0'
+def cxfVersion = '2.5.6' // 2.7.11 Unable to resolve dependencies! - 3.0.0 exists
+def derbyVersion = '10.10.2.0'
+def dnsJavaVersion = '2.1.6'
+def ehcacheVersion = '2.8.3'
+def elasticsearchVersion = '1.2.1'
 def freemarkerVersion = '2.3.20'
 def gaeVersion = '1.8.8'
-def groovyVersion = '2.2.1'
-def guavaVersion = '15.0'
-def h2Version = '1.3.174'
 def hazelcastVersion = '3.1.3'
-def httpClientVersion = '4.2.2' // 4.3.1 exists
 def jacksonVersion = '1.9.11'
+def groovyVersion = '2.3.2'
+def guavaVersion = '17.0'
+def h2Version = '1.4.178'
+def httpClientVersion = '4.2.2' // 4.3.4 exists
 def javascriptVersion = '1.7R4'
 def javasqlgeneratorVersion = '0.3.2'
 def jcloudsVersion = '1.7.0'
 def jdbmVersion = '2.4'
 def jdomVersion = '2.0.2'
-def jedisVersion = '2.2.1'
-def jettyVersion = '9.1.0.v20131115'
+def jedisVersion = '2.5.1'
+def jettyVersion = '9.2.1.v20140609'
 def jgoodiesLooksVersion = '2.5.3'
-def jodaMoneyVersion = '0.9'
+def jodaMoneyVersion = '0.9.1'
 def jodaTimeVersion = '2.3'
-def jrubyVersion = '1.7.8' // 1.7.9 - Fails to run!
+def jrubyVersion = '1.7.8' // 1.7.12 - Fails to run!
 def jtaVersion = '1.1'
-def leveldbVersion = '0.6'
-def leveldbJniVersion = '1.7'
-def liquibaseVersion = '3.1.0'
+def leveldbVersion = '0.7'
+def leveldbJniVersion = '1.8'
+def liquibaseVersion = '3.2.0'
 def log4jVersion = '1.2.17'
-def logbackVersion = '1.0.13'
 def mongodbVersion = '2.11.3'
-def mysqlVersion = '5.1.28'
-def neoVersion = '1.3' // 1.9.4 - Fails to compile!
+def logbackVersion = '1.1.2'
+def mysqlVersion = '5.1.31'
+def neoVersion = '1.3' // 1.9.4 Fails to compile! - 2.1.2 exists
 def neoIndexVersion = '1.3-1.3.M01' // Do not exist anymore!
 def orgJsonVersion = '20130213'
-def osgiVersion = '4.2.0' // 4.3.0 - Fails to compile!
-def pdfboxVersion = '1.8.3'
-def postgresqlVersion = '9.3-1100-jdbc4'
+def osgiVersion = '4.2.0' // 4.3.0 Fails to compile! - 5.0.0 exists
+def pdfboxVersion = '1.8.5'
+def postgresqlVersion = '9.3-1101-jdbc4'
 def prefuseVersion = '0.21'
-def restletVersion = '2.0.15' // 2.1.6 - Fails to compile!
+def restletVersion = '2.0.15' // 2.2.1 Fails to compile!
 def rdfVersion = '2.7.9'
-def riakVersion = '1.4.3'
-def scalaVersion = '2.10.3'
+def riakVersion = '1.4.4'
+def scalaVersion = '2.11.1'
 def servletVersion = '3.1.0'
-def shiroVersion = '1.2.2'
+def shiroVersion = '1.2.3'
 def skedVersion = '2.1'
 def sleepycatVersion = '5.0.73'
-def slf4jVersion = '1.7.5'
-def solrVersion = "1.4.1" // 4.6.0 - Fails to compile!
-def springVersion = '3.2.6.RELEASE' // 4.0.0.RELEASE - Fails to compile!
-def spymemcachedVersion = '2.10.4'
+def slf4jVersion = '1.7.7'
+def solrVersion = "1.4.1" // 4.8.1 Fails to compile!
+def springVersion = '3.2.6.RELEASE' // 4.0.5.RELEASE Fails to compile!
+def spymemcachedVersion = '2.11.3'
 def sqliteVersion = '3.7.2'
-def strutsVersion = '2.3.15.3' // 2.3.16 - Fails to compile!
+def strutsVersion = '2.3.15.3' // 2.3.16.3 Fails to compile!
 def velocityVersion = '1.7'
 def voldemortVersion = '1.3.0'
-def wicketVersion = '1.5.8' // 6.12.0 - Samples fails to compile!
+def wicketVersion = '1.5.8' // 6.15.0 Samples fails to compile!
 def wicketStatelessVersion = '1.5.0'
-def woodstoxVersion = '4.2.0'
+def woodstoxVersion = '4.4.0'
 def wsdl4jVersion = '1.6.3'
 def yammerMetricsVersion = '2.2.0'
 
-def antVersion = '1.9.2'
-def awaitilityVersion = '1.5.0'
+def antVersion = '1.9.4'
+def awaitilityVersion = '1.6.0'
 def easyMockVersion = '3.2'
 def jmockVersion = '2.6.0'
 def junitVersion = '4.11'
 def mockitoVersion = '1.9.5'
-def testNgVersion = '6.8.7'
-def restAssuredVersion= '2.3.0'
+def testNgVersion = '6.8.8'
+def restAssuredVersion= '2.3.2'
 def xmlunitVersion = '1.5'
 
 // build a map of the dependency artifacts to use.  Allows centralized definition of the version of artifacts to


[35/50] [abbrv] zest-qi4j git commit: Replaced Joda Time with Java 8 Time API.

Posted by ni...@apache.org.
http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/alarm/src/main/java/org/qi4j/library/alarm/StandardAlarmModelService.java
----------------------------------------------------------------------
diff --git a/libraries/alarm/src/main/java/org/qi4j/library/alarm/StandardAlarmModelService.java b/libraries/alarm/src/main/java/org/qi4j/library/alarm/StandardAlarmModelService.java
index 1911398..906cd45 100644
--- a/libraries/alarm/src/main/java/org/qi4j/library/alarm/StandardAlarmModelService.java
+++ b/libraries/alarm/src/main/java/org/qi4j/library/alarm/StandardAlarmModelService.java
@@ -17,9 +17,9 @@
  */
 package org.qi4j.library.alarm;
 
+import java.time.ZonedDateTime;
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Date;
 import java.util.List;
 import java.util.Locale;
 import java.util.ResourceBundle;
@@ -274,7 +274,7 @@ public interface StandardAlarmModelService extends AlarmModel, ServiceComposite
             ValueBuilder<AlarmStatus> builder = vbf.newValueBuilder( AlarmStatus.class );
             AlarmStatus.State prototype = builder.prototypeFor( AlarmStatus.State.class );
             prototype.name().set( status );
-            prototype.creationDate().set( new Date() );
+            prototype.creationDate().set( ZonedDateTime.now() );
             return builder.newInstance();
         }
 
@@ -287,7 +287,7 @@ public interface StandardAlarmModelService extends AlarmModel, ServiceComposite
             ValueBuilder<AlarmEvent> builder = vbf.newValueBuilder( AlarmEvent.class );
             AlarmEvent prototype = builder.prototype();
             prototype.alarmIdentity().set( alarmId.identity().get() );
-            prototype.eventTime().set( new Date() );
+            prototype.eventTime().set( ZonedDateTime.now() );
             prototype.newStatus().set( newStatus );
             prototype.oldStatus().set( oldStatus );
             prototype.systemName().set( eventSystemName );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/alarm/src/test/java/org/qi4j/library/alarm/ExtendedAlarmModelTest.java
----------------------------------------------------------------------
diff --git a/libraries/alarm/src/test/java/org/qi4j/library/alarm/ExtendedAlarmModelTest.java b/libraries/alarm/src/test/java/org/qi4j/library/alarm/ExtendedAlarmModelTest.java
index 07dd367..9012a8a 100644
--- a/libraries/alarm/src/test/java/org/qi4j/library/alarm/ExtendedAlarmModelTest.java
+++ b/libraries/alarm/src/test/java/org/qi4j/library/alarm/ExtendedAlarmModelTest.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.library.alarm;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import java.util.List;
 import java.util.Locale;
 import org.junit.Test;
@@ -970,7 +970,7 @@ public class ExtendedAlarmModelTest
         ValueBuilder<AlarmStatus> builder = module.newValueBuilder( AlarmStatus.class );
         AlarmStatus.State statePrototype = builder.prototypeFor( AlarmStatus.State.class );
         statePrototype.name().set( status );
-        statePrototype.creationDate().set( new Date() );
+        statePrototype.creationDate().set( ZonedDateTime.now() );
         return builder.newInstance();
     }
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/alarm/src/test/java/org/qi4j/library/alarm/SimpleAlarmModelTest.java
----------------------------------------------------------------------
diff --git a/libraries/alarm/src/test/java/org/qi4j/library/alarm/SimpleAlarmModelTest.java b/libraries/alarm/src/test/java/org/qi4j/library/alarm/SimpleAlarmModelTest.java
index 5276ac1..e328bdc 100644
--- a/libraries/alarm/src/test/java/org/qi4j/library/alarm/SimpleAlarmModelTest.java
+++ b/libraries/alarm/src/test/java/org/qi4j/library/alarm/SimpleAlarmModelTest.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.library.alarm;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import java.util.List;
 import java.util.Locale;
 import org.junit.Test;
@@ -355,7 +355,7 @@ public class SimpleAlarmModelTest
         ValueBuilder<AlarmStatus> builder = module.newValueBuilder( AlarmStatus.class );
         AlarmStatus.State statePrototype = builder.prototypeFor( AlarmStatus.State.class );
         statePrototype.name().set( status );
-        statePrototype.creationDate().set( new Date() );
+        statePrototype.creationDate().set( ZonedDateTime.now() );
         return builder.newInstance();
     }
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/alarm/src/test/java/org/qi4j/library/alarm/StandardAlarmModelTest.java
----------------------------------------------------------------------
diff --git a/libraries/alarm/src/test/java/org/qi4j/library/alarm/StandardAlarmModelTest.java b/libraries/alarm/src/test/java/org/qi4j/library/alarm/StandardAlarmModelTest.java
index 59e32f5..7f6c8d3 100644
--- a/libraries/alarm/src/test/java/org/qi4j/library/alarm/StandardAlarmModelTest.java
+++ b/libraries/alarm/src/test/java/org/qi4j/library/alarm/StandardAlarmModelTest.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.library.alarm;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import java.util.List;
 import java.util.Locale;
 import org.junit.Assert;
@@ -481,7 +481,7 @@ public class StandardAlarmModelTest
         ValueBuilder<AlarmStatus> builder = module.newValueBuilder( AlarmStatus.class );
         AlarmStatus.State statePrototype = builder.prototypeFor( AlarmStatus.State.class );
         statePrototype.name().set( status );
-        statePrototype.creationDate().set( new Date() );
+        statePrototype.creationDate().set( ZonedDateTime.now() );
         return builder.newInstance();
     }
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/appbrowser/src/test/java/org/qi4j/library/appbrowser/AppBrowserTest.java
----------------------------------------------------------------------
diff --git a/libraries/appbrowser/src/test/java/org/qi4j/library/appbrowser/AppBrowserTest.java b/libraries/appbrowser/src/test/java/org/qi4j/library/appbrowser/AppBrowserTest.java
index 00ed41e..8228454 100644
--- a/libraries/appbrowser/src/test/java/org/qi4j/library/appbrowser/AppBrowserTest.java
+++ b/libraries/appbrowser/src/test/java/org/qi4j/library/appbrowser/AppBrowserTest.java
@@ -2,7 +2,7 @@ package org.qi4j.library.appbrowser;
 
 import java.io.StringWriter;
 import java.io.Writer;
-import org.joda.time.DateTime;
+import java.time.temporal.ChronoUnit;
 import org.junit.Test;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.association.ManyAssociation;
@@ -106,7 +106,7 @@ public class AppBrowserTest extends AbstractQi4jTest
     @Mixins( Age.AgeMixin.class )
     public interface Age
     {
-        Property<Integer> birthYear();
+        Property<Year> birthYear();
 
         int numberOfYearsOld();
 
@@ -117,7 +117,7 @@ public class AppBrowserTest extends AbstractQi4jTest
             @Override
             public int numberOfYearsOld()
             {
-                return DateTime.now().getYearOfEra() - birthYear().get();
+                return birthYear().get().until( Year.now(), ChronoUnit.YEARS );
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/circuitbreaker/src/main/java/org/qi4j/library/circuitbreaker/CircuitBreaker.java
----------------------------------------------------------------------
diff --git a/libraries/circuitbreaker/src/main/java/org/qi4j/library/circuitbreaker/CircuitBreaker.java b/libraries/circuitbreaker/src/main/java/org/qi4j/library/circuitbreaker/CircuitBreaker.java
index 2e53b46..b588665 100644
--- a/libraries/circuitbreaker/src/main/java/org/qi4j/library/circuitbreaker/CircuitBreaker.java
+++ b/libraries/circuitbreaker/src/main/java/org/qi4j/library/circuitbreaker/CircuitBreaker.java
@@ -21,7 +21,7 @@ import java.beans.PropertyChangeSupport;
 import java.beans.PropertyVetoException;
 import java.beans.VetoableChangeListener;
 import java.beans.VetoableChangeSupport;
-import java.util.Date;
+import java.time.ZonedDateTime;
 import java.util.function.Predicate;
 import org.qi4j.functional.Specifications;
 
@@ -43,8 +43,8 @@ public class CircuitBreaker
     private Predicate<Throwable> allowedThrowables;
 
     private int countDown;
-    private long trippedOn = -1;
-    private long enableOn = -1;
+    private ZonedDateTime trippedOn = null;
+    private ZonedDateTime enableOn = null;
 
     private Status status = Status.on;
 
@@ -86,8 +86,8 @@ public class CircuitBreaker
             status = Status.off;
             pcs.firePropertyChange( "status", Status.on, Status.off );
 
-            trippedOn = System.currentTimeMillis();
-            enableOn = trippedOn + timeout;
+            trippedOn = ZonedDateTime.now();
+            enableOn = trippedOn.plusNanos( timeout * 1000000 );
         }
     }
 
@@ -101,8 +101,8 @@ public class CircuitBreaker
                 vcs.fireVetoableChange( "status", Status.off, Status.on );
                 status = Status.on;
                 countDown = threshold;
-                trippedOn = -1;
-                enableOn = -1;
+                trippedOn = null;
+                enableOn = null;
                 lastThrowable = null;
 
                 pcs.firePropertyChange( "status", Status.off, Status.on );
@@ -110,7 +110,7 @@ public class CircuitBreaker
             catch( PropertyVetoException e )
             {
                 // Reset timeout
-                enableOn = System.currentTimeMillis() + timeout;
+                enableOn = ZonedDateTime.now().plusNanos( timeout * 1000000 );
 
                 if( e.getCause() != null )
                 {
@@ -144,7 +144,7 @@ public class CircuitBreaker
     {
         if( status == Status.off )
         {
-            if( System.currentTimeMillis() > enableOn )
+            if( ZonedDateTime.now().isAfter( enableOn ) )
             {
                 try
                 {
@@ -167,14 +167,14 @@ public class CircuitBreaker
         return status;
     }
 
-    public Date trippedOn()
+    public ZonedDateTime trippedOn()
     {
-        return trippedOn == -1 ? null : new Date( trippedOn );
+        return trippedOn;
     }
 
-    public Date enabledOn()
+    public ZonedDateTime enabledOn()
     {
-        return enableOn == -1 ? null : new Date( enableOn );
+        return enableOn;
     }
 
     public boolean isOn()

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/circuitbreaker/src/main/java/org/qi4j/library/circuitbreaker/jmx/CircuitBreakerJMX.java
----------------------------------------------------------------------
diff --git a/libraries/circuitbreaker/src/main/java/org/qi4j/library/circuitbreaker/jmx/CircuitBreakerJMX.java b/libraries/circuitbreaker/src/main/java/org/qi4j/library/circuitbreaker/jmx/CircuitBreakerJMX.java
index 72a9fd2..a557c78 100644
--- a/libraries/circuitbreaker/src/main/java/org/qi4j/library/circuitbreaker/jmx/CircuitBreakerJMX.java
+++ b/libraries/circuitbreaker/src/main/java/org/qi4j/library/circuitbreaker/jmx/CircuitBreakerJMX.java
@@ -19,8 +19,6 @@ package org.qi4j.library.circuitbreaker.jmx;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 import java.beans.PropertyVetoException;
-import java.text.DateFormat;
-import java.util.Date;
 import javax.management.MBeanNotificationInfo;
 import javax.management.Notification;
 import javax.management.NotificationBroadcasterSupport;
@@ -31,96 +29,101 @@ import org.qi4j.library.circuitbreaker.CircuitBreaker;
  * MBean for circuit breakers. Exposes CB properties and also the property changes as notifications.
  */
 public class CircuitBreakerJMX
-        extends NotificationBroadcasterSupport
-        implements org.qi4j.library.circuitbreaker.jmx.CircuitBreakerJMXMBean
+    extends NotificationBroadcasterSupport
+    implements org.qi4j.library.circuitbreaker.jmx.CircuitBreakerJMXMBean
 {
-   CircuitBreaker circuitBreaker;
-
-   public CircuitBreakerJMX(CircuitBreaker circuitBreaker, final ObjectName mbeanObjectName)
-   {
-      super(new MBeanNotificationInfo(new String[]{"serviceLevel", "status"}, Notification.class.getName(), "Circuit breaker notifications"));
-
-      this.circuitBreaker = circuitBreaker;
-      circuitBreaker.addPropertyChangeListener(new PropertyChangeListener()
-      {
-         long sequenceNr = System.currentTimeMillis();
-
-         @Override
-         public void propertyChange(PropertyChangeEvent evt)
-         {
-            Notification notification = new Notification(evt.getPropertyName(), mbeanObjectName, sequenceNr++, System.currentTimeMillis(), evt.getNewValue().toString());
-            sendNotification(notification);
-         }
-      });
-   }
-
-   @Override
-   public String getStatus()
-   {
-      return circuitBreaker.status().name();
-   }
-
-   @Override
-   public int getThreshold()
-   {
-      return circuitBreaker.threshold();
-   }
-
-   @Override
-   public double getServiceLevel()
-   {
-      return circuitBreaker.serviceLevel();
-   }
-
-   @Override
-   public String getLastErrorMessage()
-   {
-      return circuitBreaker.lastThrowable() == null ? "" : errorMessage(circuitBreaker.lastThrowable());
-   }
-
-   private String errorMessage(Throwable throwable)
-   {
-      String message = throwable.getMessage();
-      if (message == null)
-         message = throwable.getClass().getSimpleName();
-
-      if (throwable.getCause() != null)
-      {
-         return message + ":" + errorMessage(throwable.getCause());
-      } else
-         return message;
-   }
-
-   @Override
-   public String getTrippedOn()
-   {
-      Date trippedOn = circuitBreaker.trippedOn();
-      return trippedOn == null ? "" : DateFormat.getDateTimeInstance().format(trippedOn);
-   }
-
-   @Override
-   public String getEnableOn()
-   {
-      Date trippedOn = circuitBreaker.enabledOn();
-      return trippedOn == null ? "" : DateFormat.getDateTimeInstance().format(trippedOn);
-   }
-
-   @Override
-   public String turnOn()
-   {
-      try
-      {
-         circuitBreaker.turnOn();
-         return "Circuit breaker has been turned on";
-      } catch (PropertyVetoException e)
-      {
-         return "Could not turn on circuit breaker:" + getLastErrorMessage();
-      }
-   }
-
-   @Override
-   public void trip()
-   {
-      circuitBreaker.trip();
-   }
+    CircuitBreaker circuitBreaker;
+
+    public CircuitBreakerJMX( CircuitBreaker circuitBreaker, final ObjectName mbeanObjectName )
+    {
+        super( new MBeanNotificationInfo( new String[]{ "serviceLevel", "status" }, Notification.class.getName(), "Circuit breaker notifications" ) );
+
+        this.circuitBreaker = circuitBreaker;
+        circuitBreaker.addPropertyChangeListener( new PropertyChangeListener()
+        {
+            long sequenceNr = System.currentTimeMillis();
+
+            @Override
+            public void propertyChange( PropertyChangeEvent evt )
+            {
+                Notification notification = new Notification( evt.getPropertyName(), mbeanObjectName, sequenceNr++, System
+                    .currentTimeMillis(), evt.getNewValue().toString() );
+                sendNotification( notification );
+            }
+        } );
+    }
+
+    @Override
+    public String getStatus()
+    {
+        return circuitBreaker.status().name();
+    }
+
+    @Override
+    public int getThreshold()
+    {
+        return circuitBreaker.threshold();
+    }
+
+    @Override
+    public double getServiceLevel()
+    {
+        return circuitBreaker.serviceLevel();
+    }
+
+    @Override
+    public String getLastErrorMessage()
+    {
+        return circuitBreaker.lastThrowable() == null ? "" : errorMessage( circuitBreaker.lastThrowable() );
+    }
+
+    private String errorMessage( Throwable throwable )
+    {
+        String message = throwable.getMessage();
+        if( message == null )
+        {
+            message = throwable.getClass().getSimpleName();
+        }
+
+        if( throwable.getCause() != null )
+        {
+            return message + ":" + errorMessage( throwable.getCause() );
+        }
+        else
+        {
+            return message;
+        }
+    }
+
+    @Override
+    public String getTrippedOn()
+    {
+        return circuitBreaker.trippedOn().toString();
+    }
+
+    @Override
+    public String getEnableOn()
+    {
+        return circuitBreaker.enabledOn().toString();
+    }
+
+    @Override
+    public String turnOn()
+    {
+        try
+        {
+            circuitBreaker.turnOn();
+            return "Circuit breaker has been turned on";
+        }
+        catch( PropertyVetoException e )
+        {
+            return "Could not turn on circuit breaker:" + getLastErrorMessage();
+        }
+    }
+
+    @Override
+    public void trip()
+    {
+        circuitBreaker.trip();
+    }
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/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 3b15258..437cfa6 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
@@ -17,10 +17,10 @@
  */
 package org.qi4j.library.conversion.values;
 
-import java.util.Calendar;
-import java.util.Date;
+import java.time.ZoneId;
+import java.time.ZonedDateTime;
+import java.time.temporal.ChronoUnit;
 import java.util.List;
-import java.util.TimeZone;
 import java.util.function.Function;
 import org.junit.Test;
 import org.qi4j.api.association.Association;
@@ -213,7 +213,7 @@ public class EntityToValueTest
     {
         String firstName = "Niclas";
         String lastName = "Hedhman";
-        Date birthTime = createBirthDate( 1964, 9, 25 );
+        ZonedDateTime birthTime = createBirthDate( 1964, 9, 25 );
         return createPerson( uow, firstName, lastName, birthTime );
     }
 
@@ -221,7 +221,7 @@ public class EntityToValueTest
     {
         String firstName = "Lis";
         String lastName = "Gazi";
-        Date birthTime = createBirthDate( 1976, 2, 19 );
+        ZonedDateTime birthTime = createBirthDate( 1976, 2, 19 );
         return createPerson( uow, firstName, lastName, birthTime );
     }
 
@@ -229,11 +229,11 @@ public class EntityToValueTest
     {
         String firstName = "Eric";
         String lastName = "Hedman";
-        Date birthTime = createBirthDate( 2004, 4, 8 );
+        ZonedDateTime birthTime = createBirthDate( 2004, 4, 8 );
         return createPerson( uow, firstName, lastName, birthTime );
     }
 
-    private PersonEntity createPerson( UnitOfWork uow, String firstName, String lastName, Date birthTime )
+    private PersonEntity createPerson( UnitOfWork uow, String firstName, String lastName, ZonedDateTime birthTime )
     {
         EntityBuilder<PersonEntity> builder = uow.newEntityBuilder( PersonEntity.class, "id:" + firstName );
         PersonState state = builder.instanceFor( PersonState.class );
@@ -243,12 +243,9 @@ public class EntityToValueTest
         return builder.newInstance();
     }
 
-    private Date createBirthDate( int year, int month, int day )
+    private ZonedDateTime createBirthDate( int year, int month, int day )
     {
-        Calendar calendar = Calendar.getInstance();
-        calendar.setTimeZone( TimeZone.getTimeZone( "UTC" ) );
-        calendar.set( year, month - 1, day, 12, 0, 0 );
-        return calendar.getTime();
+        return ZonedDateTime.of( year, month, day, 0, 0, 0, 0, ZoneId.systemDefault() );
     }
 
     // START SNIPPET: state
@@ -259,7 +256,7 @@ public class EntityToValueTest
 
         Property<String> lastName();
 
-        Property<Date> dateOfBirth();
+        Property<ZonedDateTime> dateOfBirth();
 
     }
     // END SNIPPET: state
@@ -322,9 +319,7 @@ public class EntityToValueTest
         @Override
         public Integer age()
         {
-            long now = System.currentTimeMillis();
-            long birthdate = state.dateOfBirth().get().getTime();
-            return (int) ( ( now - birthdate ) / 1000 / 3600 / 24 / 365.25 );
+            return (int) state.dateOfBirth().get().until(ZonedDateTime.now(), ChronoUnit.YEARS );
         }
 
         // START SNIPPET: entity
@@ -341,7 +336,7 @@ public class EntityToValueTest
 
         Property<String> lastName();
 
-        Property<Date> dateOfBirth();
+        Property<ZonedDateTime> dateOfBirth();
 
         @Optional
         Property<String> spouse();
@@ -361,7 +356,7 @@ public class EntityToValueTest
 
         Property<String> lastName();
 
-        Property<Date> dateOfBirth();
+        Property<ZonedDateTime> dateOfBirth();
 
         @Optional
         Property<String> spouse();
@@ -380,7 +375,7 @@ public class EntityToValueTest
 
         Property<String> lastName();
 
-        Property<Date> dateOfBirth();
+        Property<ZonedDateTime> dateOfBirth();
 
         @Optional
         Property<String> spouse();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/cxf/src/test/java/org/qi4j/library/cxf/divs/DividendsTest.java
----------------------------------------------------------------------
diff --git a/libraries/cxf/src/test/java/org/qi4j/library/cxf/divs/DividendsTest.java b/libraries/cxf/src/test/java/org/qi4j/library/cxf/divs/DividendsTest.java
index 19e4c42..bb2492f 100644
--- a/libraries/cxf/src/test/java/org/qi4j/library/cxf/divs/DividendsTest.java
+++ b/libraries/cxf/src/test/java/org/qi4j/library/cxf/divs/DividendsTest.java
@@ -21,7 +21,7 @@ package org.qi4j.library.cxf.divs;
 import java.io.BufferedReader;
 import java.io.InputStream;
 import java.io.InputStreamReader;
-import java.util.Date;
+import java.time.LocalDate;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;
 import org.apache.http.client.HttpClient;
@@ -47,7 +47,7 @@ public class DividendsTest
         "<issueId>PC10YZNZC100</issueId>" +
         "<divPoints>" +
         "<ns3:anyType xmlns:ns3=\"http://cxf.apache.org/arrays\" xsi:type=\"ns2:DivPoint\">" +
-        "<updateTS>" + new Date( 2010, 10, 10 ).toString() + "</updateTS>" +
+        "<updateTS>" + LocalDate.of( 2010, 10, 10 ) + "</updateTS>" +
         "<divTypeCD></divTypeCD>" +
         "<valCcy>USD</valCcy>" +
         "<recType>A</recType>" +
@@ -62,7 +62,7 @@ public class DividendsTest
         "<lastUpdater>niclas</lastUpdater>" +
         "</ns3:anyType>" +
         "<ns3:anyType xmlns:ns3=\"http://cxf.apache.org/arrays\" xsi:type=\"ns2:DivPoint\">" +
-        "<updateTS>" + new Date( 2010, 10, 10 ).toString() + "</updateTS>" +
+        "<updateTS>" + LocalDate.of( 2010, 10, 10 ) + "</updateTS>" +
         "<divTypeCD></divTypeCD>" +
         "<valCcy>USD</valCcy>" +
         "<recType>A</recType>" +
@@ -77,9 +77,9 @@ public class DividendsTest
         "<lastUpdater>niclas</lastUpdater>" +
         "</ns3:anyType>" +
         "</divPoints>" +
-        "<systemUpdateTS>" + new Date( 2010, 10, 10 ).toString() + "</systemUpdateTS>" +
+        "<systemUpdateTS>" + LocalDate.of( 2010, 10, 10 ) + "</systemUpdateTS>" +
         "<streamName>PRIVATE_niclas</streamName>" +
-        "<userUpdateTS>" + new Date( 2010, 10, 10 ).toString() + "</userUpdateTS>" +
+        "<userUpdateTS>" + LocalDate.of( 2010, 10, 10 ) + "</userUpdateTS>" +
         "<consolidate>N</consolidate>" +
         "<mdSymbol>bt.l</mdSymbol>" +
         "</ns1:value>" +

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/cxf/src/test/java/org/qi4j/library/cxf/divs/ProjectedDividends.java
----------------------------------------------------------------------
diff --git a/libraries/cxf/src/test/java/org/qi4j/library/cxf/divs/ProjectedDividends.java b/libraries/cxf/src/test/java/org/qi4j/library/cxf/divs/ProjectedDividends.java
index 6736b69..dae45d2 100644
--- a/libraries/cxf/src/test/java/org/qi4j/library/cxf/divs/ProjectedDividends.java
+++ b/libraries/cxf/src/test/java/org/qi4j/library/cxf/divs/ProjectedDividends.java
@@ -18,8 +18,8 @@
 
 package org.qi4j.library.cxf.divs;
 
+import java.time.LocalDate;
 import java.util.ArrayList;
-import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -75,8 +75,8 @@ public interface ProjectedDividends
             prototype.divPoints().set( divPoints );
             prototype.consolidate().set( "N" );
             prototype.streamName().set( "PRIVATE_niclas" );
-            prototype.systemUpdateTS().set( new Date( 2010, 10, 10 ).toString() );
-            prototype.userUpdateTS().set( new Date( 2010, 10, 10 ).toString() );
+            prototype.systemUpdateTS().set( LocalDate.of( 2010, 10, 10 ).toString() );
+            prototype.userUpdateTS().set( LocalDate.of( 2010, 10, 10 ).toString() );
             prototype.issueId().set( "PC10YZNZC100" );
             prototype.mdSymbol().set( "bt.l" );
             return builder.newInstance();
@@ -99,7 +99,7 @@ public interface ProjectedDividends
             prototype.paydate().set( createRandomDate() );
             prototype.divTypeCD().set( "" );
             prototype.comment().set( "Silly comment" );
-            prototype.updateTS().set( new Date( 2010, 10, 10 ).toString() );
+            prototype.updateTS().set( LocalDate.of( 2010, 10, 10 ).toString() );
             prototype.lastUpdater().set( "niclas" );
             return builder.newInstance();
         }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/eventsourcing-rest/src/main/java/org/qi4j/library/eventsourcing/domain/rest/server/DomainEventSourceResource.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing-rest/src/main/java/org/qi4j/library/eventsourcing/domain/rest/server/DomainEventSourceResource.java b/libraries/eventsourcing-rest/src/main/java/org/qi4j/library/eventsourcing/domain/rest/server/DomainEventSourceResource.java
index 4c59747..083694d 100644
--- a/libraries/eventsourcing-rest/src/main/java/org/qi4j/library/eventsourcing/domain/rest/server/DomainEventSourceResource.java
+++ b/libraries/eventsourcing-rest/src/main/java/org/qi4j/library/eventsourcing/domain/rest/server/DomainEventSourceResource.java
@@ -189,8 +189,8 @@ public class DomainEventSourceResource
         {
             Entry entry = new Entry();
             entry.setTitle( new Text( eventsValue.usecase().get() + "(" + eventsValue.user().get() + ")" ) );
-            entry.setPublished( new Date( eventsValue.timestamp().get() ) );
-            entry.setModificationDate( lastModified = new Date( eventsValue.timestamp().get() ) );
+            entry.setPublished( new Date( eventsValue.timestamp().get().toEpochMilli() ) );
+            entry.setModificationDate( lastModified = new Date( eventsValue.timestamp().get().toEpochMilli() ) );
             entry.setId( Long.toString( startEvent + 1 ) );
             startEvent++;
             Content content = new Content();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/api/ApplicationEvent.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/api/ApplicationEvent.java b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/api/ApplicationEvent.java
index efd02d8..88df274 100644
--- a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/api/ApplicationEvent.java
+++ b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/api/ApplicationEvent.java
@@ -16,7 +16,7 @@
 
 package org.qi4j.library.eventsourcing.application.api;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.qi4j.api.entity.Identity;
 import org.qi4j.api.property.Property;
 import org.qi4j.api.value.ValueComposite;
@@ -37,7 +37,7 @@ import org.qi4j.api.value.ValueComposite;
  * </p>
  */
 public interface ApplicationEvent
-        extends ValueComposite, Identity
+    extends ValueComposite, Identity
 {
     // Usecase
     Property<String> usecase();
@@ -46,7 +46,7 @@ public interface ApplicationEvent
     Property<String> name();
 
     // When the event was created
-    Property<Date> on();
+    Property<ZonedDateTime> on();
 
     // Method parameters as JSON
     Property<String> parameters();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/factory/ApplicationEventFactoryService.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/factory/ApplicationEventFactoryService.java b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/factory/ApplicationEventFactoryService.java
index 675f6ba..393043a 100644
--- a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/factory/ApplicationEventFactoryService.java
+++ b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/factory/ApplicationEventFactoryService.java
@@ -16,7 +16,7 @@
 
 package org.qi4j.library.eventsourcing.application.factory;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.json.JSONException;
 import org.json.JSONObject;
 import org.json.JSONStringer;
@@ -73,7 +73,7 @@ public interface ApplicationEventFactoryService
 
             ApplicationEvent prototype = builder.prototype();
             prototype.name().set( name );
-            prototype.on().set( new Date() );
+            prototype.on().set( ZonedDateTime.now() );
 
             prototype.identity().set( idGenerator.generate( ApplicationEvent.class ) );
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/replay/ApplicationEventPlayerService.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/replay/ApplicationEventPlayerService.java b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/replay/ApplicationEventPlayerService.java
index 51f892e..01ae017 100644
--- a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/replay/ApplicationEventPlayerService.java
+++ b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/replay/ApplicationEventPlayerService.java
@@ -18,8 +18,20 @@ package org.qi4j.library.eventsourcing.application.replay;
 
 import java.lang.reflect.Method;
 import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
+import java.time.Duration;
+import java.time.Instant;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.MonthDay;
+import java.time.OffsetDateTime;
+import java.time.OffsetTime;
+import java.time.Period;
+import java.time.Year;
+import java.time.YearMonth;
+import java.time.ZoneId;
+import java.time.ZoneOffset;
+import java.time.ZonedDateTime;
 import org.json.JSONObject;
 import org.json.JSONTokener;
 import org.qi4j.api.Qi4j;
@@ -54,8 +66,6 @@ public interface ApplicationEventPlayerService
         @Structure
         Qi4j api;
 
-        SimpleDateFormat dateFormat = new SimpleDateFormat( "EEE MMM dd HH:mm:ss zzz yyyy" );
-
         @Override
         public void playEvent( ApplicationEvent applicationEvent, Object object )
                 throws ApplicationEventReplayException
@@ -118,9 +128,48 @@ public interface ApplicationEventPlayerService
             } else if (parameterType.equals( Integer.class ) || parameterType.equals( Integer.TYPE ))
             {
                 return ((Number) value).intValue();
-            } else if (parameterType.equals( Date.class ))
+            } else if (parameterType.equals( LocalDate.class ))
+            {
+                return LocalDate.parse( (String) value );
+            } else if (parameterType.equals( LocalDateTime.class ))
+            {
+                return LocalDateTime.parse( (String) value );
+            } else if (parameterType.equals( LocalTime.class ))
+            {
+                return LocalTime.parse( (String) value );
+            } else if (parameterType.equals( OffsetTime.class ))
+            {
+                return OffsetTime.parse( (String) value );
+            } else if (parameterType.equals( OffsetDateTime.class ))
+            {
+                return OffsetDateTime.parse( (String) value );
+            } else if (parameterType.equals( ZonedDateTime.class ))
+            {
+                return ZonedDateTime.parse( (String) value );
+            } else if (parameterType.equals( ZoneId.class ))
+            {
+                return ZoneId.of( (String) value );
+            } else if (parameterType.equals( ZoneOffset.class ))
+            {
+                return ZoneOffset.of( (String) value );
+            } else if (parameterType.equals( MonthDay.class ))
+            {
+                return MonthDay.parse( (String) value );
+            } else if (parameterType.equals( YearMonth.class ))
+            {
+                return YearMonth.parse( (String) value );
+            } else if (parameterType.equals( Year.class ))
+            {
+                return Year.parse( (String) value );
+            } else if (parameterType.equals( Instant.class ))
+            {
+                return Instant.parse( (String) value );
+            } else if (parameterType.equals( Duration.class ))
+            {
+                return Duration.parse( (String) value );
+            } else if (parameterType.equals( Period.class ))
             {
-                return dateFormat.parse( (String) value );
+                return Period.parse( (String) value );
             } else if (ValueComposite.class.isAssignableFrom( parameterType ))
             {
                 return module.newValueFromSerializedState( parameterType, (String) value );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/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 c79f130..c2d1d13 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
@@ -17,8 +17,8 @@
 package org.qi4j.library.eventsourcing.application.source.helper;
 
 import java.lang.reflect.Method;
+import java.time.ZonedDateTime;
 import java.util.ArrayList;
-import java.util.Date;
 import java.util.List;
 import java.util.function.Function;
 import java.util.function.Predicate;
@@ -114,26 +114,26 @@ public class ApplicationEvents
         }, Iterables.toList( Methods.METHODS_OF.apply( eventClass ) ) ));
     }
 
-    public static Predicate<ApplicationEvent> afterDate( final Date afterDate )
+    public static Predicate<ApplicationEvent> afterDate( final ZonedDateTime afterDate )
     {
         return new Predicate<ApplicationEvent>()
         {
             @Override
             public boolean test( ApplicationEvent event )
             {
-                return event.on().get().after( afterDate );
+                return event.on().get().isAfter( afterDate );
             }
         };
     }
 
-    public static Predicate<ApplicationEvent> beforeDate( final Date beforeDate )
+    public static Predicate<ApplicationEvent> beforeDate( final ZonedDateTime beforeDate )
     {
         return new Predicate<ApplicationEvent>()
         {
             @Override
             public boolean test( ApplicationEvent event )
             {
-                return event.on().get().before( beforeDate );
+                return event.on().get().isBefore( beforeDate );
             }
         };
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/api/UnitOfWorkDomainEventsValue.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/api/UnitOfWorkDomainEventsValue.java b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/api/UnitOfWorkDomainEventsValue.java
index a587ac8..c81a8d1 100644
--- a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/api/UnitOfWorkDomainEventsValue.java
+++ b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/api/UnitOfWorkDomainEventsValue.java
@@ -17,6 +17,8 @@
 
 package org.qi4j.library.eventsourcing.domain.api;
 
+import java.time.Instant;
+import java.time.ZonedDateTime;
 import java.util.List;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.common.UseDefaults;
@@ -41,7 +43,7 @@ public interface UnitOfWorkDomainEventsValue
     Property<String> usecase();
 
     // When the event occurred
-    Property<Long> timestamp();
+    Property<Instant> timestamp();
 
     // Who performed the event. Taken from CurrentUser service.
     @Optional

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/factory/UnitOfWorkNotificationConcern.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/factory/UnitOfWorkNotificationConcern.java b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/factory/UnitOfWorkNotificationConcern.java
index fda2a61..84ece96 100644
--- a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/factory/UnitOfWorkNotificationConcern.java
+++ b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/factory/UnitOfWorkNotificationConcern.java
@@ -18,6 +18,7 @@
 package org.qi4j.library.eventsourcing.domain.factory;
 
 import java.io.IOException;
+import java.time.Instant;
 import org.qi4j.api.Qi4j;
 import org.qi4j.api.concern.ConcernOf;
 import org.qi4j.api.entity.EntityComposite;
@@ -111,7 +112,7 @@ public class UnitOfWorkNotificationConcern
 
                         ValueBuilder<UnitOfWorkDomainEventsValue> builder = vbf.newValueBuilder( UnitOfWorkDomainEventsValue.class );
                         builder.prototype().user().set( user );
-                        builder.prototype().timestamp().set( System.currentTimeMillis() );
+                        builder.prototype().timestamp().set( Instant.now() );
                         builder.prototype().usecase().set( unitOfWork.usecase().name() );
                         builder.prototype().version().set( version );
                         builder.prototype().events().get().addAll( events.getEventValues() );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/replay/DomainEventPlayerService.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/replay/DomainEventPlayerService.java b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/replay/DomainEventPlayerService.java
index c51cf5c..449beab 100644
--- a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/replay/DomainEventPlayerService.java
+++ b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/replay/DomainEventPlayerService.java
@@ -18,9 +18,20 @@
 package org.qi4j.library.eventsourcing.domain.replay;
 
 import java.lang.reflect.Method;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
+import java.time.Duration;
+import java.time.Instant;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.MonthDay;
+import java.time.OffsetDateTime;
+import java.time.OffsetTime;
+import java.time.Period;
+import java.time.Year;
+import java.time.YearMonth;
+import java.time.ZoneId;
+import java.time.ZoneOffset;
+import java.time.ZonedDateTime;
 import org.json.JSONObject;
 import org.json.JSONTokener;
 import org.qi4j.api.entity.EntityComposite;
@@ -43,12 +54,12 @@ import org.slf4j.LoggerFactory;
 /**
  * DomainEventValue player
  */
-@Mixins(DomainEventPlayerService.Mixin.class)
+@Mixins( DomainEventPlayerService.Mixin.class )
 public interface DomainEventPlayerService
-        extends DomainEventPlayer, ServiceComposite
+    extends DomainEventPlayer, ServiceComposite
 {
     class Mixin
-            implements DomainEventPlayer
+        implements DomainEventPlayer
     {
         final Logger logger = LoggerFactory.getLogger( DomainEventPlayer.class );
 
@@ -61,17 +72,15 @@ public interface DomainEventPlayerService
         @Structure
         Qi4jSPI spi;
 
-        SimpleDateFormat dateFormat = new SimpleDateFormat( "EEE MMM dd HH:mm:ss zzz yyyy" );
-
         @Override
         public void playTransaction( UnitOfWorkDomainEventsValue unitOfWorkDomainValue )
-                throws EventReplayException
+            throws EventReplayException
         {
             UnitOfWork uow = uowf.newUnitOfWork( UsecaseBuilder.newUsecase( "Event replay" ) );
             DomainEventValue currentEventValue = null;
             try
             {
-                for (DomainEventValue domainEventValue : unitOfWorkDomainValue.events().get())
+                for( DomainEventValue domainEventValue : unitOfWorkDomainValue.events().get() )
                 {
                     currentEventValue = domainEventValue;
                     // Get the entity
@@ -81,7 +90,8 @@ public interface DomainEventPlayerService
                     try
                     {
                         entity = uow.get( entityType, id );
-                    } catch( NoSuchEntityException e )
+                    }
+                    catch( NoSuchEntityException e )
                     {
                         // Event to play for an entity that doesn't yet exist - create a default instance
                         entity = uow.newEntity( entityType, id );
@@ -89,7 +99,7 @@ public interface DomainEventPlayerService
 
                     // check if the event has already occured
                     EntityState state = spi.entityStateOf( (EntityComposite) entity );
-                    if (state.lastModified() > unitOfWorkDomainValue.timestamp().get())
+                    if( state.lastModified().isAfter( unitOfWorkDomainValue.timestamp().get() ) )
                     {
                         break; // don't rerun event in this unitOfWorkDomainValue
                     }
@@ -97,19 +107,24 @@ public interface DomainEventPlayerService
                     playEvent( domainEventValue, entity );
                 }
                 uow.complete();
-            } catch (Exception e)
+            }
+            catch( Exception e )
             {
                 uow.discard();
-                if (e instanceof EventReplayException)
-                    throw ((EventReplayException) e);
+                if( e instanceof EventReplayException )
+                {
+                    throw ( (EventReplayException) e );
+                }
                 else
+                {
                     throw new EventReplayException( currentEventValue, e );
+                }
             }
         }
 
         @Override
         public void playEvent( DomainEventValue domainEventValue, Object object )
-                throws EventReplayException
+            throws EventReplayException
         {
             UnitOfWork uow = uowf.currentUnitOfWork();
             Class entityType = object.getClass();
@@ -117,9 +132,10 @@ public interface DomainEventPlayerService
             // Get method
             Method eventMethod = getEventMethod( entityType, domainEventValue.name().get() );
 
-            if (eventMethod == null)
+            if( eventMethod == null )
             {
-                logger.warn( "Could not find event method " + domainEventValue.name().get() + " in entity of type " + entityType.getName() );
+                logger.warn( "Could not find event method " + domainEventValue.name()
+                    .get() + " in entity of type " + entityType.getName() );
                 return;
             }
 
@@ -128,60 +144,123 @@ public interface DomainEventPlayerService
             {
                 String jsonParameters = domainEventValue.parameters().get();
                 JSONObject parameters = (JSONObject) new JSONTokener( jsonParameters ).nextValue();
-                Object[] args = new Object[eventMethod.getParameterTypes().length];
-                for (int i = 1; i < eventMethod.getParameterTypes().length; i++)
+                Object[] args = new Object[ eventMethod.getParameterTypes().length ];
+                for( int i = 1; i < eventMethod.getParameterTypes().length; i++ )
                 {
-                    Class<?> parameterType = eventMethod.getParameterTypes()[i];
+                    Class<?> parameterType = eventMethod.getParameterTypes()[ i ];
 
                     String paramName = "param" + i;
 
                     Object value = parameters.get( paramName );
 
-                    args[i] = getParameterArgument( parameterType, value, uow );
+                    args[ i ] = getParameterArgument( parameterType, value, uow );
                 }
 
-                args[0] = domainEventValue;
+                args[ 0 ] = domainEventValue;
 
                 // Invoke method
                 logger.debug( "Replay:" + domainEventValue + " on:" + object );
 
                 eventMethod.invoke( object, args );
-            } catch (Exception e)
+            }
+            catch( Exception e )
             {
                 throw new EventReplayException( domainEventValue, e );
             }
         }
 
-        private Object getParameterArgument( Class<?> parameterType, Object value, UnitOfWork uow ) throws ParseException
+        private Object getParameterArgument( Class<?> parameterType, Object value, UnitOfWork uow )
         {
-            if (value.equals( JSONObject.NULL ))
+            if( value.equals( JSONObject.NULL ) )
+            {
                 return null;
+            }
 
-            if (parameterType.equals( String.class ))
+            if( parameterType.equals( String.class ) )
             {
                 return (String) value;
-            } else if (parameterType.equals( Boolean.class ) || parameterType.equals( Boolean.TYPE ))
+            }
+            else if( parameterType.equals( Boolean.class ) || parameterType.equals( Boolean.TYPE ) )
             {
                 return (Boolean) value;
-            } else if (parameterType.equals( Long.class ) || parameterType.equals( Long.TYPE ))
+            }
+            else if( parameterType.equals( Long.class ) || parameterType.equals( Long.TYPE ) )
+            {
+                return ( (Number) value ).longValue();
+            }
+            else if( parameterType.equals( Integer.class ) || parameterType.equals( Integer.TYPE ) )
+            {
+                return ( (Number) value ).intValue();
+            }
+            else if( parameterType.equals( LocalDate.class ) )
+            {
+                return LocalDate.parse( (String) value );
+            }
+            else if( parameterType.equals( LocalDateTime.class ) )
+            {
+                return LocalDateTime.parse( (String) value );
+            }
+            else if( parameterType.equals( LocalTime.class ) )
+            {
+                return LocalTime.parse( (String) value );
+            }
+            else if( parameterType.equals( OffsetTime.class ) )
+            {
+                return OffsetTime.parse( (String) value );
+            }
+            else if( parameterType.equals( OffsetDateTime.class ) )
+            {
+                return OffsetDateTime.parse( (String) value );
+            }
+            else if( parameterType.equals( ZonedDateTime.class ) )
+            {
+                return ZonedDateTime.parse( (String) value );
+            }
+            else if( parameterType.equals( Instant.class ) )
+            {
+                return Instant.parse( (String) value );
+            }
+            else if( parameterType.equals( Period.class ) )
+            {
+                return Period.parse( (String) value );
+            }
+            else if( parameterType.equals( Duration.class ) )
             {
-                return ((Number) value).longValue();
-            } else if (parameterType.equals( Integer.class ) || parameterType.equals( Integer.TYPE ))
+                return Duration.parse( (String) value );
+            }
+            else if( parameterType.equals( MonthDay.class ) )
             {
-                return ((Number) value).intValue();
-            } else if (parameterType.equals( Date.class ))
+                return MonthDay.parse( (String) value );
+            }
+            else if( parameterType.equals( YearMonth.class ) )
             {
-                return dateFormat.parse( (String) value );
-            } else if (ValueComposite.class.isAssignableFrom( parameterType ))
+                return YearMonth.parse( (String) value );
+            }
+            else if( parameterType.equals( Year.class ) )
+            {
+                return Year.parse( (String) value );
+            }
+            else if( parameterType.equals( ZoneId.class ) )
+            {
+                return ZoneId.of( (String) value );
+            }
+            else if( parameterType.equals( ZoneOffset.class ) )
+            {
+                return ZoneOffset.of( (String) value );
+            }
+            else if( ValueComposite.class.isAssignableFrom( parameterType ) )
             {
                 return module.newValueFromSerializedState( parameterType, (String) value );
-            } else if (parameterType.isInterface())
+            }
+            else if( parameterType.isInterface() )
             {
                 return uow.get( parameterType, (String) value );
-            } else if (parameterType.isEnum())
+            }
+            else if( parameterType.isEnum() )
             {
                 return Enum.valueOf( (Class<? extends Enum>) parameterType, value.toString() );
-            } else
+            }
+            else
             {
                 throw new IllegalArgumentException( "Unknown parameter type:" + parameterType.getName() );
             }
@@ -189,13 +268,15 @@ public interface DomainEventPlayerService
 
         private Method getEventMethod( Class<?> aClass, String eventName )
         {
-            for (Method method : aClass.getMethods())
+            for( Method method : aClass.getMethods() )
             {
-                if (method.getName().equals( eventName ))
+                if( method.getName().equals( eventName ) )
                 {
                     Class[] parameterTypes = method.getParameterTypes();
-                    if (parameterTypes.length > 0 && parameterTypes[0].equals( DomainEventValue.class ))
+                    if( parameterTypes.length > 0 && parameterTypes[ 0 ].equals( DomainEventValue.class ) )
+                    {
                         return method;
+                    }
                 }
             }
             return null;

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/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 3d1d1a0..f0dcd6f 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
@@ -17,7 +17,7 @@
 package org.qi4j.library.eventsourcing.domain.source.helper;
 
 import java.lang.reflect.Method;
-import java.util.Date;
+import java.time.ZonedDateTime;
 import java.util.function.Function;
 import java.util.function.Predicate;
 import org.qi4j.api.util.Methods;
@@ -50,26 +50,26 @@ public class Events
     }
 
     // Common specifications
-    public static Predicate<UnitOfWorkDomainEventsValue> afterDate( final Date afterDate )
+    public static Predicate<UnitOfWorkDomainEventsValue> afterDate( final ZonedDateTime afterDate )
     {
         return new Predicate<UnitOfWorkDomainEventsValue>()
         {
             @Override
             public boolean test( UnitOfWorkDomainEventsValue eventValue )
             {
-                return eventValue.timestamp().get() > afterDate.getTime();
+                return eventValue.timestamp().get().isAfter( afterDate.toInstant() );
             }
         };
     }
 
-    public static Predicate<UnitOfWorkDomainEventsValue> beforeDate( final Date afterDate )
+    public static Predicate<UnitOfWorkDomainEventsValue> beforeDate( final ZonedDateTime beforeDate )
     {
         return new Predicate<UnitOfWorkDomainEventsValue>()
         {
             @Override
             public boolean test( UnitOfWorkDomainEventsValue eventValue )
             {
-                return eventValue.timestamp().get() < afterDate.getTime();
+                return eventValue.timestamp().get().isBefore( beforeDate.toInstant() );
             }
         };
     }
@@ -81,10 +81,12 @@ public class Events
             @Override
             public boolean test( UnitOfWorkDomainEventsValue eventValue )
             {
-                for (String name : names)
+                for( String name : names )
                 {
-                    if (eventValue.usecase().get().equals( name ))
+                    if( eventValue.usecase().get().equals( name ) )
+                    {
                         return true;
+                    }
                 }
                 return false;
             }
@@ -98,10 +100,12 @@ public class Events
             @Override
             public boolean test( UnitOfWorkDomainEventsValue eventValue )
             {
-                for (String user : by)
+                for( String user : by )
                 {
-                    if (eventValue.user().get().equals( user ))
+                    if( eventValue.user().get().equals( user ) )
+                    {
                         return true;
+                    }
                 }
                 return false;
             }
@@ -115,10 +119,12 @@ public class Events
             @Override
             public boolean test( DomainEventValue eventValue )
             {
-                for (String name : names)
+                for( String name : names )
                 {
-                    if (eventValue.name().get().equals( name ))
+                    if( eventValue.name().get().equals( name ) )
+                    {
                         return true;
+                    }
                 }
                 return false;
             }
@@ -132,10 +138,12 @@ public class Events
             @Override
             public boolean test( DomainEventValue eventValue )
             {
-                for (String name : names)
+                for( String name : names )
                 {
-                    if (eventValue.name().get().equals( name ))
+                    if( eventValue.name().get().equals( name ) )
+                    {
                         return true;
+                    }
                 }
                 return false;
             }
@@ -151,7 +159,7 @@ public class Events
             {
                 return method.getName();
             }
-        }, Iterables.toList( Methods.METHODS_OF.apply( eventClass ) ) ));
+        }, Iterables.toList( Methods.METHODS_OF.apply( eventClass ) ) ) );
     }
 
     public static Predicate<DomainEventValue> onEntities( final String... entities )
@@ -161,10 +169,12 @@ public class Events
             @Override
             public boolean test( DomainEventValue eventValue )
             {
-                for (String entity : entities)
+                for( String entity : entities )
                 {
-                    if (eventValue.entityId().get().equals( entity ))
+                    if( eventValue.entityId().get().equals( entity ) )
+                    {
                         return true;
+                    }
                 }
                 return false;
             }
@@ -178,10 +188,12 @@ public class Events
             @Override
             public boolean test( DomainEventValue eventValue )
             {
-                for (String entityType : entityTypes)
+                for( String entityType : entityTypes )
                 {
-                    if (eventValue.entityType().get().equals( entityType ))
+                    if( eventValue.entityType().get().equals( entityType ) )
+                    {
                         return true;
+                    }
                 }
                 return false;
             }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/eventsourcing/src/test/java/org/qi4j/library/eventsourcing/domain/source/helper/EventRouterTest.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/test/java/org/qi4j/library/eventsourcing/domain/source/helper/EventRouterTest.java b/libraries/eventsourcing/src/test/java/org/qi4j/library/eventsourcing/domain/source/helper/EventRouterTest.java
index 76921fd..08c733f 100644
--- a/libraries/eventsourcing/src/test/java/org/qi4j/library/eventsourcing/domain/source/helper/EventRouterTest.java
+++ b/libraries/eventsourcing/src/test/java/org/qi4j/library/eventsourcing/domain/source/helper/EventRouterTest.java
@@ -16,6 +16,7 @@
 package org.qi4j.library.eventsourcing.domain.source.helper;
 
 import java.io.IOException;
+import java.time.Instant;
 import java.util.ArrayList;
 import java.util.List;
 import org.json.JSONException;
@@ -59,7 +60,7 @@ public class EventRouterTest
             builder.prototype().events().get().add( newDomainEvent( assembler, "Test2" ) );
             builder.prototype().events().get().add( newDomainEvent( assembler, "Test3" ) );
             builder.prototype().version().set( "1.0" );
-            builder.prototype().timestamp().set( System.currentTimeMillis() );
+            builder.prototype().timestamp().set( Instant.now() );
             builder.prototype().usecase().set( "Test" );
             list.add( builder.newInstance() );
         }
@@ -69,7 +70,7 @@ public class EventRouterTest
             builder.prototype().events().get().add( newDomainEvent( assembler, "Test5" ) );
             builder.prototype().events().get().add( newDomainEvent( assembler, "Test6" ) );
             builder.prototype().version().set( "1.0" );
-            builder.prototype().timestamp().set( System.currentTimeMillis() );
+            builder.prototype().timestamp().set( Instant.now() );
             builder.prototype().usecase().set( "Test2" );
             list.add( builder.newInstance() );
         }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/eventsourcing/src/test/java/org/qi4j/library/eventsourcing/domain/source/helper/EventsTest.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/test/java/org/qi4j/library/eventsourcing/domain/source/helper/EventsTest.java b/libraries/eventsourcing/src/test/java/org/qi4j/library/eventsourcing/domain/source/helper/EventsTest.java
index 12ce6ac..3d81e40 100644
--- a/libraries/eventsourcing/src/test/java/org/qi4j/library/eventsourcing/domain/source/helper/EventsTest.java
+++ b/libraries/eventsourcing/src/test/java/org/qi4j/library/eventsourcing/domain/source/helper/EventsTest.java
@@ -1,5 +1,6 @@
 package org.qi4j.library.eventsourcing.domain.source.helper;
 
+import java.time.Instant;
 import org.junit.Before;
 import org.junit.Test;
 import org.qi4j.api.activation.ActivationException;
@@ -47,7 +48,7 @@ public class EventsTest
             builder.prototype().events().get().add( newDomainEvent( assembler, "Test2" ) );
             builder.prototype().events().get().add( newDomainEvent( assembler, "Test3" ) );
             builder.prototype().version().set( "1.0" );
-            builder.prototype().timestamp().set( System.currentTimeMillis() );
+            builder.prototype().timestamp().set( Instant.now() );
             builder.prototype().usecase().set( "Test" );
             list.add( builder.newInstance() );
         }
@@ -57,7 +58,7 @@ public class EventsTest
             builder.prototype().events().get().add( newDomainEvent( assembler, "Test5" ) );
             builder.prototype().events().get().add( newDomainEvent( assembler, "Test6" ) );
             builder.prototype().version().set( "1.0" );
-            builder.prototype().timestamp().set( System.currentTimeMillis() );
+            builder.prototype().timestamp().set( Instant.now() );
             builder.prototype().usecase().set( "Test2" );
             list.add( builder.newInstance() );
         }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/eventsourcing/src/test/java/org/qi4j/library/eventsourcing/domain/source/helper/UnitOfWorkRouterTest.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/test/java/org/qi4j/library/eventsourcing/domain/source/helper/UnitOfWorkRouterTest.java b/libraries/eventsourcing/src/test/java/org/qi4j/library/eventsourcing/domain/source/helper/UnitOfWorkRouterTest.java
index f3286ff..89d7333 100644
--- a/libraries/eventsourcing/src/test/java/org/qi4j/library/eventsourcing/domain/source/helper/UnitOfWorkRouterTest.java
+++ b/libraries/eventsourcing/src/test/java/org/qi4j/library/eventsourcing/domain/source/helper/UnitOfWorkRouterTest.java
@@ -1,5 +1,6 @@
 package org.qi4j.library.eventsourcing.domain.source.helper;
 
+import java.time.Instant;
 import org.hamcrest.CoreMatchers;
 import org.junit.Assert;
 import org.junit.Before;
@@ -45,7 +46,7 @@ public class UnitOfWorkRouterTest
             builder.prototype().events().get().add( newDomainEvent( assembler, "Test2" ));
             builder.prototype().events().get().add( newDomainEvent( assembler, "Test3" ));
             builder.prototype().version().set( "1.0" );
-            builder.prototype().timestamp().set( System.currentTimeMillis() );
+            builder.prototype().timestamp().set( Instant.now() );
             builder.prototype().usecase().set( "Test" );
             list.add( builder.newInstance() );
         }
@@ -55,7 +56,7 @@ public class UnitOfWorkRouterTest
             builder.prototype().events().get().add( newDomainEvent( assembler, "Test5" ));
             builder.prototype().events().get().add( newDomainEvent( assembler, "Test6" ));
             builder.prototype().version().set( "1.0" );
-            builder.prototype().timestamp().set( System.currentTimeMillis() );
+            builder.prototype().timestamp().set( Instant.now() );
             builder.prototype().usecase().set( "Test2" );
             list.add( builder.newInstance() );
         }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/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 a7c8aca..8934296 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
@@ -18,12 +18,14 @@
 package org.qi4j.library.rdf.entity;
 
 import java.math.BigDecimal;
-import java.util.Date;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.OffsetDateTime;
+import java.time.OffsetTime;
+import java.time.ZonedDateTime;
 import java.util.HashMap;
 import java.util.Map;
-import org.joda.time.DateTime;
-import org.joda.time.LocalDate;
-import org.joda.time.LocalDateTime;
 import org.openrdf.model.Graph;
 import org.openrdf.model.Statement;
 import org.openrdf.model.URI;
@@ -59,10 +61,14 @@ public class EntityTypeSerializer
         dataTypes.put( Double.class.getName(), XMLSchema.DOUBLE );
         dataTypes.put( Long.class.getName(), XMLSchema.LONG );
         dataTypes.put( Short.class.getName(), XMLSchema.SHORT );
-        dataTypes.put( Date.class.getName(), XMLSchema.DATETIME );
-        dataTypes.put( DateTime.class.getName(), XMLSchema.DATETIME );
+//        dataTypes.put( Date.class.getName(), XMLSchema.DATETIME );
+
+        dataTypes.put( ZonedDateTime.class.getName(), XMLSchema.DATETIME );
+        dataTypes.put( OffsetDateTime.class.getName(), XMLSchema.DATETIME );
+        dataTypes.put( OffsetTime.class.getName(), XMLSchema.TIME );
         dataTypes.put( LocalDateTime.class.getName(), XMLSchema.DATETIME );
         dataTypes.put( LocalDate.class.getName(), XMLSchema.DATE );
+        dataTypes.put( LocalTime.class.getName(), XMLSchema.TIME );
     }
 
     public Iterable<Statement> serialize( final EntityDescriptor entityDescriptor )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/rdf/src/test/java/org/qi4j/library/rdf/entity/EntitySerializerTest.java
----------------------------------------------------------------------
diff --git a/libraries/rdf/src/test/java/org/qi4j/library/rdf/entity/EntitySerializerTest.java b/libraries/rdf/src/test/java/org/qi4j/library/rdf/entity/EntitySerializerTest.java
index d41466d..c60762e 100644
--- a/libraries/rdf/src/test/java/org/qi4j/library/rdf/entity/EntitySerializerTest.java
+++ b/libraries/rdf/src/test/java/org/qi4j/library/rdf/entity/EntitySerializerTest.java
@@ -15,6 +15,7 @@
 package org.qi4j.library.rdf.entity;
 
 import java.io.PrintWriter;
+import java.time.Instant;
 import org.junit.Before;
 import org.junit.Test;
 import org.openrdf.model.Statement;
@@ -72,7 +73,7 @@ public class EntitySerializerTest
     public void testEntitySerializer() throws RDFHandlerException
     {
         EntityReference entityReference = new EntityReference( "test2" );
-        EntityState entityState = entityStore.newUnitOfWork( UsecaseBuilder.newUsecase( "Test" ), module, System.currentTimeMillis() ).entityStateOf( entityReference );
+        EntityState entityState = entityStore.newUnitOfWork( UsecaseBuilder.newUsecase( "Test" ), module, Instant.now() ).entityStateOf( entityReference );
 
         Iterable<Statement> graph = serializer.serialize( entityState );
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/rest-client/src/main/java/org/qi4j/library/rest/client/ClientCache.java
----------------------------------------------------------------------
diff --git a/libraries/rest-client/src/main/java/org/qi4j/library/rest/client/ClientCache.java b/libraries/rest-client/src/main/java/org/qi4j/library/rest/client/ClientCache.java
index ce3dc89..c52b5ba 100644
--- a/libraries/rest-client/src/main/java/org/qi4j/library/rest/client/ClientCache.java
+++ b/libraries/rest-client/src/main/java/org/qi4j/library/rest/client/ClientCache.java
@@ -17,6 +17,7 @@
 
 package org.qi4j.library.rest.client;
 
+import java.time.Instant;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -32,118 +33,127 @@ import org.restlet.data.Tag;
  */
 public class ClientCache
 {
-   Map<String, CacheInfo> identityToTimestamp = new HashMap<String, CacheInfo>( );
-   Map<String, String> pathToIdentity = new HashMap<String, String>( );
-
-   public void updateCache( Response response)
-   {
-      if (response.getRequest().getMethod().equals( Method.DELETE ))
-      {
-         String path = getIdentityPath( response.getRequest().getResourceRef() );
-         String id = pathToIdentity.get( path );
-         if (id != null)
-         {
-            // Clear anything related to this id from cache
-            identityToTimestamp.remove( id );
-            Iterator<Map.Entry<String, String>> paths = pathToIdentity.entrySet().iterator();
-            while (paths.hasNext())
+    Map<String, CacheInfo> identityToTimestamp = new HashMap<String, CacheInfo>();
+    Map<String, String> pathToIdentity = new HashMap<String, String>();
+
+    public void updateCache( Response response )
+    {
+        if( response.getRequest().getMethod().equals( Method.DELETE ) )
+        {
+            String path = getIdentityPath( response.getRequest().getResourceRef() );
+            String id = pathToIdentity.get( path );
+            if( id != null )
             {
-               Map.Entry<String, String> entry = paths.next();
-               if (entry.getValue().equals( id ))
-                  paths.remove();
+                // Clear anything related to this id from cache
+                identityToTimestamp.remove( id );
+                Iterator<Map.Entry<String, String>> paths = pathToIdentity.entrySet().iterator();
+                while( paths.hasNext() )
+                {
+                    Map.Entry<String, String> entry = paths.next();
+                    if( entry.getValue().equals( id ) )
+                    {
+                        paths.remove();
+                    }
+                }
             }
-         }
-      } else if (response.getRequest().getMethod().equals( Method.PUT ) || response.getRequest().getMethod().equals( Method.POST ))
-      {
-         Tag tag = response.getEntity().getTag();
-         if (tag != null)
-         {
-            Reference ref = response.getRequest().getResourceRef().clone();
+        }
+        else if( response.getRequest().getMethod().equals( Method.PUT ) || response.getRequest()
+            .getMethod()
+            .equals( Method.POST ) )
+        {
+            Tag tag = response.getEntity().getTag();
+            if( tag != null )
+            {
+                Reference ref = response.getRequest().getResourceRef().clone();
 
-            CacheInfo value = new CacheInfo( response.getEntity().getModificationDate(), tag, ref );
-            identityToTimestamp.put( value.getEntity(), value );
+                Date modificationDate = response.getEntity().getModificationDate();
+                CacheInfo value = new CacheInfo( Instant.ofEpochMilli( modificationDate.getTime() ), tag, ref );
+                identityToTimestamp.put( value.getEntity(), value );
 
-            String path = getIdentityPath( ref );
+                String path = getIdentityPath( ref );
 
-            pathToIdentity.put( path, value.getEntity() );
+                pathToIdentity.put( path, value.getEntity() );
 
 //            LoggerFactory.getLogger( ClientCache.class ).info( "Update:"+value.getEntity()+" ("+ref.toString()+") -> "+value.getLastModified() );
-         }
-      } else
-      {
-          // TODO GET caching goes here
-      }
-   }
-
-   public void updateQueryConditions( Request request)
-   {
-      String identity = pathToIdentity.get( getIdentityPath( request.getResourceRef() ));
-      if (identity != null)
-      {
-         CacheInfo cacheInfo = identityToTimestamp.get( identity );
-         if (cacheInfo != null)
-         {
+            }
+        }
+        else
+        {
+            // TODO GET caching goes here
+        }
+    }
+
+    public void updateQueryConditions( Request request )
+    {
+        String identity = pathToIdentity.get( getIdentityPath( request.getResourceRef() ) );
+        if( identity != null )
+        {
+            CacheInfo cacheInfo = identityToTimestamp.get( identity );
+            if( cacheInfo != null )
+            {
 //            LoggerFactory.getLogger( ClientCache.class ).info( "Send:  "+cacheInfo.getEntity()+" ("+request.getMethod().getName()+":"+request.getResourceRef()+") -> "+cacheInfo.getLastModified() );
-            request.getConditions().setModifiedSince( cacheInfo.getLastModified() );
-         }
-      }
-   }
-
-   public void updateCommandConditions( Request request)
-   {
-      String identity = pathToIdentity.get( getIdentityPath( request.getResourceRef() ));
-      if (identity != null)
-      {
-         CacheInfo cacheInfo = identityToTimestamp.get( identity );
-         if (cacheInfo != null)
-         {
+                request.getConditions().setModifiedSince( new Date( cacheInfo.getLastModified().toEpochMilli() ) );
+            }
+        }
+    }
+
+    public void updateCommandConditions( Request request )
+    {
+        String identity = pathToIdentity.get( getIdentityPath( request.getResourceRef() ) );
+        if( identity != null )
+        {
+            CacheInfo cacheInfo = identityToTimestamp.get( identity );
+            if( cacheInfo != null )
+            {
 //            LoggerFactory.getLogger( ClientCache.class ).info( "Send:  "+cacheInfo.getEntity()+" ("+request.getMethod().getName()+":"+request.getResourceRef()+") -> "+cacheInfo.getLastModified() );
-            request.getConditions().setUnmodifiedSince( cacheInfo.getLastModified() );
-         }
-      }
-   }
-
-   private String getIdentityPath( Reference ref )
-   {
-      String path = ref.getPath();
-      if (!path.endsWith( "/" ))
-         path = path.substring( 0, path.lastIndexOf('/' )+1);
-      return path;
-   }
-
-   static class CacheInfo
-   {
-      private Reference ref;
-      private Date lastModified;
-      private Tag tag;
-      private String entity;
-
-      CacheInfo( Date lastModified, Tag tag, Reference ref )
-      {
-         this.lastModified = lastModified;
-         this.tag = tag;
-         this.ref = ref;
-         entity = tag.getName().split( "/" )[0];
-      }
-
-      public Reference getRef()
-      {
-         return ref;
-      }
-
-      public Date getLastModified()
-      {
-         return lastModified;
-      }
-
-      public Tag getTag()
-      {
-         return tag;
-      }
-
-      public String getEntity()
-      {
-         return entity;
-      }
-   }
+                request.getConditions().setUnmodifiedSince( new Date( cacheInfo.getLastModified().toEpochMilli() ) );
+            }
+        }
+    }
+
+    private String getIdentityPath( Reference ref )
+    {
+        String path = ref.getPath();
+        if( !path.endsWith( "/" ) )
+        {
+            path = path.substring( 0, path.lastIndexOf( '/' ) + 1 );
+        }
+        return path;
+    }
+
+    static class CacheInfo
+    {
+        private Reference ref;
+        private Instant lastModified;
+        private Tag tag;
+        private String entity;
+
+        CacheInfo( Instant lastModified, Tag tag, Reference ref )
+        {
+            this.lastModified = lastModified;
+            this.tag = tag;
+            this.ref = ref;
+            entity = tag.getName().split( "/" )[ 0 ];
+        }
+
+        public Reference getRef()
+        {
+            return ref;
+        }
+
+        public Instant getLastModified()
+        {
+            return lastModified;
+        }
+
+        public Tag getTag()
+        {
+            return tag;
+        }
+
+        public String getEntity()
+        {
+            return entity;
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/libraries/rest-client/src/main/java/org/qi4j/library/rest/client/responsereader/TableResponseReader.java
----------------------------------------------------------------------
diff --git a/libraries/rest-client/src/main/java/org/qi4j/library/rest/client/responsereader/TableResponseReader.java b/libraries/rest-client/src/main/java/org/qi4j/library/rest/client/responsereader/TableResponseReader.java
index 21e13ef..6e00f8b 100644
--- a/libraries/rest-client/src/main/java/org/qi4j/library/rest/client/responsereader/TableResponseReader.java
+++ b/libraries/rest-client/src/main/java/org/qi4j/library/rest/client/responsereader/TableResponseReader.java
@@ -17,14 +17,14 @@
 
 package org.qi4j.library.rest.client.responsereader;
 
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
+import java.time.LocalDate;
+import java.time.LocalTime;
+import java.time.ZonedDateTime;
 import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONObject;
 import org.qi4j.api.injection.scope.Structure;
 import org.qi4j.api.structure.Module;
-import org.qi4j.api.util.Dates;
 import org.qi4j.library.rest.client.spi.ResponseReader;
 import org.qi4j.library.rest.common.table.Table;
 import org.qi4j.library.rest.common.table.TableBuilder;
@@ -37,74 +37,86 @@ import org.restlet.resource.ResourceException;
  * JAVADOC
  */
 public class TableResponseReader
-   implements ResponseReader
+    implements ResponseReader
 {
-   @Structure
-   Module module;
+    @Structure
+    Module module;
 
     @Override
-   public Object readResponse( Response response, Class<?> resultType ) throws ResourceException
-   {
-      if (response.getEntity().getMediaType().equals( MediaType.APPLICATION_JSON) && Table.class.isAssignableFrom( resultType ))
-      {
-         String jsonValue = response.getEntityAsText();
-         try
-         {
-            JSONObject jsonObject = new JSONObject(jsonValue);
+    public Object readResponse( Response response, Class<?> resultType )
+        throws ResourceException
+    {
+        if( response.getEntity()
+                .getMediaType()
+                .equals( MediaType.APPLICATION_JSON ) && Table.class.isAssignableFrom( resultType ) )
+        {
+            String jsonValue = response.getEntityAsText();
+            try
+            {
+                JSONObject jsonObject = new JSONObject( jsonValue );
 
-            JSONObject table = jsonObject.getJSONObject( "table" );
-            TableBuilder builder = new TableBuilder(module);
+                JSONObject table = jsonObject.getJSONObject( "table" );
+                TableBuilder builder = new TableBuilder( module );
 
-            JSONArray cols = table.getJSONArray( "cols" );
-            for (int i = 0; i < cols.length(); i++)
-            {
-               JSONObject col = cols.getJSONObject( i );
-               builder.column( col.optString( "id" ),  col.getString( "label" ), col.getString( "type" ));
-            }
+                JSONArray cols = table.getJSONArray( "cols" );
+                for( int i = 0; i < cols.length(); i++ )
+                {
+                    JSONObject col = cols.getJSONObject( i );
+                    builder.column( col.optString( "id" ), col.getString( "label" ), col.getString( "type" ) );
+                }
 
-            JSONArray rows = table.getJSONArray( "rows" );
-            for (int i = 0; i < rows.length(); i++)
-            {
-               builder.row();
-               JSONObject row = rows.getJSONObject( i );
-               JSONArray cells = row.getJSONArray( "c" );
-               for (int j = 0; j < cells.length(); j++)
-               {
-                  JSONObject cell = cells.getJSONObject( j );
-                  Object value = cell.opt( "v" );
-                  String formatted = cell.optString("f");
+                JSONArray rows = table.getJSONArray( "rows" );
+                for( int i = 0; i < rows.length(); i++ )
+                {
+                    builder.row();
+                    JSONObject row = rows.getJSONObject( i );
+                    JSONArray cells = row.getJSONArray( "c" );
+                    for( int j = 0; j < cells.length(); j++ )
+                    {
+                        JSONObject cell = cells.getJSONObject( j );
+                        Object value = cell.opt( "v" );
+                        String formatted = cell.optString( "f" );
 
-                  if (cols.getJSONObject( j ).getString( "type" ).equals("datetime") && value != null)
-                     value = Dates.fromString( value.toString() );
-                  else if (cols.getJSONObject( j ).getString( "type" ).equals("date") && value != null)
-                     try
-                     {
-                        value = new SimpleDateFormat( "yyyy-MM-dd").parse( value.toString() );
-                     } catch (ParseException e)
-                     {
-                        throw new ResourceException(e);
-                     }
-                  else if (cols.getJSONObject( j ).getString( "type" ).equals("timeofday") && value != null)
-                     try
-                     {
-                        value = new SimpleDateFormat( "HH:mm:ss").parse( value.toString() );
-                     } catch (ParseException e)
-                     {
-                        throw new ResourceException(e);
-                     }
+                        if( cols.getJSONObject( j ).getString( "type" ).equals( "datetime" ) && value != null )
+                        {
+                            value = ZonedDateTime.parse( value.toString() );
+                        }
+                        else if( cols.getJSONObject( j ).getString( "type" ).equals( "date" ) && value != null )
+                        {
+                            try
+                            {
+                                value = LocalDate.parse( value.toString() );
+                            }
+                            catch( RuntimeException e )
+                            {
+                                throw new ResourceException( e );
+                            }
+                        }
+                        else if( cols.getJSONObject( j ).getString( "type" ).equals( "timeofday" ) && value != null )
+                        {
+                            try
+                            {
+                                value = LocalTime.parse( value.toString() );
+                            }
+                            catch( RuntimeException e )
+                            {
+                                throw new ResourceException( e );
+                            }
+                        }
 
-                  builder.cell( value, formatted );
-               }
-               builder.endRow();
-            }
+                        builder.cell( value, formatted );
+                    }
+                    builder.endRow();
+                }
 
-            return builder.newTable();
-         } catch (JSONException e)
-         {
-            throw new ResourceException( Status.CLIENT_ERROR_UNPROCESSABLE_ENTITY, e);
-         }
-      }
+                return builder.newTable();
+            }
+            catch( JSONException e )
+            {
+                throw new ResourceException( Status.CLIENT_ERROR_UNPROCESSABLE_ENTITY, e );
+            }
+        }
 
-      return null;
-   }
+        return null;
+    }
 }


[50/50] [abbrv] zest-qi4j git commit: build: reactivate jacoco using the latest version

Posted by ni...@apache.org.
build: reactivate jacoco using the latest version

This version works with Java 8.
Another commit on the ‘develop’ branch (3ed4896) upgraded jacoco to the
very same version.


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/e62f94a3
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/e62f94a3
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/e62f94a3

Branch: refs/heads/3.0
Commit: e62f94a34f52742c1ef6695590ad7cfe23f4bc0d
Parents: aa86f99
Author: Paul Merlin <pa...@nosphere.org>
Authored: Sat Jan 24 15:04:03 2015 +0100
Committer: Paul Merlin <pa...@nosphere.org>
Committed: Sat Jan 24 15:04:03 2015 +0100

----------------------------------------------------------------------
 build.gradle | 113 ++++++++++++++++++++++++++++--------------------------
 1 file changed, 58 insertions(+), 55 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/e62f94a3/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 2c0db13..20f215e 100644
--- a/build.gradle
+++ b/build.gradle
@@ -175,7 +175,7 @@ allprojects {
   if( ext.javaDir.isDirectory() || ext.scalaDir.isDirectory() ||
       ext.testJavaDir.isDirectory() || ext.testScalaDir.isDirectory() )
   {
-//    apply plugin: 'jacoco'
+    apply plugin: 'jacoco'
     apply plugin: 'osgi'
     apply plugin: VersionClass
     apply plugin: AsciidocBuildInfo
@@ -250,7 +250,7 @@ allprojects {
       systemProperties = testProperties
       systemProperties['user.dir'] = workingDir // GRADLE-2859
       ignoreFailures = true
-      testReport = true
+      reports.html.enabled(true)
       afterSuite { descriptor, result ->
         if( result.resultType == TestResult.ResultType.FAILURE )
         {
@@ -258,6 +258,9 @@ allprojects {
         }
       }
     }
+    jacoco {
+      toolVersion = '0.7.2.201409121644'
+    }
 
 //    // Create checkstyle report
 //    task checkstyleReport( type: Xslt, dependsOn: check ) {
@@ -340,63 +343,63 @@ test {
 
 // Jacoco
 configurations {
-//  jacoco
+  jacoco
 }
 dependencies {
-//  jacoco 'org.jacoco:org.jacoco.ant:0.7.1.201405082137'
+  jacoco 'org.jacoco:org.jacoco.ant:0.7.2.201409121644'
 }
 // Generate a global code codeverage report
-//task coverageReport {
-//  dependsOn subprojects*.test
-//  def outputPath = "build/reports/coverage"
-//  def coveredProjects = subprojects.findAll { p -> new File( "${p.buildDir.path}/jacoco" ).exists() }
-//  def coreProjects = coveredProjects.findAll { p -> p.name.startsWith('org.qi4j.core' ) }
-//  def libProjects = coveredProjects.findAll { p -> p.name.startsWith( 'org.qi4j.lib' ) }
-//  def extProjects = coveredProjects.findAll { p -> p.name.startsWith( 'org.qi4j.ext' ) }
-//  def toolsProjects = coveredProjects.findAll { p -> p.name.startsWith( 'org.qi4j.tool' ) }
-//  def tutoProjects = coveredProjects.findAll { p -> p.name.startsWith( 'org.qi4j.tuto' ) }
-//  def samplesProjects = coveredProjects.findAll { p -> p.name.startsWith( 'org.qi4j.sample' ) }
-//  ant {
-//    taskdef name:'jacocoreport', classname: 'org.jacoco.ant.ReportTask', classpath: configurations.jacoco.asPath
-//    mkdir dir: outputPath
-//    jacocoreport {
-//      executiondata {
-//        coveredProjects.collect { p -> fileset( dir: "${p.buildDir.path}/jacoco" ) { include( name: '*.exec' ) } }
-//      }
-//      structure( name: "Qi4j SDK" ) {
-//        group( name: "Core" ) {
-//          classfiles { coreProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
-//          sourcefiles { coreProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
-//        }
-//        group( name: "Libraries" ) {
-//          classfiles { libProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
-//          sourcefiles { libProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
-//        }
-//        group( name: "Extensions" ) {
-//          classfiles { extProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
-//          sourcefiles { extProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
-//        }
-//        group( name: "Tools" ) {
-//          classfiles { toolsProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
-//          sourcefiles { toolsProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
-//        }
-//        group( name: "Tutorials" ) {
-//          classfiles { tutoProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
-//          sourcefiles { tutoProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
-//        }
-//        group( name: "Samples" ) {
-//          classfiles { samplesProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
-//          sourcefiles { samplesProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
-//        }
-//      }
-//      csv  destfile: "${outputPath}/jacoco.csv", encoding: "UTF-8"
-//      xml  destfile: "${outputPath}/jacoco.xml", encoding: "UTF-8"
-//      html destdir:  outputPath, encoding: "UTF-8", locale: "en", footer: "Qi4j SDK"
-//    }
-//  }
-//  inputs.dir coveredProjects.collect { p -> "${p.buildDir.path}/jacoco" }
-//  outputs.dir outputPath
-//}
+task coverageReport {
+  dependsOn subprojects*.test
+  def outputPath = "build/reports/coverage"
+  def coveredProjects = subprojects.findAll { p -> new File( "${p.buildDir.path}/jacoco" ).exists() }
+  def coreProjects = coveredProjects.findAll { p -> p.name.startsWith('org.qi4j.core' ) }
+  def libProjects = coveredProjects.findAll { p -> p.name.startsWith( 'org.qi4j.lib' ) }
+  def extProjects = coveredProjects.findAll { p -> p.name.startsWith( 'org.qi4j.ext' ) }
+  def toolsProjects = coveredProjects.findAll { p -> p.name.startsWith( 'org.qi4j.tool' ) }
+  def tutoProjects = coveredProjects.findAll { p -> p.name.startsWith( 'org.qi4j.tuto' ) }
+  def samplesProjects = coveredProjects.findAll { p -> p.name.startsWith( 'org.qi4j.sample' ) }
+  ant {
+    taskdef name:'jacocoreport', classname: 'org.jacoco.ant.ReportTask', classpath: configurations.jacoco.asPath
+    mkdir dir: outputPath
+    jacocoreport {
+      executiondata {
+        coveredProjects.collect { p -> fileset( dir: "${p.buildDir.path}/jacoco" ) { include( name: '*.exec' ) } }
+      }
+      structure( name: "Qi4j SDK" ) {
+        group( name: "Core" ) {
+          classfiles { coreProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
+          sourcefiles { coreProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
+        }
+        group( name: "Libraries" ) {
+          classfiles { libProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
+          sourcefiles { libProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
+        }
+        group( name: "Extensions" ) {
+          classfiles { extProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
+          sourcefiles { extProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
+        }
+        group( name: "Tools" ) {
+          classfiles { toolsProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
+          sourcefiles { toolsProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
+        }
+        group( name: "Tutorials" ) {
+          classfiles { tutoProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
+          sourcefiles { tutoProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
+        }
+        group( name: "Samples" ) {
+          classfiles { samplesProjects.collect { p -> fileset dir: "${p.buildDir.path}/classes/main" } }
+          sourcefiles { samplesProjects.collect { p -> fileset dir: "${p.projectDir.path}/src/main/java" } }
+        }
+      }
+      csv  destfile: "${outputPath}/jacoco.csv", encoding: "UTF-8"
+      xml  destfile: "${outputPath}/jacoco.xml", encoding: "UTF-8"
+      html destdir:  outputPath, encoding: "UTF-8", locale: "en", footer: "Qi4j SDK"
+    }
+  }
+  inputs.dir subprojects.collect { p -> "${p.buildDir.path}/jacoco" }
+  outputs.dir outputPath
+}
 
 
 // Build the whole SDK public Javadoc


[09/50] [abbrv] zest-qi4j git commit: Hazelcast EntityStore now use Hazelcast 3.2.2

Posted by ni...@apache.org.
Hazelcast EntityStore now use Hazelcast 3.2.2


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/b430b0ad
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/b430b0ad
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/b430b0ad

Branch: refs/heads/3.0
Commit: b430b0adabb81ef42f42f469ebf9e20c91bb4423
Parents: 8693abd
Author: Paul Merlin <pa...@nosphere.org>
Authored: Thu Jun 12 14:54:25 2014 +0200
Committer: Paul Merlin <pa...@nosphere.org>
Committed: Thu Jun 12 14:54:25 2014 +0200

----------------------------------------------------------------------
 .../qi4j/entitystore/hazelcast/HazelcastEntityStoreMixin.java  | 6 +++---
 libraries.gradle                                               | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b430b0ad/extensions/entitystore-hazelcast/src/main/java/org/qi4j/entitystore/hazelcast/HazelcastEntityStoreMixin.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-hazelcast/src/main/java/org/qi4j/entitystore/hazelcast/HazelcastEntityStoreMixin.java b/extensions/entitystore-hazelcast/src/main/java/org/qi4j/entitystore/hazelcast/HazelcastEntityStoreMixin.java
index 8b6b5ec..501b34b 100644
--- a/extensions/entitystore-hazelcast/src/main/java/org/qi4j/entitystore/hazelcast/HazelcastEntityStoreMixin.java
+++ b/extensions/entitystore-hazelcast/src/main/java/org/qi4j/entitystore/hazelcast/HazelcastEntityStoreMixin.java
@@ -1,5 +1,5 @@
 /*
- * Copyright 2009 Paul Merlin.
+ * Copyright 2009-2014 Paul Merlin.
  * Copyright 2011 Niclas Hedhman.
  *
  * Licensed  under the  Apache License,  Version 2.0  (the "License");
@@ -174,9 +174,9 @@ public class HazelcastEntityStoreMixin
         throws IOException
     {
         String hzConfLocation = configuration.configXmlLocation().get();
-        if( hzConfLocation == null )
+        if( hzConfLocation == null || hzConfLocation.isEmpty() )
         {
-            hzConfLocation = "org/qi4j/entitystore/hazelcast/defaultConfiguration.xml";
+            hzConfLocation = "hazelcast-default.xml";
         }
         Config conf;
         if( hzConfLocation.contains( ":" ) )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b430b0ad/libraries.gradle
----------------------------------------------------------------------
diff --git a/libraries.gradle b/libraries.gradle
index d78ef13..eb9da0c 100644
--- a/libraries.gradle
+++ b/libraries.gradle
@@ -15,10 +15,10 @@ def ehcacheVersion = '2.8.3'
 def elasticsearchVersion = '1.2.1'
 def freemarkerVersion = '2.3.20'
 def gaeVersion = '1.8.8'
-def hazelcastVersion = '3.1.3'
 def groovyVersion = '2.3.2'
 def guavaVersion = '17.0'
 def h2Version = '1.4.178'
+def hazelcastVersion = '3.2.2'
 def httpClientVersion = '4.2.2' // 4.3.4 exists
 def jacksonVersion = '2.4.0'
 def javascriptVersion = '1.7R4'


[16/50] [abbrv] zest-qi4j git commit: Core Runtime: now use ASM 5.x for Java 8 compatibility

Posted by ni...@apache.org.
Core Runtime: now use ASM 5.x for Java 8 compatibility


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/d7af9150
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/d7af9150
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/d7af9150

Branch: refs/heads/3.0
Commit: d7af91505443ad6590b5726f6090b88edf981b15
Parents: cca75eb
Author: Paul Merlin <pa...@nosphere.org>
Authored: Thu Jun 12 15:07:07 2014 +0200
Committer: Paul Merlin <pa...@nosphere.org>
Committed: Thu Jun 12 15:07:07 2014 +0200

----------------------------------------------------------------------
 .../main/java/org/qi4j/runtime/composite/FragmentClassLoader.java | 3 +++
 .../java/org/qi4j/runtime/composite/TransientClassLoader.java     | 3 +++
 libraries.gradle                                                  | 2 +-
 3 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/d7af9150/core/runtime/src/main/java/org/qi4j/runtime/composite/FragmentClassLoader.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/composite/FragmentClassLoader.java b/core/runtime/src/main/java/org/qi4j/runtime/composite/FragmentClassLoader.java
index c140511..4e9c525 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/composite/FragmentClassLoader.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/composite/FragmentClassLoader.java
@@ -87,6 +87,9 @@ public class FragmentClassLoader
         String jdkString = System.getProperty( "java.specification.version" );
         switch( jdkString )
         {
+            case "1.8":
+                JDK_VERSION = Opcodes.V1_8;
+                break;
             case "1.7":
             default:
                 JDK_VERSION = Opcodes.V1_7;

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/d7af9150/core/runtime/src/main/java/org/qi4j/runtime/composite/TransientClassLoader.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/composite/TransientClassLoader.java b/core/runtime/src/main/java/org/qi4j/runtime/composite/TransientClassLoader.java
index f3e0aa6..b53c259 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/composite/TransientClassLoader.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/composite/TransientClassLoader.java
@@ -88,6 +88,9 @@ import static org.qi4j.api.util.Classes.interfacesOf;
         String jdkString = System.getProperty( "java.specification.version" );
         switch( jdkString )
         {
+            case "1.8":
+                JDK_VERSION = Opcodes.V1_8;
+                break;
             case "1.7":
             default:
                 JDK_VERSION = Opcodes.V1_7;

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/d7af9150/libraries.gradle
----------------------------------------------------------------------
diff --git a/libraries.gradle b/libraries.gradle
index b2a3391a..97e87a0 100644
--- a/libraries.gradle
+++ b/libraries.gradle
@@ -1,5 +1,5 @@
 // Versions of Dependencies;
-def asmVersion = '4.2'
+def asmVersion = '5.0.3'
 def beanshellVersion = '2.0b4'
 def bonecpVersion = '0.8.0.RELEASE'
 def bouncyVersion = '1.50'


[24/50] [abbrv] zest-qi4j git commit: Removed Function, Function2 and Specification and replaced with the equivalents in JDK, Function, BiFunction and Predicate.

Posted by ni...@apache.org.
http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/spi/src/main/java/org/qi4j/spi/value/ValueSerializerAdapter.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/qi4j/spi/value/ValueSerializerAdapter.java b/core/spi/src/main/java/org/qi4j/spi/value/ValueSerializerAdapter.java
index 8e21416..5a1cfea 100644
--- a/core/spi/src/main/java/org/qi4j/spi/value/ValueSerializerAdapter.java
+++ b/core/spi/src/main/java/org/qi4j/spi/value/ValueSerializerAdapter.java
@@ -25,6 +25,8 @@ import java.math.BigInteger;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.function.BiFunction;
+import java.util.function.Function;
 import org.joda.time.DateTime;
 import org.joda.time.LocalDate;
 import org.joda.time.LocalDateTime;
@@ -46,8 +48,6 @@ import org.qi4j.api.value.ValueComposite;
 import org.qi4j.api.value.ValueDescriptor;
 import org.qi4j.api.value.ValueSerializationException;
 import org.qi4j.api.value.ValueSerializer;
-import org.qi4j.functional.Function;
-import org.qi4j.functional.Function2;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -97,19 +97,19 @@ public abstract class ValueSerializerAdapter<OutputType>
     private static final Logger LOG = LoggerFactory.getLogger( ValueSerializerAdapter.class );
     private static final String UTF_8 = "UTF-8";
 
-    private static <TO, FROM extends TO> Function2<Options, FROM, TO> identitySerializer()
+    private static <TO, FROM extends TO> BiFunction<Options, FROM, TO> identitySerializer()
     {
-        return new Function2<Options, FROM, TO>()
+        return new BiFunction<Options, FROM, TO>()
         {
             @Override
-            public TO map( Options options, FROM from )
+            public TO apply( Options options, FROM from )
             {
                 return from;
             }
         };
     }
 
-    private final Map<Class<?>, Function2<Options, Object, Object>> serializers = new HashMap<>( 16 );
+    private final Map<Class<?>, BiFunction<Options, Object, Object>> serializers = new HashMap<>( 16 );
     private final Map<Class<?>, ComplexSerializer<Object, OutputType>> complexSerializers = new HashMap<>( 2 );
 
     /**
@@ -120,9 +120,9 @@ public abstract class ValueSerializerAdapter<OutputType>
      * @param serializer Serialization Function
      */
     @SuppressWarnings( "unchecked" )
-    protected final <T> void registerSerializer( Class<T> type, Function2<Options, T, Object> serializer )
+    protected final <T> void registerSerializer( Class<T> type, BiFunction<Options, T, Object> serializer )
     {
-        serializers.put( type, (Function2<Options, Object, Object>) serializer );
+        serializers.put( type, (BiFunction<Options, Object, Object>) serializer );
     }
 
     /**
@@ -152,62 +152,62 @@ public abstract class ValueSerializerAdapter<OutputType>
         registerSerializer( Double.class, ValueSerializerAdapter.<Object, Double>identitySerializer() );
 
         // Number types
-        registerSerializer( BigDecimal.class, new Function2<Options, BigDecimal, Object>()
+        registerSerializer( BigDecimal.class, new BiFunction<Options, BigDecimal, Object>()
         {
             @Override
-            public Object map( Options options, BigDecimal bigDecimal )
+            public Object apply( Options options, BigDecimal bigDecimal )
             {
                 return bigDecimal.toString();
             }
         } );
-        registerSerializer( BigInteger.class, new Function2<Options, BigInteger, Object>()
+        registerSerializer( BigInteger.class, new BiFunction<Options, BigInteger, Object>()
         {
             @Override
-            public Object map( Options options, BigInteger bigInteger )
+            public Object apply( Options options, BigInteger bigInteger )
             {
                 return bigInteger.toString();
             }
         } );
 
         // Date types
-        registerSerializer( Date.class, new Function2<Options, Date, Object>()
+        registerSerializer( Date.class, new BiFunction<Options, Date, Object>()
         {
             @Override
-            public Object map( Options options, Date date )
+            public Object apply( Options options, Date date )
             {
                 return Dates.toUtcString( date );
             }
         } );
-        registerSerializer( DateTime.class, new Function2<Options, DateTime, Object>()
+        registerSerializer( DateTime.class, new BiFunction<Options, DateTime, Object>()
         {
             @Override
-            public Object map( Options options, DateTime date )
+            public Object apply( Options options, DateTime date )
             {
                 return date.toString();
             }
         } );
-        registerSerializer( LocalDateTime.class, new Function2<Options, LocalDateTime, Object>()
+        registerSerializer( LocalDateTime.class, new BiFunction<Options, LocalDateTime, Object>()
         {
             @Override
-            public Object map( Options options, LocalDateTime date )
+            public Object apply( Options options, LocalDateTime date )
             {
                 return date.toString();
             }
         } );
-        registerSerializer( LocalDate.class, new Function2<Options, LocalDate, Object>()
+        registerSerializer( LocalDate.class, new BiFunction<Options, LocalDate, Object>()
         {
             @Override
-            public Object map( Options options, LocalDate date )
+            public Object apply( Options options, LocalDate date )
             {
                 return date.toString();
             }
         } );
 
         // Other supported types
-        registerSerializer( EntityReference.class, new Function2<Options, EntityReference, Object>()
+        registerSerializer( EntityReference.class, new BiFunction<Options, EntityReference, Object>()
         {
             @Override
-            public Object map( Options options, EntityReference ref )
+            public Object apply( Options options, EntityReference ref )
             {
                 return ref.toString();
             }
@@ -220,7 +220,7 @@ public abstract class ValueSerializerAdapter<OutputType>
         return new Function<T, String>()
         {
             @Override
-            public String map( T object )
+            public String apply( T object )
             {
                 return serialize( object );
             }
@@ -233,7 +233,7 @@ public abstract class ValueSerializerAdapter<OutputType>
         return new Function<T, String>()
         {
             @Override
-            public String map( T object )
+            public String apply( T object )
             {
                 return serialize( options, object );
             }
@@ -247,7 +247,7 @@ public abstract class ValueSerializerAdapter<OutputType>
         return new Function<T, String>()
         {
             @Override
-            public String map( T object )
+            public String apply( T object )
             {
                 return serialize( includeTypeInfo ? new Options().withTypeInfo() : new Options().withoutTypeInfo(),
                                   object );
@@ -334,7 +334,7 @@ public abstract class ValueSerializerAdapter<OutputType>
             if( serializers.get( object.getClass() ) != null )
             {
                 // Plain Value
-                Object serialized = serializers.get( object.getClass() ).map( options, object );
+                Object serialized = serializers.get( object.getClass() ).apply( options, object );
                 output.write( serialized.toString().getBytes( UTF_8 ) );
             }
             else if( object.getClass().isEnum() )
@@ -371,7 +371,7 @@ public abstract class ValueSerializerAdapter<OutputType>
         if( serializers.get( object.getClass() ) != null )
         {
             LOG.trace( "Registered serializer matches -> onValue( serialized )" );
-            onValue( output, serializers.get( object.getClass() ).map( options, object ) );
+            onValue( output, serializers.get( object.getClass() ).apply( options, object ) );
         }
         else if( complexSerializers.get( object.getClass() ) != null )
         {
@@ -423,7 +423,7 @@ public abstract class ValueSerializerAdapter<OutputType>
     private void serializeValueComposite( Options options, Object object, OutputType output, boolean rootPass )
         throws Exception
     {
-        CompositeInstance valueInstance = Qi4j.FUNCTION_COMPOSITE_INSTANCE_OF.map( (ValueComposite) object );
+        CompositeInstance valueInstance = Qi4j.FUNCTION_COMPOSITE_INSTANCE_OF.apply( (ValueComposite) object );
         ValueDescriptor descriptor = (ValueDescriptor) valueInstance.descriptor();
         AssociationStateHolder state = (AssociationStateHolder) valueInstance.state();
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/spi/src/main/java/org/qi4j/valueserialization/orgjson/OrgJsonValueDeserializer.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/qi4j/valueserialization/orgjson/OrgJsonValueDeserializer.java b/core/spi/src/main/java/org/qi4j/valueserialization/orgjson/OrgJsonValueDeserializer.java
index 452f75e..752123a 100644
--- a/core/spi/src/main/java/org/qi4j/valueserialization/orgjson/OrgJsonValueDeserializer.java
+++ b/core/spi/src/main/java/org/qi4j/valueserialization/orgjson/OrgJsonValueDeserializer.java
@@ -21,6 +21,7 @@ import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.util.Collection;
 import java.util.Map;
+import java.util.function.Function;
 import org.json.JSONArray;
 import org.json.JSONObject;
 import org.json.JSONTokener;
@@ -31,7 +32,6 @@ import org.qi4j.api.structure.Application;
 import org.qi4j.api.structure.Module;
 import org.qi4j.api.value.ValueDeserializer;
 import org.qi4j.api.value.ValueSerializationException;
-import org.qi4j.functional.Function;
 import org.qi4j.spi.value.ValueDeserializerAdapter;
 
 /**
@@ -138,7 +138,7 @@ public class OrgJsonValueDeserializer
             else
             {
                 input.back();
-                collection.add( deserializer.map( input ) );
+                collection.add( deserializer.apply( input ) );
             }
             c = input.nextClean();
             switch( c )
@@ -265,11 +265,11 @@ public class OrgJsonValueDeserializer
 
                     if( "key".equals( objectKey ) )
                     {
-                        key = keyDeserializer.map( input );
+                        key = keyDeserializer.apply( input );
                     }
                     else if( "value".equals( objectKey ) )
                     {
-                        value = valueDeserializer.map( input );
+                        value = valueDeserializer.apply( input );
                     }
                     else
                     {
@@ -393,7 +393,7 @@ public class OrgJsonValueDeserializer
         {
             return null;
         }
-        T value = valueDeserializer.map( valueNode );
+        T value = valueDeserializer.apply( valueNode );
         return value;
     }
 
@@ -413,7 +413,7 @@ public class OrgJsonValueDeserializer
         for( int idx = 0; idx < array.length(); idx++ )
         {
             Object item = array.get( idx );
-            T value = deserializer.map( item );
+            T value = deserializer.apply( item );
             collection.add( value );
         }
     }
@@ -441,8 +441,8 @@ public class OrgJsonValueDeserializer
             JSONObject object = (JSONObject) item;
             Object keyNode = object.get( "key" );
             Object valueNode = object.get( "value" );
-            K key = keyDeserializer.map( keyNode );
-            V value = valueDeserializer.map( valueNode );
+            K key = keyDeserializer.apply( keyNode );
+            V value = valueDeserializer.apply( valueNode );
             if( key != null )
             {
                 map.put( key, value );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/spi/src/main/java/org/qi4j/valueserialization/orgjson/OrgJsonValueSerialization.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/qi4j/valueserialization/orgjson/OrgJsonValueSerialization.java b/core/spi/src/main/java/org/qi4j/valueserialization/orgjson/OrgJsonValueSerialization.java
index 0c758fa..01569a7 100644
--- a/core/spi/src/main/java/org/qi4j/valueserialization/orgjson/OrgJsonValueSerialization.java
+++ b/core/spi/src/main/java/org/qi4j/valueserialization/orgjson/OrgJsonValueSerialization.java
@@ -17,13 +17,13 @@ package org.qi4j.valueserialization.orgjson;
 
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.util.function.Function;
 import org.qi4j.api.structure.Application;
 import org.qi4j.api.structure.Module;
 import org.qi4j.api.type.ValueType;
 import org.qi4j.api.value.ValueSerialization;
 import org.qi4j.api.value.ValueSerializationException;
-import org.qi4j.functional.Function;
-import org.qi4j.functional.Function2;
+import java.util.function.BiFunction;
 
 /**
  * ValueSerialization producing and consuming JSON documents using org.json.
@@ -49,7 +49,7 @@ public class OrgJsonValueSerialization
         this.deserializer = new OrgJsonValueDeserializer( application, module, new Function<Application, Module>()
         {
             @Override
-            public Module map( Application from )
+            public Module apply( Application from )
             {
                 return valuesModule;
             }
@@ -132,7 +132,7 @@ public class OrgJsonValueSerialization
     }
 
     @Override
-    public <T> Function2<ValueType, String, T> deserialize()
+    public <T> BiFunction<ValueType, String, T> deserialize()
     {
         return deserializer.deserialize();
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/spi/src/test/java/org/qi4j/spi/entitystore/helpers/JSONManyAssociationStateTest.java
----------------------------------------------------------------------
diff --git a/core/spi/src/test/java/org/qi4j/spi/entitystore/helpers/JSONManyAssociationStateTest.java b/core/spi/src/test/java/org/qi4j/spi/entitystore/helpers/JSONManyAssociationStateTest.java
index d0c3426..1fd4613 100644
--- a/core/spi/src/test/java/org/qi4j/spi/entitystore/helpers/JSONManyAssociationStateTest.java
+++ b/core/spi/src/test/java/org/qi4j/spi/entitystore/helpers/JSONManyAssociationStateTest.java
@@ -16,12 +16,12 @@
 package org.qi4j.spi.entitystore.helpers;
 
 import java.util.List;
+import java.util.function.Function;
 import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONObject;
 import org.junit.Test;
 import org.qi4j.api.entity.EntityReference;
-import org.qi4j.functional.Function;
 import org.qi4j.spi.entity.EntityStatus;
 
 import static org.hamcrest.CoreMatchers.equalTo;
@@ -125,7 +125,7 @@ public class JSONManyAssociationStateTest
         List<String> refList = toList( map( new Function<EntityReference, String>()
         {
             @Override
-            public String map( EntityReference from )
+            public String apply( EntityReference from )
             {
                 return from.identity();
             }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/testsupport/src/main/java/org/qi4j/test/AbstractQi4jBaseTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/qi4j/test/AbstractQi4jBaseTest.java b/core/testsupport/src/main/java/org/qi4j/test/AbstractQi4jBaseTest.java
index 3c878a1..1a8386a 100644
--- a/core/testsupport/src/main/java/org/qi4j/test/AbstractQi4jBaseTest.java
+++ b/core/testsupport/src/main/java/org/qi4j/test/AbstractQi4jBaseTest.java
@@ -85,7 +85,7 @@ public abstract class AbstractQi4jBaseTest
     /**
      * This method is called when there was an AssemblyException in the creation of the Qi4j application model.
      * <p>
-     * Override this method to catch valid failures to place into satisfiedBy suites.
+     * Override this method to catch valid failures to place into test suites.
      * </p>
      * @param exception the exception thrown.
      *

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/testsupport/src/main/java/org/qi4j/test/AbstractQi4jScenarioTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/qi4j/test/AbstractQi4jScenarioTest.java b/core/testsupport/src/main/java/org/qi4j/test/AbstractQi4jScenarioTest.java
index 48e1f0b..8b038ff 100644
--- a/core/testsupport/src/main/java/org/qi4j/test/AbstractQi4jScenarioTest.java
+++ b/core/testsupport/src/main/java/org/qi4j/test/AbstractQi4jScenarioTest.java
@@ -98,7 +98,7 @@ public abstract class AbstractQi4jScenarioTest
     /**
      * This method is called when there was an AssemblyException in the creation of the Qi4j application model.
      * <p>
-     * Override this method to catch valid failures to place into satisfiedBy suites.
+     * Override this method to catch valid failures to place into test suites.
      * </p>
      *
      * @param exception the exception thrown.

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/testsupport/src/main/java/org/qi4j/test/cache/AbstractCachePoolTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/qi4j/test/cache/AbstractCachePoolTest.java b/core/testsupport/src/main/java/org/qi4j/test/cache/AbstractCachePoolTest.java
index aee81d1..5bf627b 100644
--- a/core/testsupport/src/main/java/org/qi4j/test/cache/AbstractCachePoolTest.java
+++ b/core/testsupport/src/main/java/org/qi4j/test/cache/AbstractCachePoolTest.java
@@ -32,7 +32,7 @@ import static org.junit.Assert.assertNull;
 import static org.junit.Assert.fail;
 
 /**
- * Abstract satisfiedBy with tests for the CachePool interface.
+ * Abstract test with tests for the CachePool interface.
  */
 public abstract class AbstractCachePoolTest
     extends AbstractQi4jTest

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/testsupport/src/main/java/org/qi4j/test/entity/AbstractEntityStoreTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/qi4j/test/entity/AbstractEntityStoreTest.java b/core/testsupport/src/main/java/org/qi4j/test/entity/AbstractEntityStoreTest.java
index 4549826..1917853 100644
--- a/core/testsupport/src/main/java/org/qi4j/test/entity/AbstractEntityStoreTest.java
+++ b/core/testsupport/src/main/java/org/qi4j/test/entity/AbstractEntityStoreTest.java
@@ -59,7 +59,7 @@ import static org.junit.Assert.assertThat;
 import static org.junit.Assert.fail;
 
 /**
- * Abstract satisfiedBy with tests for the EntityStore interface.
+ * Abstract test with tests for the EntityStore interface.
  */
 public abstract class AbstractEntityStoreTest
     extends AbstractQi4jTest

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractAnyQueryTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractAnyQueryTest.java b/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractAnyQueryTest.java
index be8e07a..40dd310 100644
--- a/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractAnyQueryTest.java
+++ b/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractAnyQueryTest.java
@@ -37,7 +37,7 @@ import org.qi4j.test.indexing.model.entities.FemaleEntity;
 import org.qi4j.test.indexing.model.entities.MaleEntity;
 
 /**
- * Abstract satisfiedBy with tests for any queries against Index/Query engines.
+ * Abstract test with tests for any queries against Index/Query engines.
  */
 public class AbstractAnyQueryTest
     extends AbstractQi4jTest

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractComplexQueryTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractComplexQueryTest.java b/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractComplexQueryTest.java
index 398f29d..b363af3 100644
--- a/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractComplexQueryTest.java
+++ b/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractComplexQueryTest.java
@@ -42,7 +42,7 @@ import static org.qi4j.api.query.QueryExpressions.templateFor;
 import static org.qi4j.test.indexing.NameableAssert.verifyUnorderedResults;
 
 /**
- * Abstract satisfiedBy with tests for complex queries against Index/Query engines, ie. queries by "example values".
+ * Abstract test with tests for complex queries against Index/Query engines, ie. queries by "example values".
  */
 public abstract class AbstractComplexQueryTest
     extends AbstractAnyQueryTest

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractEntityFinderTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractEntityFinderTest.java b/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractEntityFinderTest.java
index 8d881b7..84c71d0 100644
--- a/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractEntityFinderTest.java
+++ b/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractEntityFinderTest.java
@@ -26,13 +26,13 @@ import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.function.Predicate;
 import org.junit.Before;
 import org.junit.Test;
 import org.qi4j.api.composite.Composite;
 import org.qi4j.api.entity.EntityReference;
 import org.qi4j.api.query.grammar.OrderBy;
 import org.qi4j.api.service.ServiceReference;
-import org.qi4j.functional.Specification;
 import org.qi4j.spi.query.EntityFinder;
 import org.qi4j.spi.query.EntityFinderException;
 import org.qi4j.spi.query.IndexExporter;
@@ -59,13 +59,13 @@ import static org.qi4j.functional.Iterables.toList;
 import static org.qi4j.test.indexing.NameableAssert.assertNames;
 
 /**
- * Abstract satisfiedBy with tests for the EntityFinder interface.
+ * Abstract test with tests for the EntityFinder interface.
  */
 public abstract class AbstractEntityFinderTest
     extends AbstractAnyQueryTest
 {
 
-    private static final Specification<Composite> ALL = null;
+    private static final Predicate<Composite> ALL = null;
 
     private static final OrderBy[] NO_SORTING = null;
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractNamedQueryTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractNamedQueryTest.java b/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractNamedQueryTest.java
index a00e293..e439fed 100644
--- a/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractNamedQueryTest.java
+++ b/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractNamedQueryTest.java
@@ -20,13 +20,13 @@ package org.qi4j.test.indexing;
 import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.function.Predicate;
 import org.junit.Test;
 import org.qi4j.api.composite.Composite;
 import org.qi4j.api.query.Query;
 import org.qi4j.api.query.grammar.OrderBy;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.functional.Specification;
 import org.qi4j.spi.query.EntityFinderException;
 import org.qi4j.spi.query.IndexExporter;
 import org.qi4j.test.EntityTestAssembler;
@@ -45,13 +45,13 @@ import static org.qi4j.test.indexing.NameableAssert.verifyOrderedResults;
 import static org.qi4j.test.indexing.NameableAssert.verifyUnorderedResults;
 
 /**
- * Abstract satisfiedBy with tests for named queries against Index/Query engines.
+ * Abstract test with tests for named queries against Index/Query engines.
  */
 public abstract class AbstractNamedQueryTest
     extends AbstractAnyQueryTest
 {
 
-    private final Map<String, Specification<Composite>> queries = new HashMap<>();
+    private final Map<String, Predicate<Composite>> queries = new HashMap<>();
 
     @Override
     public void assemble( ModuleAssembly module )
@@ -65,7 +65,7 @@ public abstract class AbstractNamedQueryTest
             String queryName = String.format( "script%02d", i + 1 );
             if( query[i].length() != 0 )
             {
-                Specification<Composite> expression = createNamedQueryDescriptor( queryName, query[i] );
+                Predicate<Composite> expression = createNamedQueryDescriptor( queryName, query[i] );
                 queries.put( queryName, expression );
             }
         }
@@ -73,7 +73,7 @@ public abstract class AbstractNamedQueryTest
 
     protected abstract String[] queryStrings();
 
-    protected abstract Specification<Composite> createNamedQueryDescriptor( String queryName, String queryString );
+    protected abstract Predicate<Composite> createNamedQueryDescriptor( String queryName, String queryString );
 
     @Test
     public void showNetwork()

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractQueryTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractQueryTest.java b/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractQueryTest.java
index 8794358..38e36d8 100644
--- a/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractQueryTest.java
+++ b/core/testsupport/src/main/java/org/qi4j/test/indexing/AbstractQueryTest.java
@@ -70,7 +70,7 @@ import static org.qi4j.test.indexing.NameableAssert.verifyOrderedResults;
 import static org.qi4j.test.indexing.NameableAssert.verifyUnorderedResults;
 
 /**
- * Abstract satisfiedBy with tests for simple queries against Index/Query engines.
+ * Abstract test with tests for simple queries against Index/Query engines.
  */
 public abstract class AbstractQueryTest
     extends AbstractAnyQueryTest

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/ElasticSearchFinder.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/ElasticSearchFinder.java b/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/ElasticSearchFinder.java
index c74083e..40e966b 100644
--- a/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/ElasticSearchFinder.java
+++ b/extensions/indexing-elasticsearch/src/main/java/org/qi4j/index/elasticsearch/ElasticSearchFinder.java
@@ -19,6 +19,8 @@ package org.qi4j.index.elasticsearch;
 
 import java.util.HashMap;
 import java.util.Map;
+import java.util.function.Function;
+import java.util.function.Predicate;
 import org.elasticsearch.action.count.CountRequestBuilder;
 import org.elasticsearch.action.count.CountResponse;
 import org.elasticsearch.action.search.SearchRequestBuilder;
@@ -57,9 +59,7 @@ import org.qi4j.api.query.grammar.PropertyNotNullSpecification;
 import org.qi4j.api.query.grammar.PropertyNullSpecification;
 import org.qi4j.api.query.grammar.QuerySpecification;
 import org.qi4j.api.value.ValueComposite;
-import org.qi4j.functional.Function;
 import org.qi4j.functional.Iterables;
-import org.qi4j.functional.Specification;
 import org.qi4j.index.elasticsearch.ElasticSearchFinderSupport.ComplexTypeSupport;
 import org.qi4j.spi.query.EntityFinder;
 import org.qi4j.spi.query.EntityFinderException;
@@ -93,7 +93,7 @@ public interface ElasticSearchFinder
 
         @Override
         public Iterable<EntityReference> findEntities( Class<?> resultType,
-                                                       Specification<Composite> whereClause,
+                                                       Predicate<Composite> whereClause,
                                                        OrderBy[] orderBySegments,
                                                        Integer firstResult, Integer maxResults,
                                                        Map<String, Object> variables )
@@ -136,7 +136,7 @@ public interface ElasticSearchFinder
             return Iterables.map( new Function<SearchHit, EntityReference>()
             {
                 @Override
-                public EntityReference map( SearchHit from )
+                public EntityReference apply( SearchHit from )
                 {
                     return EntityReference.parseEntityReference( from.id() );
                 }
@@ -146,7 +146,7 @@ public interface ElasticSearchFinder
 
         @Override
         public EntityReference findEntity( Class<?> resultType,
-                                           Specification<Composite> whereClause,
+                                           Predicate<Composite> whereClause,
                                            Map<String, Object> variables )
             throws EntityFinderException
         {
@@ -175,7 +175,7 @@ public interface ElasticSearchFinder
 
         @Override
         public long countEntities( Class<?> resultType,
-                                   Specification<Composite> whereClause,
+                                   Predicate<Composite> whereClause,
                                    Map<String, Object> variables )
             throws EntityFinderException
         {
@@ -202,7 +202,7 @@ public interface ElasticSearchFinder
         }
 
         private QueryBuilder processWhereSpecification( AndFilterBuilder filterBuilder,
-                                                        Specification<Composite> spec,
+                                                        Predicate<Composite> spec,
                                                         Map<String, Object> variables )
             throws EntityFinderException
         {
@@ -221,7 +221,7 @@ public interface ElasticSearchFinder
         }
 
         private void processSpecification( FilterBuilder filterBuilder,
-                                           Specification<Composite> spec,
+                                           Predicate<Composite> spec,
                                            Map<String, Object> variables )
             throws EntityFinderException
         {
@@ -324,12 +324,12 @@ public interface ElasticSearchFinder
             throws EntityFinderException
         {
             LOGGER.trace( "Processing BinarySpecification {}", spec );
-            Iterable<Specification<Composite>> operands = spec.operands();
+            Iterable<Predicate<Composite>> operands = spec.operands();
 
             if( spec instanceof AndSpecification )
             {
                 AndFilterBuilder andFilterBuilder = new AndFilterBuilder();
-                for( Specification<Composite> operand : operands )
+                for( Predicate<Composite> operand : operands )
                 {
                     processSpecification( andFilterBuilder, operand, variables );
                 }
@@ -338,7 +338,7 @@ public interface ElasticSearchFinder
             else if( spec instanceof OrSpecification )
             {
                 OrFilterBuilder orFilterBuilder = new OrFilterBuilder();
-                for( Specification<Composite> operand : operands )
+                for( Predicate<Composite> operand : operands )
                 {
                     processSpecification( orFilterBuilder, operand, variables );
                 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/RdfQueryParser.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/RdfQueryParser.java b/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/RdfQueryParser.java
index ba2b99a..b86e032 100644
--- a/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/RdfQueryParser.java
+++ b/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/RdfQueryParser.java
@@ -19,14 +19,14 @@
 package org.qi4j.index.rdf.query;
 
 import java.util.Map;
+import java.util.function.Predicate;
 import org.qi4j.api.composite.Composite;
 import org.qi4j.api.query.grammar.OrderBy;
-import org.qi4j.functional.Specification;
 
 public interface RdfQueryParser
 {
     String constructQuery( Class<?> resultType,
-                           Specification<Composite> whereClause,
+                           Predicate<Composite> whereClause,
                            OrderBy[] orderBySegments,
                            Integer firstResult,
                            Integer maxResults,

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/RdfQueryService.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/RdfQueryService.java b/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/RdfQueryService.java
index bb8b454..077241b 100644
--- a/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/RdfQueryService.java
+++ b/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/RdfQueryService.java
@@ -18,6 +18,7 @@
 package org.qi4j.index.rdf.query;
 
 import java.util.Map;
+import java.util.function.Predicate;
 import org.openrdf.query.QueryLanguage;
 import org.qi4j.api.composite.Composite;
 import org.qi4j.api.entity.EntityReference;
@@ -27,7 +28,6 @@ import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.query.grammar.OrderBy;
 import org.qi4j.api.query.grammar.QuerySpecification;
 import org.qi4j.api.service.ServiceComposite;
-import org.qi4j.functional.Specification;
 import org.qi4j.spi.query.EntityFinder;
 import org.qi4j.spi.query.EntityFinderException;
 
@@ -55,7 +55,7 @@ public interface RdfQueryService
 
         @Override
         public Iterable<EntityReference> findEntities( Class<?> resultType,
-                                                       Specification<Composite> whereClause,
+                                                       Predicate<Composite> whereClause,
                                                        OrderBy[] orderBySegments,
                                                        Integer firstResult,
                                                        Integer maxResults,
@@ -82,7 +82,7 @@ public interface RdfQueryService
         }
 
         @Override
-        public EntityReference findEntity( Class<?> resultType, Specification<Composite> whereClause, Map<String, Object> variables )
+        public EntityReference findEntity( Class<?> resultType, Predicate<Composite> whereClause, Map<String, Object> variables )
             throws EntityFinderException
         {
             final SingleQualifiedIdentityResultCallback singleCallback = new SingleQualifiedIdentityResultCallback();
@@ -102,7 +102,7 @@ public interface RdfQueryService
         }
 
         @Override
-        public long countEntities( Class<?> resultType, Specification<Composite> whereClause, Map<String, Object> variables )
+        public long countEntities( Class<?> resultType, Predicate<Composite> whereClause, Map<String, Object> variables )
             throws EntityFinderException
         {
             if (QuerySpecification.isQueryLanguage( "SERQL", whereClause ))

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/internal/RdfQueryParserImpl.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/internal/RdfQueryParserImpl.java b/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/internal/RdfQueryParserImpl.java
index 122ce01..30958b1 100644
--- a/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/internal/RdfQueryParserImpl.java
+++ b/extensions/indexing-rdf/src/main/java/org/qi4j/index/rdf/query/internal/RdfQueryParserImpl.java
@@ -27,6 +27,7 @@ import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 import java.util.TimeZone;
+import java.util.function.Predicate;
 import org.apache.commons.lang.StringEscapeUtils;
 import org.qi4j.api.composite.Composite;
 import org.qi4j.api.entity.EntityComposite;
@@ -55,7 +56,6 @@ import org.qi4j.api.query.grammar.Variable;
 import org.qi4j.api.value.ValueSerializer;
 import org.qi4j.api.value.ValueSerializer.Options;
 import org.qi4j.functional.Iterables;
-import org.qi4j.functional.Specification;
 import org.qi4j.index.rdf.query.RdfQueryParser;
 import org.qi4j.spi.Qi4jSPI;
 import org.slf4j.LoggerFactory;
@@ -111,7 +111,7 @@ public class RdfQueryParserImpl
 
     @Override
     public String constructQuery( final Class<?> resultType,
-                                  final Specification<Composite> specification,
+                                  final Predicate<Composite> specification,
                                   final OrderBy[] orderBySegments,
                                   final Integer firstResult,
                                   final Integer maxResults,
@@ -214,7 +214,7 @@ public class RdfQueryParserImpl
         return query.toString();
     }
 
-    private void processFilter( final Specification<Composite> expression, boolean allowInline, StringBuilder builder )
+    private void processFilter( final Predicate<Composite> expression, boolean allowInline, StringBuilder builder )
     {
         if( expression == null )
         {
@@ -227,7 +227,7 @@ public class RdfQueryParserImpl
 
             int start = builder.length();
             boolean first = true;
-            for( Specification<Composite> operand : conjunction.operands() )
+            for( Predicate<Composite> operand : conjunction.operands() )
             {
                 int size = builder.length();
                 processFilter( operand, allowInline, builder );
@@ -256,7 +256,7 @@ public class RdfQueryParserImpl
 
             int start = builder.length();
             boolean first = true;
-            for( Specification<Composite> operand : disjunction.operands() )
+            for( Predicate<Composite> operand : disjunction.operands() )
             {
                 int size = builder.length();
                 processFilter( operand, false, builder );
@@ -437,7 +437,7 @@ public class RdfQueryParserImpl
         builder.append( format( "regex(%s,\"%s\")", valueVariable, predicate.regexp() ) );
     }
 
-    private void processComparisonPredicate( final Specification<Composite> predicate,
+    private void processComparisonPredicate( final Predicate<Composite> predicate,
                                              boolean allowInline,
                                              StringBuilder builder
     )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/extensions/indexing-rdf/src/test/java/org/qi4j/index/rdf/RdfNamedQueryTest.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-rdf/src/test/java/org/qi4j/index/rdf/RdfNamedQueryTest.java b/extensions/indexing-rdf/src/test/java/org/qi4j/index/rdf/RdfNamedQueryTest.java
index bdd2725..f965550 100644
--- a/extensions/indexing-rdf/src/test/java/org/qi4j/index/rdf/RdfNamedQueryTest.java
+++ b/extensions/indexing-rdf/src/test/java/org/qi4j/index/rdf/RdfNamedQueryTest.java
@@ -17,11 +17,11 @@
  */
 package org.qi4j.index.rdf;
 
+import java.util.function.Predicate;
 import org.qi4j.api.composite.Composite;
 import org.qi4j.api.value.ValueSerialization;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.functional.Specification;
 import org.qi4j.index.rdf.query.RdfQueryParserFactory;
 import org.qi4j.index.rdf.query.SesameExpressions;
 import org.qi4j.library.rdf.entity.EntityStateSerializer;
@@ -39,7 +39,7 @@ public class RdfNamedQueryTest extends AbstractNamedQueryTest
     }
 
     @Override
-    protected Specification<Composite> createNamedQueryDescriptor( String queryName, String queryString )
+    protected Predicate<Composite> createNamedQueryDescriptor( String queryName, String queryString )
     {
         return SesameExpressions.sparql( queryString );
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/extensions/indexing-solr/src/main/java/org/qi4j/index/solr/internal/SolrEntityQueryMixin.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-solr/src/main/java/org/qi4j/index/solr/internal/SolrEntityQueryMixin.java b/extensions/indexing-solr/src/main/java/org/qi4j/index/solr/internal/SolrEntityQueryMixin.java
index 73e4988..15d185b 100644
--- a/extensions/indexing-solr/src/main/java/org/qi4j/index/solr/internal/SolrEntityQueryMixin.java
+++ b/extensions/indexing-solr/src/main/java/org/qi4j/index/solr/internal/SolrEntityQueryMixin.java
@@ -19,6 +19,7 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.function.Predicate;
 import org.apache.solr.client.solrj.SolrServer;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.response.QueryResponse;
@@ -33,7 +34,6 @@ import org.qi4j.api.injection.scope.Service;
 import org.qi4j.api.query.grammar.OrderBy;
 import org.qi4j.api.query.grammar.QuerySpecification;
 import org.qi4j.functional.Iterables;
-import org.qi4j.functional.Specification;
 import org.qi4j.index.solr.EmbeddedSolrService;
 import org.qi4j.index.solr.SolrSearch;
 import org.qi4j.spi.query.EntityFinder;
@@ -53,7 +53,7 @@ public class SolrEntityQueryMixin
     private Logger logger = LoggerFactory.getLogger( SolrEntityQueryMixin.class );
 
     @Override
-    public Iterable<EntityReference> findEntities( Class<?> resultType, @Optional Specification<Composite> whereClause, @Optional OrderBy[] orderBySegments, @Optional Integer firstResult, @Optional Integer maxResults, Map<String, Object> variables ) throws EntityFinderException
+    public Iterable<EntityReference> findEntities( Class<?> resultType, @Optional Predicate<Composite> whereClause, @Optional OrderBy[] orderBySegments, @Optional Integer firstResult, @Optional Integer maxResults, Map<String, Object> variables ) throws EntityFinderException
     {
         try
         {
@@ -99,7 +99,7 @@ public class SolrEntityQueryMixin
     }
 
     @Override
-    public EntityReference findEntity( Class<?> resultType, @Optional Specification<Composite> whereClause, Map<String, Object> variables ) throws EntityFinderException
+    public EntityReference findEntity( Class<?> resultType, @Optional Predicate<Composite> whereClause, Map<String, Object> variables ) throws EntityFinderException
     {
         Iterator<EntityReference> iter = findEntities( resultType, whereClause, null, 0, 1, variables ).iterator();
 
@@ -110,7 +110,7 @@ public class SolrEntityQueryMixin
     }
 
     @Override
-    public long countEntities( Class<?> resultType, @Optional Specification<Composite> whereClause, Map<String, Object> variables ) throws EntityFinderException
+    public long countEntities( Class<?> resultType, @Optional Predicate<Composite> whereClause, Map<String, Object> variables ) throws EntityFinderException
     {
         return Iterables.count( findEntities( resultType, whereClause, null, 0, 1, variables ) );
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/extensions/indexing-solr/src/test/java/org/qi4j/index/solr/SolrNamedQueryTest.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-solr/src/test/java/org/qi4j/index/solr/SolrNamedQueryTest.java b/extensions/indexing-solr/src/test/java/org/qi4j/index/solr/SolrNamedQueryTest.java
index d64de1e..302d440 100644
--- a/extensions/indexing-solr/src/test/java/org/qi4j/index/solr/SolrNamedQueryTest.java
+++ b/extensions/indexing-solr/src/test/java/org/qi4j/index/solr/SolrNamedQueryTest.java
@@ -18,12 +18,12 @@
 package org.qi4j.index.solr;
 
 import java.io.File;
+import java.util.function.Predicate;
 import org.junit.Ignore;
 import org.junit.Rule;
 import org.qi4j.api.composite.Composite;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.functional.Specification;
 import org.qi4j.library.fileconfig.FileConfigurationOverride;
 import org.qi4j.library.fileconfig.FileConfigurationService;
 import org.qi4j.test.indexing.AbstractNamedQueryTest;
@@ -59,7 +59,7 @@ public class SolrNamedQueryTest
     }
 
     @Override
-    protected Specification<Composite> createNamedQueryDescriptor( String queryName, String queryString )
+    protected Predicate<Composite> createNamedQueryDescriptor( String queryName, String queryString )
     {
         return SolrExpressions.search( queryString );
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/internal/SQLEntityFinder.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/internal/SQLEntityFinder.java b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/internal/SQLEntityFinder.java
index 375b119..fa7982c 100644
--- a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/internal/SQLEntityFinder.java
+++ b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/internal/SQLEntityFinder.java
@@ -25,13 +25,13 @@ import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+import java.util.function.Predicate;
 import javax.sql.DataSource;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.composite.Composite;
 import org.qi4j.api.entity.EntityReference;
 import org.qi4j.api.injection.scope.Service;
 import org.qi4j.api.query.grammar.OrderBy;
-import org.qi4j.functional.Specification;
 import org.qi4j.index.sql.support.api.SQLQuerying;
 import org.qi4j.library.sql.common.SQLUtil;
 import org.qi4j.spi.query.EntityFinder;
@@ -58,7 +58,7 @@ public class SQLEntityFinder
     }
 
     @Override
-    public long countEntities( Class<?> resultType, @Optional Specification<Composite> whereClause, Map<String, Object> variables )
+    public long countEntities( Class<?> resultType, @Optional Predicate<Composite> whereClause, Map<String, Object> variables )
         throws EntityFinderException
     {
         final List<Object> values = new ArrayList<>();
@@ -93,7 +93,7 @@ public class SQLEntityFinder
 
     @Override
     public Iterable<EntityReference> findEntities( Class<?> resultType,
-                                                   @Optional Specification<Composite> whereClause,
+                                                   @Optional Predicate<Composite> whereClause,
                                                    @Optional OrderBy[] orderBySegments,
                                                    @Optional final Integer firstResult,
                                                    @Optional final Integer maxResults,
@@ -161,7 +161,7 @@ public class SQLEntityFinder
 
     @Override
     public EntityReference findEntity( Class<?> resultType,
-                                       @Optional Specification<Composite> whereClause,
+                                       @Optional Predicate<Composite> whereClause,
                                        Map<String, Object> variables )
         throws EntityFinderException
     {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/api/SQLQuerying.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/api/SQLQuerying.java b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/api/SQLQuerying.java
index de9b61c..d7db4d7 100644
--- a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/api/SQLQuerying.java
+++ b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/api/SQLQuerying.java
@@ -20,10 +20,10 @@ package org.qi4j.index.sql.support.api;
 import java.sql.PreparedStatement;
 import java.util.List;
 import java.util.Map;
+import java.util.function.Predicate;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.composite.Composite;
 import org.qi4j.api.query.grammar.OrderBy;
-import org.qi4j.functional.Specification;
 import org.qi4j.spi.query.EntityFinderException;
 
 /**
@@ -53,7 +53,7 @@ public interface SQLQuerying
      */
     public String constructQuery( //
         Class<?> resultType, //
-        @Optional Specification<Composite> whereClause, //
+        @Optional Predicate<Composite> whereClause, //
         @Optional OrderBy[] orderBySegments, //
         @Optional Integer firstResult, //
         @Optional Integer maxResults, //

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/postgresql/PostgreSQLQuerying.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/postgresql/PostgreSQLQuerying.java b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/postgresql/PostgreSQLQuerying.java
index 9f8733f..65dfe7f 100644
--- a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/postgresql/PostgreSQLQuerying.java
+++ b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/postgresql/PostgreSQLQuerying.java
@@ -20,9 +20,9 @@ package org.qi4j.index.sql.support.postgresql;
 
 import java.util.List;
 import java.util.Map;
+import java.util.function.Predicate;
 import org.qi4j.api.composite.Composite;
 import org.qi4j.api.query.grammar.OrderBy;
-import org.qi4j.functional.Specification;
 import org.qi4j.index.sql.support.skeletons.AbstractSQLQuerying;
 import org.sql.generation.api.grammar.builders.query.QuerySpecificationBuilder;
 import org.sql.generation.api.grammar.query.QueryExpression;
@@ -36,7 +36,7 @@ public class PostgreSQLQuerying
     protected QueryExpression finalizeQuery(
             SQLVendor sqlVendor, QuerySpecificationBuilder specBuilder,
             Class<?> resultType,
-            Specification<Composite> whereClause,
+            Predicate<Composite> whereClause,
             OrderBy[] orderBySegments,
             Integer firstResult,
             Integer maxResults,

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLIndexing.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLIndexing.java b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLIndexing.java
index 5f3457a..aab952d 100644
--- a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLIndexing.java
+++ b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLIndexing.java
@@ -31,6 +31,7 @@ import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
+import java.util.function.Predicate;
 import javax.sql.DataSource;
 import org.qi4j.api.Qi4j;
 import org.qi4j.api.association.AssociationDescriptor;
@@ -47,9 +48,7 @@ import org.qi4j.api.service.ServiceDescriptor;
 import org.qi4j.api.structure.Application;
 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.functional.Specification;
 import org.qi4j.index.sql.support.api.SQLIndexing;
 import org.qi4j.index.sql.support.common.DBNames;
 import org.qi4j.index.sql.support.common.QNameInfo;
@@ -198,10 +197,10 @@ public abstract class AbstractSQLIndexing
             Map<Long, EntityState> statesByPK = new HashMap<>();
             Map<Long, Integer> qNamePKs = new HashMap<>();
 
-            Iterable<EntityState> relatedStates = Iterables.filter( new Specification<EntityState>()
+            Iterable<EntityState> relatedStates = Iterables.filter( new Predicate<EntityState>()
             {
                 @Override
-                public boolean satisfiedBy( EntityState item )
+                public boolean test( EntityState item )
                 {
                     return item.entityDescriptor().queryable();
                 }
@@ -928,7 +927,7 @@ public abstract class AbstractSQLIndexing
         throws SQLException
     {
         ValueDescriptor vDesc = this._qi4SPI.valueDescriptorFor( (ValueComposite) property );
-        StateHolder state = Qi4j.FUNCTION_COMPOSITE_INSTANCE_OF.map( (ValueComposite) property ).state();
+        StateHolder state = Qi4j.FUNCTION_COMPOSITE_INSTANCE_OF.apply( (ValueComposite) property ).state();
         Integer originalPropertyPK = propertyPK;
         ++propertyPK;
         for( PropertyDescriptor pDesc : vDesc.state().properties() )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLQuerying.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLQuerying.java b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLQuerying.java
index 79ad2e2..70ab854 100644
--- a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLQuerying.java
+++ b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLQuerying.java
@@ -28,6 +28,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.Stack;
+import java.util.function.Predicate;
 import org.qi4j.api.Qi4j;
 import org.qi4j.api.common.QualifiedName;
 import org.qi4j.api.composite.Composite;
@@ -65,7 +66,6 @@ import org.qi4j.api.service.ServiceDescriptor;
 import org.qi4j.api.structure.Module;
 import org.qi4j.api.value.ValueComposite;
 import org.qi4j.functional.Iterables;
-import org.qi4j.functional.Specification;
 import org.qi4j.index.sql.support.api.SQLQuerying;
 import org.qi4j.index.sql.support.common.DBNames;
 import org.qi4j.index.sql.support.common.QNameInfo;
@@ -196,7 +196,7 @@ public abstract class AbstractSQLQuerying
     {
         public QueryBuilder processBooleanExpression(
             AbstractSQLQuerying thisObject,
-            Specification<Composite> expression,
+            Predicate<Composite> expression,
             Boolean negationActive,
             SQLVendor vendor,
             org.sql.generation.api.grammar.booleans.BooleanExpression entityTypeCondition,
@@ -206,11 +206,11 @@ public abstract class AbstractSQLQuerying
         );
     }
 
-    private static final Map<Class<? extends Specification>, SQLBooleanCreator> SQL_OPERATORS;
+    private static final Map<Class<? extends Predicate>, SQLBooleanCreator> SQL_OPERATORS;
 
-    private static final Map<Class<? extends Specification>, JoinType> JOIN_STYLES;
+    private static final Map<Class<? extends Predicate>, JoinType> JOIN_STYLES;
 
-    private static final Map<Class<? extends Specification>, JoinType> NEGATED_JOIN_STYLES;
+    private static final Map<Class<? extends Predicate>, JoinType> NEGATED_JOIN_STYLES;
 
     private static final Map<Class<?>, BooleanExpressionProcessor> EXPRESSION_PROCESSORS;
 
@@ -350,14 +350,14 @@ public abstract class AbstractSQLQuerying
             @Override
             public QueryBuilder processBooleanExpression(
                 AbstractSQLQuerying thisObject,
-                Specification<Composite> expression, Boolean negationActive, SQLVendor vendor,
+                Predicate<Composite> expression, Boolean negationActive, SQLVendor vendor,
                 BooleanExpression entityTypeCondition, Map<String, Object> variables,
                 List<Object> values,
                 List<Integer> valueSQLTypes )
             {
                 QueryBuilder result = null;
                 AndSpecification conjunction = (AndSpecification) expression;
-                for( Specification<Composite> entitySpecification : conjunction.operands() )
+                for( Predicate<Composite> entitySpecification : conjunction.operands() )
                 {
                     if( result == null )
                     {
@@ -382,14 +382,14 @@ public abstract class AbstractSQLQuerying
             @Override
             public QueryBuilder processBooleanExpression(
                 AbstractSQLQuerying thisObject,
-                Specification<Composite> expression, Boolean negationActive, SQLVendor vendor,
+                Predicate<Composite> expression, Boolean negationActive, SQLVendor vendor,
                 BooleanExpression entityTypeCondition, Map<String, Object> variables,
                 List<Object> values,
                 List<Integer> valueSQLTypes )
             {
                 QueryBuilder result = null;
                 OrSpecification conjunction = (OrSpecification) expression;
-                for( Specification<Composite> entitySpecification : conjunction.operands() )
+                for( Predicate<Composite> entitySpecification : conjunction.operands() )
                 {
                     if( result == null )
                     {
@@ -416,7 +416,7 @@ public abstract class AbstractSQLQuerying
             @Override
             public QueryBuilder processBooleanExpression(
                 AbstractSQLQuerying thisObject,
-                Specification<Composite> expression, Boolean negationActive, SQLVendor vendor,
+                Predicate<Composite> expression, Boolean negationActive, SQLVendor vendor,
                 BooleanExpression entityTypeCondition, Map<String, Object> variables,
                 List<Object> values,
                 List<Integer> valueSQLTypes )
@@ -431,7 +431,7 @@ public abstract class AbstractSQLQuerying
             @Override
             public QueryBuilder processBooleanExpression(
                 AbstractSQLQuerying thisObject,
-                Specification<Composite> expression, Boolean negationActive, SQLVendor vendor,
+                Predicate<Composite> expression, Boolean negationActive, SQLVendor vendor,
                 BooleanExpression entityTypeCondition, Map<String, Object> variables,
                 List<Object> values,
                 List<Integer> valueSQLTypes )
@@ -446,7 +446,7 @@ public abstract class AbstractSQLQuerying
             @Override
             public QueryBuilder processBooleanExpression(
                 AbstractSQLQuerying thisObject,
-                Specification<Composite> expression, Boolean negationActive,
+                Predicate<Composite> expression, Boolean negationActive,
                 SQLVendor vendor,
                 BooleanExpression entityTypeCondition, Map<String, Object> variables,
                 List<Object> values,
@@ -463,7 +463,7 @@ public abstract class AbstractSQLQuerying
             @Override
             public QueryBuilder processBooleanExpression(
                 AbstractSQLQuerying thisObject,
-                Specification<Composite> expression, Boolean negationActive,
+                Predicate<Composite> expression, Boolean negationActive,
                 SQLVendor vendor,
                 BooleanExpression entityTypeCondition, Map<String, Object> variables,
                 List<Object> values,
@@ -479,7 +479,7 @@ public abstract class AbstractSQLQuerying
             @Override
             public QueryBuilder processBooleanExpression(
                 AbstractSQLQuerying thisObject,
-                Specification<Composite> expression, Boolean negationActive,
+                Predicate<Composite> expression, Boolean negationActive,
                 SQLVendor vendor,
                 BooleanExpression entityTypeCondition, Map<String, Object> variables,
                 List<Object> values,
@@ -495,7 +495,7 @@ public abstract class AbstractSQLQuerying
             @Override
             public QueryBuilder processBooleanExpression(
                 AbstractSQLQuerying thisObject,
-                Specification<Composite> expression, Boolean negationActive,
+                Predicate<Composite> expression, Boolean negationActive,
                 SQLVendor vendor,
                 BooleanExpression entityTypeCondition, Map<String, Object> variables,
                 List<Object> values,
@@ -510,7 +510,7 @@ public abstract class AbstractSQLQuerying
         {
             @Override
             public QueryBuilder processBooleanExpression( AbstractSQLQuerying thisObject,
-                                                          Specification<Composite> expression, Boolean negationActive,
+                                                          Predicate<Composite> expression, Boolean negationActive,
                                                           SQLVendor vendor,
                                                           BooleanExpression entityTypeCondition, Map<String, Object> variables,
                                                           List<Object> values,
@@ -526,7 +526,7 @@ public abstract class AbstractSQLQuerying
             @Override
             public QueryBuilder processBooleanExpression(
                 AbstractSQLQuerying thisObject,
-                Specification<Composite> expression, Boolean negationActive, SQLVendor vendor,
+                Predicate<Composite> expression, Boolean negationActive, SQLVendor vendor,
                 BooleanExpression entityTypeCondition, Map<String, Object> variables,
                 List<Object> values,
                 List<Integer> valueSQLTypes )
@@ -541,7 +541,7 @@ public abstract class AbstractSQLQuerying
             @Override
             public QueryBuilder processBooleanExpression(
                 AbstractSQLQuerying thisObject,
-                Specification<Composite> expression, Boolean negationActive, SQLVendor vendor,
+                Predicate<Composite> expression, Boolean negationActive, SQLVendor vendor,
                 BooleanExpression entityTypeCondition, Map<String, Object> variables,
                 List<Object> values,
                 List<Integer> valueSQLTypes )
@@ -556,7 +556,7 @@ public abstract class AbstractSQLQuerying
             @Override
             public QueryBuilder processBooleanExpression(
                 AbstractSQLQuerying thisObject,
-                Specification<Composite> expression, Boolean negationActive, SQLVendor vendor,
+                Predicate<Composite> expression, Boolean negationActive, SQLVendor vendor,
                 BooleanExpression entityTypeCondition, Map<String, Object> variables,
                 List<Object> values,
                 List<Integer> valueSQLTypes )
@@ -744,7 +744,7 @@ public abstract class AbstractSQLQuerying
 
     @Override
     public String constructQuery( Class<?> resultType, //
-                                  Specification<Composite> whereClause, //
+                                  Predicate<Composite> whereClause, //
                                   OrderBy[] orderBySegments, //
                                   Integer firstResult, //
                                   Integer maxResults, //
@@ -813,7 +813,7 @@ public abstract class AbstractSQLQuerying
     protected abstract QueryExpression finalizeQuery(
         SQLVendor sqlVendor, QuerySpecificationBuilder specBuilder,
         Class<?> resultType,
-        Specification<Composite> whereClause,
+        Predicate<Composite> whereClause,
         OrderBy[] orderBySegments,
         Integer firstResult,
         Integer maxResults,
@@ -823,7 +823,7 @@ public abstract class AbstractSQLQuerying
         Boolean countOnly );
 
     protected QueryBuilder processBooleanExpression(
-        Specification<Composite> expression,
+        Predicate<Composite> expression,
         Boolean negationActive,
         SQLVendor vendor,
         org.sql.generation.api.grammar.booleans.BooleanExpression entityTypeCondition,
@@ -1248,7 +1248,7 @@ public abstract class AbstractSQLQuerying
     }
 
     protected QueryBuilder singleQuery(
-        Specification<Composite> predicate, //
+        Predicate<Composite> predicate, //
         PropertyFunction<?> propRef, //
         TraversedAssoOrManyAssoRef assoRef, //
         Boolean includeLastAssoPathTable, //
@@ -1265,7 +1265,7 @@ public abstract class AbstractSQLQuerying
     }
 
     protected QuerySpecification constructQueryForPredicate(
-        Specification<Composite> predicate, //
+        Predicate<Composite> predicate, //
         PropertyFunction<?> propRef, //
         TraversedAssoOrManyAssoRef assoRef, //
         Boolean includeLastAssoPathTable, //
@@ -1340,29 +1340,29 @@ public abstract class AbstractSQLQuerying
         );
     }
 
-    protected SQLBooleanCreator getOperator( Specification<Composite> predicate )
+    protected SQLBooleanCreator getOperator( Predicate<Composite> predicate )
     {
         return this.findFromLookupTables( SQL_OPERATORS, null, predicate, false );
     }
 
     protected JoinType
-        getTableJoinStyle( Specification<Composite> predicate, Boolean negationActive )
+        getTableJoinStyle( Predicate<Composite> predicate, Boolean negationActive )
     {
         return this.findFromLookupTables( JOIN_STYLES, NEGATED_JOIN_STYLES, predicate,
                                           negationActive );
     }
 
     protected <ReturnType> ReturnType findFromLookupTables(
-        Map<Class<? extends Specification>, ReturnType> normal,
-        Map<Class<? extends Specification>, ReturnType> negated,
-        Specification<Composite> predicate, Boolean negationActive )
+        Map<Class<? extends Predicate>, ReturnType> normal,
+        Map<Class<? extends Predicate>, ReturnType> negated,
+        Predicate<Composite> predicate, Boolean negationActive )
     {
-        Class<? extends Specification> predicateClass = predicate.getClass();
+        Class<? extends Predicate> predicateClass = predicate.getClass();
         ReturnType result = null;
-        Set<Map.Entry<Class<? extends Specification>, ReturnType>> entries = negationActive
+        Set<Map.Entry<Class<? extends Predicate>, ReturnType>> entries = negationActive
                                                                              ? negated.entrySet()
                                                                              : normal.entrySet();
-        for( Map.Entry<Class<? extends Specification>, ReturnType> entry : entries )
+        for( Map.Entry<Class<? extends Predicate>, ReturnType> entry : entries )
         {
             if( entry.getKey().isAssignableFrom( predicateClass ) )
             {
@@ -1644,7 +1644,7 @@ public abstract class AbstractSQLQuerying
     protected Integer modifyFromClauseAndWhereClauseToGetValue(
         final QualifiedName qName,
         Object value,
-        final Specification<Composite> predicate, final Boolean negationActive,
+        final Predicate<Composite> predicate, final Boolean negationActive,
         final Integer currentTableIndex,
         final ModifiableInt maxTableIndex, final String columnName,
         final String collectionPath,
@@ -1747,7 +1747,7 @@ public abstract class AbstractSQLQuerying
             // Visit all properties with recursion and make joins as necessary
             // @formatter:off
             for( Property<?> property
-                 : Qi4j.FUNCTION_COMPOSITE_INSTANCE_OF.map( (ValueComposite) value ).state().properties() )
+                 : Qi4j.FUNCTION_COMPOSITE_INSTANCE_OF.apply( (ValueComposite) value ).state().properties() )
             {
                 Boolean qNameJoinDone = false;
                 Integer sourceIndex = maxTableIndex.getInt();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLStartup.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLStartup.java b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLStartup.java
index ddb2041..8a62b59 100644
--- a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLStartup.java
+++ b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/AbstractSQLStartup.java
@@ -37,6 +37,8 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.function.Function;
+import java.util.function.Predicate;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import javax.sql.DataSource;
@@ -58,10 +60,8 @@ import org.qi4j.api.structure.ApplicationDescriptor;
 import org.qi4j.api.structure.LayerDescriptor;
 import org.qi4j.api.structure.ModuleDescriptor;
 import org.qi4j.api.value.ValueDescriptor;
-import org.qi4j.functional.Function;
 import org.qi4j.functional.HierarchicalVisitorAdapter;
 import org.qi4j.functional.Iterables;
-import org.qi4j.functional.Specification;
 import org.qi4j.index.reindexer.Reindexer;
 import org.qi4j.index.sql.support.api.SQLAppStartup;
 import org.qi4j.index.sql.support.api.SQLTypeInfo;
@@ -1520,10 +1520,10 @@ public abstract class AbstractSQLStartup
                             // TODO this doesn't understand, say, Map<String, String>, or indeed,
                             // any
                             // other Serializable
-                            if( Iterables.matchesAny( new Specification<Class<?>>()
+                            if( Iterables.matchesAny( new Predicate<Class<?>>()
                             {
                                 @Override
-                                public boolean satisfiedBy( Class<?> item )
+                                public boolean test( Class<?> item )
                                 {
                                     return vTypeClass.isAssignableFrom( item );
                                 }
@@ -1690,7 +1690,7 @@ public abstract class AbstractSQLStartup
                + Iterables.toString( descriptor.types(), new Function<Class<?>, String>()
         {
             @Override
-            public String map( Class<?> item )
+            public String apply( Class<?> item )
             {
                 return item.getName();
             }
@@ -1739,7 +1739,7 @@ public abstract class AbstractSQLStartup
                         new Function<Class<?>, String>()
                         {
                             @Override
-                            public String map( Class<?> from )
+                            public String apply( Class<?> from )
                             {
                                 return from.getName();
                             }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/SQLCompatEntityStateWrapper.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/SQLCompatEntityStateWrapper.java b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/SQLCompatEntityStateWrapper.java
index 2dad7f1..82fe6de 100644
--- a/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/SQLCompatEntityStateWrapper.java
+++ b/extensions/indexing-sql/src/main/java/org/qi4j/index/sql/support/skeletons/SQLCompatEntityStateWrapper.java
@@ -17,6 +17,8 @@
  */
 package org.qi4j.index.sql.support.skeletons;
 
+import java.util.function.Function;
+import java.util.function.Predicate;
 import org.qi4j.api.association.AssociationDescriptor;
 import org.qi4j.api.association.AssociationStateDescriptor;
 import org.qi4j.api.common.QualifiedName;
@@ -27,9 +29,7 @@ import org.qi4j.api.property.PropertyDescriptor;
 import org.qi4j.api.type.CollectionType;
 import org.qi4j.api.type.ValueCompositeType;
 import org.qi4j.api.type.ValueType;
-import org.qi4j.functional.Function;
 import org.qi4j.functional.Iterables;
-import org.qi4j.functional.Specification;
 import org.qi4j.spi.entity.EntityState;
 import org.qi4j.spi.entity.EntityStatus;
 import org.qi4j.spi.entity.ManyAssociationState;
@@ -52,16 +52,16 @@ import org.slf4j.LoggerFactory;
     {
 
         @Override
-        public EntityState map( EntityState from )
+        public EntityState apply( EntityState from )
         {
             return new SQLCompatEntityStateWrapper( from );
         }
     };
-    private static final Specification<PropertyDescriptor> PROPERTY_SPEC = new Specification<PropertyDescriptor>()
+    private static final Predicate<PropertyDescriptor> PROPERTY_SPEC = new Predicate<PropertyDescriptor>()
     {
 
         @Override
-        public boolean satisfiedBy( PropertyDescriptor propertyDescriptor )
+        public boolean test( PropertyDescriptor propertyDescriptor )
         {
             boolean supported = isSupported( propertyDescriptor.valueType() );
             if( !supported )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/extensions/valueserialization-jackson/src/main/java/org/qi4j/valueserialization/jackson/JacksonValueDeserializer.java
----------------------------------------------------------------------
diff --git a/extensions/valueserialization-jackson/src/main/java/org/qi4j/valueserialization/jackson/JacksonValueDeserializer.java b/extensions/valueserialization-jackson/src/main/java/org/qi4j/valueserialization/jackson/JacksonValueDeserializer.java
index 5c6774b..f9c1e7f 100644
--- a/extensions/valueserialization-jackson/src/main/java/org/qi4j/valueserialization/jackson/JacksonValueDeserializer.java
+++ b/extensions/valueserialization-jackson/src/main/java/org/qi4j/valueserialization/jackson/JacksonValueDeserializer.java
@@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
 import java.io.InputStream;
 import java.util.Collection;
 import java.util.Map;
+import java.util.function.Function;
 import org.qi4j.api.injection.scope.Service;
 import org.qi4j.api.injection.scope.Structure;
 import org.qi4j.api.service.ServiceReference;
@@ -33,7 +34,6 @@ import org.qi4j.api.structure.Module;
 import org.qi4j.api.type.ValueType;
 import org.qi4j.api.value.ValueDeserializer;
 import org.qi4j.api.value.ValueSerializationException;
-import org.qi4j.functional.Function;
 import org.qi4j.spi.value.ValueDeserializerAdapter;
 
 /**
@@ -125,7 +125,7 @@ public class JacksonValueDeserializer
         }
         while( input.nextToken() != JsonToken.END_ARRAY )
         {
-            T element = deserializer.map( input );
+            T element = deserializer.apply( input );
             collection.add( element );
         }
         return collection;
@@ -173,11 +173,11 @@ public class JacksonValueDeserializer
                 input.nextToken();
                 if( "key".equals( objectKey ) )
                 {
-                    key = keyDeserializer.map( input );
+                    key = keyDeserializer.apply( input );
                 }
                 else if( "value".equals( objectKey ) )
                 {
-                    value = valueDeserializer.map( input );
+                    value = valueDeserializer.apply( input );
                 }
                 else
                 {
@@ -282,7 +282,7 @@ public class JacksonValueDeserializer
         {
             return null;
         }
-        T value = valueDeserializer.map( valueNode );
+        T value = valueDeserializer.apply( valueNode );
         return value;
     }
 
@@ -303,7 +303,7 @@ public class JacksonValueDeserializer
         ArrayNode array = (ArrayNode) inputNode;
         for( JsonNode item : array )
         {
-            T value = deserializer.map( item );
+            T value = deserializer.apply( item );
             collection.add( value );
         }
     }
@@ -332,8 +332,8 @@ public class JacksonValueDeserializer
             }
             JsonNode keyNode = item.get( "key" );
             JsonNode valueNode = item.get( "value" );
-            K key = keyDeserializer.map( keyNode );
-            V value = valueDeserializer.map( valueNode );
+            K key = keyDeserializer.apply( keyNode );
+            V value = valueDeserializer.apply( valueNode );
             if( key != null )
             {
                 map.put( key, value );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/extensions/valueserialization-jackson/src/main/java/org/qi4j/valueserialization/jackson/JacksonValueSerializationAssembler.java
----------------------------------------------------------------------
diff --git a/extensions/valueserialization-jackson/src/main/java/org/qi4j/valueserialization/jackson/JacksonValueSerializationAssembler.java b/extensions/valueserialization-jackson/src/main/java/org/qi4j/valueserialization/jackson/JacksonValueSerializationAssembler.java
index a0ee430..ff9b2d9 100644
--- a/extensions/valueserialization-jackson/src/main/java/org/qi4j/valueserialization/jackson/JacksonValueSerializationAssembler.java
+++ b/extensions/valueserialization-jackson/src/main/java/org/qi4j/valueserialization/jackson/JacksonValueSerializationAssembler.java
@@ -15,13 +15,13 @@
  */
 package org.qi4j.valueserialization.jackson;
 
+import java.util.function.Function;
 import org.qi4j.api.structure.Application;
 import org.qi4j.api.structure.Module;
 import org.qi4j.api.value.ValueSerialization;
 import org.qi4j.bootstrap.Assemblers;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.functional.Function;
 
 /**
  * Assemble a ValueSerialization Service producing and consuming JSON documents.

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/extensions/valueserialization-orgjson/src/main/java/org/qi4j/valueserialization/orgjson/OrgJsonValueSerializationAssembler.java
----------------------------------------------------------------------
diff --git a/extensions/valueserialization-orgjson/src/main/java/org/qi4j/valueserialization/orgjson/OrgJsonValueSerializationAssembler.java b/extensions/valueserialization-orgjson/src/main/java/org/qi4j/valueserialization/orgjson/OrgJsonValueSerializationAssembler.java
index 82ed416..e8f951e 100644
--- a/extensions/valueserialization-orgjson/src/main/java/org/qi4j/valueserialization/orgjson/OrgJsonValueSerializationAssembler.java
+++ b/extensions/valueserialization-orgjson/src/main/java/org/qi4j/valueserialization/orgjson/OrgJsonValueSerializationAssembler.java
@@ -15,13 +15,13 @@
  */
 package org.qi4j.valueserialization.orgjson;
 
+import java.util.function.Function;
 import org.qi4j.api.structure.Application;
 import org.qi4j.api.structure.Module;
 import org.qi4j.api.value.ValueSerialization;
 import org.qi4j.bootstrap.Assemblers;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.functional.Function;
 
 /**
  * Assemble a ValueSerialization Service producing and consuming JSON documents.

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/extensions/valueserialization-stax/src/main/java/org/qi4j/valueserialization/stax/StaxValueDeserializer.java
----------------------------------------------------------------------
diff --git a/extensions/valueserialization-stax/src/main/java/org/qi4j/valueserialization/stax/StaxValueDeserializer.java b/extensions/valueserialization-stax/src/main/java/org/qi4j/valueserialization/stax/StaxValueDeserializer.java
index 9bdc34a..cecb206 100644
--- a/extensions/valueserialization-stax/src/main/java/org/qi4j/valueserialization/stax/StaxValueDeserializer.java
+++ b/extensions/valueserialization-stax/src/main/java/org/qi4j/valueserialization/stax/StaxValueDeserializer.java
@@ -7,6 +7,7 @@ import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.util.Collection;
 import java.util.Map;
+import java.util.function.Function;
 import javax.xml.stream.XMLEventReader;
 import javax.xml.stream.XMLInputFactory;
 import javax.xml.stream.XMLStreamException;
@@ -23,7 +24,6 @@ import org.qi4j.api.structure.Application;
 import org.qi4j.api.structure.Module;
 import org.qi4j.api.value.ValueDeserializer;
 import org.qi4j.api.value.ValueSerializationException;
-import org.qi4j.functional.Function;
 import org.qi4j.spi.value.ValueDeserializerAdapter;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -122,7 +122,7 @@ public class StaxValueDeserializer
             {
                 throw new ValueSerializationException( "Expected a <value/> but got: " + currentTag );
             }
-            T item = deserializer.map( input );
+            T item = deserializer.apply( input );
             collection.add( item );
         }
         return collection;
@@ -168,10 +168,10 @@ public class StaxValueDeserializer
                 switch( keyOrValue )
                 {
                     case "key":
-                        key = keyDeserializer.map( input );
+                        key = keyDeserializer.apply( input );
                         break;
                     case "value":
-                        value = valueDeserializer.map( input );
+                        value = valueDeserializer.apply( input );
                         break;
                     default:
                         readObjectTree( input );
@@ -350,7 +350,7 @@ public class StaxValueDeserializer
         {
             return null;
         }
-        T value = valueDeserializer.map( valueNode );
+        T value = valueDeserializer.apply( valueNode );
         return value;
     }
 
@@ -372,7 +372,7 @@ public class StaxValueDeserializer
         for( int arrayValuesIndex = 0; arrayValuesIndex < arrayValues.getLength(); arrayValuesIndex++ )
         {
             Node arrayValue = arrayValues.item( arrayValuesIndex );
-            T value = deserializer.map( arrayValue.getFirstChild() );
+            T value = deserializer.apply( arrayValue.getFirstChild() );
             collection.add( value );
         }
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/extensions/valueserialization-stax/src/main/java/org/qi4j/valueserialization/stax/StaxValueSerializationAssembler.java
----------------------------------------------------------------------
diff --git a/extensions/valueserialization-stax/src/main/java/org/qi4j/valueserialization/stax/StaxValueSerializationAssembler.java b/extensions/valueserialization-stax/src/main/java/org/qi4j/valueserialization/stax/StaxValueSerializationAssembler.java
index 84c8f21..d99616c 100644
--- a/extensions/valueserialization-stax/src/main/java/org/qi4j/valueserialization/stax/StaxValueSerializationAssembler.java
+++ b/extensions/valueserialization-stax/src/main/java/org/qi4j/valueserialization/stax/StaxValueSerializationAssembler.java
@@ -15,13 +15,13 @@
  */
 package org.qi4j.valueserialization.stax;
 
+import java.util.function.Function;
 import org.qi4j.api.structure.Application;
 import org.qi4j.api.structure.Module;
 import org.qi4j.api.value.ValueSerialization;
 import org.qi4j.bootstrap.Assemblers;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.functional.Function;
 
 /**
  * Assemble a ValueSerialization Service producing and consuming XML documents.

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/circuitbreaker/src/main/java/org/qi4j/library/circuitbreaker/CircuitBreaker.java
----------------------------------------------------------------------
diff --git a/libraries/circuitbreaker/src/main/java/org/qi4j/library/circuitbreaker/CircuitBreaker.java b/libraries/circuitbreaker/src/main/java/org/qi4j/library/circuitbreaker/CircuitBreaker.java
index eacf53f..2e53b46 100644
--- a/libraries/circuitbreaker/src/main/java/org/qi4j/library/circuitbreaker/CircuitBreaker.java
+++ b/libraries/circuitbreaker/src/main/java/org/qi4j/library/circuitbreaker/CircuitBreaker.java
@@ -22,7 +22,7 @@ import java.beans.PropertyVetoException;
 import java.beans.VetoableChangeListener;
 import java.beans.VetoableChangeSupport;
 import java.util.Date;
-import org.qi4j.functional.Specification;
+import java.util.function.Predicate;
 import org.qi4j.functional.Specifications;
 
 import static org.qi4j.functional.Specifications.not;
@@ -40,7 +40,7 @@ public class CircuitBreaker
 
     private int threshold;
     private long timeout;
-    private Specification<Throwable> allowedThrowables;
+    private Predicate<Throwable> allowedThrowables;
 
     private int countDown;
     private long trippedOn = -1;
@@ -53,7 +53,7 @@ public class CircuitBreaker
     PropertyChangeSupport pcs = new PropertyChangeSupport( this );
     VetoableChangeSupport vcs = new VetoableChangeSupport( this );
 
-    public CircuitBreaker( int threshold, long timeout, Specification<Throwable> allowedThrowables )
+    public CircuitBreaker( int threshold, long timeout, Predicate<Throwable> allowedThrowables )
     {
         this.threshold = threshold;
         this.countDown = threshold;
@@ -186,7 +186,7 @@ public class CircuitBreaker
     {
         if( status == Status.on )
         {
-            if( allowedThrowables.satisfiedBy( throwable ) )
+            if( allowedThrowables.test( throwable ) )
             {
                 // Allowed throwable, so counts as success
                 success();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/libraries/circuitbreaker/src/main/java/org/qi4j/library/circuitbreaker/CircuitBreakers.java
----------------------------------------------------------------------
diff --git a/libraries/circuitbreaker/src/main/java/org/qi4j/library/circuitbreaker/CircuitBreakers.java b/libraries/circuitbreaker/src/main/java/org/qi4j/library/circuitbreaker/CircuitBreakers.java
index 3919907..6dbe7c4 100644
--- a/libraries/circuitbreaker/src/main/java/org/qi4j/library/circuitbreaker/CircuitBreakers.java
+++ b/libraries/circuitbreaker/src/main/java/org/qi4j/library/circuitbreaker/CircuitBreakers.java
@@ -15,7 +15,7 @@
  */
 package org.qi4j.library.circuitbreaker;
 
-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;
@@ -73,12 +73,12 @@ public class CircuitBreakers
     * @param throwables The Throwable types that are allowed.
     * @return A Specification that specifies the allowed Throwables.
     */
-   public static Specification<Throwable> in( final Class<? extends Throwable>... throwables)
+   public static Predicate<Throwable> in( final Class<? extends Throwable>... throwables)
    {
-      return new Specification<Throwable>()
+      return new Predicate<Throwable>()
       {
          @Override
-         public boolean satisfiedBy( Throwable item )
+         public boolean test( Throwable item )
          {
             Class<? extends Throwable> throwableClass = item.getClass();
             for (Class<? extends Throwable> throwable : throwables)
@@ -91,14 +91,14 @@ public class CircuitBreakers
       };
    }
 
-   public static Specification<Throwable> rootCause( final Specification<Throwable> specification)
+   public static Predicate<Throwable> rootCause( final Predicate<Throwable> specification)
    {
-      return new Specification<Throwable>()
+      return new Predicate<Throwable>()
       {
          @Override
-         public boolean satisfiedBy( Throwable item )
+         public boolean test( Throwable item )
          {
-            return specification.satisfiedBy( unwrap(item) );
+            return specification.test( unwrap(item) );
          }
 
          private Throwable unwrap(Throwable item)


[08/50] [abbrv] zest-qi4j git commit: Jackson ValueSerialization now use Jackson 2.4

Posted by ni...@apache.org.
Jackson ValueSerialization now use Jackson 2.4


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/8693abd1
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/8693abd1
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/8693abd1

Branch: refs/heads/3.0
Commit: 8693abd124de19c580a1148071ea7aefe8becadc
Parents: 5dc87a2
Author: Paul Merlin <pa...@nosphere.org>
Authored: Thu Jun 12 14:52:12 2014 +0200
Committer: Paul Merlin <pa...@nosphere.org>
Committed: Thu Jun 12 14:52:12 2014 +0200

----------------------------------------------------------------------
 .../jackson/JacksonValueDeserializer.java           | 16 ++++++++--------
 .../jackson/JacksonValueSerializer.java             |  8 ++++----
 libraries.gradle                                    |  4 ++--
 3 files changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/8693abd1/extensions/valueserialization-jackson/src/main/java/org/qi4j/valueserialization/jackson/JacksonValueDeserializer.java
----------------------------------------------------------------------
diff --git a/extensions/valueserialization-jackson/src/main/java/org/qi4j/valueserialization/jackson/JacksonValueDeserializer.java b/extensions/valueserialization-jackson/src/main/java/org/qi4j/valueserialization/jackson/JacksonValueDeserializer.java
index 4c913bd..5c6774b 100644
--- a/extensions/valueserialization-jackson/src/main/java/org/qi4j/valueserialization/jackson/JacksonValueDeserializer.java
+++ b/extensions/valueserialization-jackson/src/main/java/org/qi4j/valueserialization/jackson/JacksonValueDeserializer.java
@@ -15,16 +15,16 @@
  */
 package org.qi4j.valueserialization.jackson;
 
+import com.fasterxml.jackson.core.JsonFactory;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.MappingJsonFactory;
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
 import java.io.InputStream;
 import java.util.Collection;
 import java.util.Map;
-import org.codehaus.jackson.JsonFactory;
-import org.codehaus.jackson.JsonNode;
-import org.codehaus.jackson.JsonParser;
-import org.codehaus.jackson.JsonToken;
-import org.codehaus.jackson.map.MappingJsonFactory;
-import org.codehaus.jackson.node.ArrayNode;
-import org.codehaus.jackson.node.ObjectNode;
 import org.qi4j.api.injection.scope.Service;
 import org.qi4j.api.injection.scope.Structure;
 import org.qi4j.api.service.ServiceReference;
@@ -56,7 +56,7 @@ public class JacksonValueDeserializer
     protected JsonParser adaptInput( InputStream input )
         throws Exception
     {
-        return jsonFactory.createJsonParser( input );
+        return jsonFactory.createParser( input );
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/8693abd1/extensions/valueserialization-jackson/src/main/java/org/qi4j/valueserialization/jackson/JacksonValueSerializer.java
----------------------------------------------------------------------
diff --git a/extensions/valueserialization-jackson/src/main/java/org/qi4j/valueserialization/jackson/JacksonValueSerializer.java b/extensions/valueserialization-jackson/src/main/java/org/qi4j/valueserialization/jackson/JacksonValueSerializer.java
index 7c3bd13..dc028a8 100644
--- a/extensions/valueserialization-jackson/src/main/java/org/qi4j/valueserialization/jackson/JacksonValueSerializer.java
+++ b/extensions/valueserialization-jackson/src/main/java/org/qi4j/valueserialization/jackson/JacksonValueSerializer.java
@@ -15,10 +15,10 @@
  */
 package org.qi4j.valueserialization.jackson;
 
+import com.fasterxml.jackson.core.JsonFactory;
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.databind.MappingJsonFactory;
 import java.io.OutputStream;
-import org.codehaus.jackson.JsonFactory;
-import org.codehaus.jackson.JsonGenerator;
-import org.codehaus.jackson.map.MappingJsonFactory;
 import org.qi4j.spi.value.ValueSerializerAdapter;
 
 /**
@@ -34,7 +34,7 @@ public class JacksonValueSerializer
     protected JsonGenerator adaptOutput( OutputStream output )
         throws Exception
     {
-        return jsonFactory.createJsonGenerator( output );
+        return jsonFactory.createGenerator( output );
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/8693abd1/libraries.gradle
----------------------------------------------------------------------
diff --git a/libraries.gradle b/libraries.gradle
index 993c407..d78ef13 100644
--- a/libraries.gradle
+++ b/libraries.gradle
@@ -16,11 +16,11 @@ def elasticsearchVersion = '1.2.1'
 def freemarkerVersion = '2.3.20'
 def gaeVersion = '1.8.8'
 def hazelcastVersion = '3.1.3'
-def jacksonVersion = '1.9.11'
 def groovyVersion = '2.3.2'
 def guavaVersion = '17.0'
 def h2Version = '1.4.178'
 def httpClientVersion = '4.2.2' // 4.3.4 exists
+def jacksonVersion = '2.4.0'
 def javascriptVersion = '1.7R4'
 def javasqlgeneratorVersion = '0.3.2'
 def jcloudsVersion = '1.7.0'
@@ -200,7 +200,7 @@ rootProject.ext {
           wicket_stateless: "com.jolira:wicket-stateless:$wicketStatelessVersion",
 
           // Library & Extension dependencies
-          jackson_mapper: "org.codehaus.jackson:jackson-mapper-asl:$jacksonVersion",
+          jackson_mapper: "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion",
           jodamoney: "org.joda:joda-money:$jodaMoneyVersion",
           jodatime: "joda-time:joda-time:$jodaTimeVersion",
           ehcache: "net.sf.ehcache:ehcache:$ehcacheVersion",


[30/50] [abbrv] zest-qi4j git commit: Replaced Joda Time with Java 8 Time API.

Posted by ni...@apache.org.
http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/bootstrap/test/TestApplication.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/bootstrap/test/TestApplication.java b/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/bootstrap/test/TestApplication.java
index 7adc9af..7e56141 100644
--- a/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/bootstrap/test/TestApplication.java
+++ b/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/bootstrap/test/TestApplication.java
@@ -17,22 +17,18 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.bootstrap.test;
 
-import java.text.SimpleDateFormat;
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Rule;
 import org.junit.rules.TestName;
-import org.qi4j.api.composite.TransientBuilderFactory;
 import org.qi4j.api.entity.EntityBuilder;
-import org.qi4j.api.query.QueryBuilderFactory;
 import org.qi4j.api.service.ServiceReference;
 import org.qi4j.api.structure.Application;
 import org.qi4j.api.structure.Module;
 import org.qi4j.api.unitofwork.UnitOfWork;
-import org.qi4j.api.unitofwork.UnitOfWorkFactory;
 import org.qi4j.api.usecase.Usecase;
 import org.qi4j.api.usecase.UsecaseBuilder;
 import org.qi4j.api.value.ValueBuilder;
@@ -60,13 +56,15 @@ import org.slf4j.LoggerFactory;
 
 import static org.hamcrest.CoreMatchers.equalTo;
 import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.*;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
 
 /**
  * Base class for testing Context Interactions
  */
 public class TestApplication
-      extends BaseData
+    extends BaseData
 {
     // Logger for sub classes
     protected Logger logger = LoggerFactory.getLogger( getClass() );
@@ -75,32 +73,32 @@ public class TestApplication
 
     protected static RouteSpecificationFactoryService routeSpecFactory;
 
-    final protected static Date TODAY = new Date();
-    final protected static Date DAY1 = day( 1 );
-    final protected static Date DAY2 = day( 2 );
-    final protected static Date DAY3 = day( 3 );
-    final protected static Date DAY4 = day( 4 );
-    final protected static Date DAY5 = day( 5 );
-    final protected static Date DAY6 = day( 6 );
-    final protected static Date DAY7 = day( 7 );
-    final protected static Date DAY8 = day( 8 );
-    final protected static Date DAY9 = day( 9 );
-    final protected static Date DAY10 = day( 10 );
-    final protected static Date DAY11 = day( 11 );
-    final protected static Date DAY12 = day( 12 );
-    final protected static Date DAY13 = day( 13 );
-    final protected static Date DAY14 = day( 14 );
-    final protected static Date DAY15 = day( 15 );
-    final protected static Date DAY16 = day( 16 );
-    final protected static Date DAY17 = day( 17 );
-    final protected static Date DAY18 = day( 18 );
-    final protected static Date DAY19 = day( 19 );
-    final protected static Date DAY20 = day( 20 );
-    final protected static Date DAY21 = day( 21 );
-    final protected static Date DAY22 = day( 22 );
-    final protected static Date DAY23 = day( 23 );
-    final protected static Date DAY24 = day( 24 );
-    final protected static Date DAY25 = day( 25 );
+    final protected static ZonedDateTime TODAY = ZonedDateTime.now();
+    final protected static ZonedDateTime DAY1 = TODAY.plusDays( 1 );
+    final protected static ZonedDateTime DAY2 = TODAY.plusDays( 2 );
+    final protected static ZonedDateTime DAY3 = TODAY.plusDays( 3 );
+    final protected static ZonedDateTime DAY4 = TODAY.plusDays( 4 );
+    final protected static ZonedDateTime DAY5 = TODAY.plusDays( 5 );
+    final protected static ZonedDateTime DAY6 = TODAY.plusDays( 6 );
+    final protected static ZonedDateTime DAY7 = TODAY.plusDays( 7 );
+    final protected static ZonedDateTime DAY8 = TODAY.plusDays( 8 );
+    final protected static ZonedDateTime DAY9 = TODAY.plusDays( 9 );
+    final protected static ZonedDateTime DAY10 = TODAY.plusDays( 10 );
+    final protected static ZonedDateTime DAY11 = TODAY.plusDays( 11 );
+    final protected static ZonedDateTime DAY12 = TODAY.plusDays( 12 );
+    final protected static ZonedDateTime DAY13 = TODAY.plusDays( 13 );
+    final protected static ZonedDateTime DAY14 = TODAY.plusDays( 14 );
+    final protected static ZonedDateTime DAY15 = TODAY.plusDays( 15 );
+    final protected static ZonedDateTime DAY16 = TODAY.plusDays( 16 );
+    final protected static ZonedDateTime DAY17 = TODAY.plusDays( 17 );
+    final protected static ZonedDateTime DAY18 = TODAY.plusDays( 18 );
+    final protected static ZonedDateTime DAY19 = TODAY.plusDays( 19 );
+    final protected static ZonedDateTime DAY20 = TODAY.plusDays( 20 );
+    final protected static ZonedDateTime DAY21 = TODAY.plusDays( 21 );
+    final protected static ZonedDateTime DAY22 = TODAY.plusDays( 22 );
+    final protected static ZonedDateTime DAY23 = TODAY.plusDays( 23 );
+    final protected static ZonedDateTime DAY24 = TODAY.plusDays( 24 );
+    final protected static ZonedDateTime DAY25 = TODAY.plusDays( 25 );
 
     protected static Voyage V201;
     protected static Voyage V202;
@@ -113,8 +111,8 @@ public class TestApplication
     final protected static boolean arrived = true;
     final protected static boolean directed = false;
     final protected static boolean misdirected = true;
-    final protected static Date unknownETA = null;
-    final protected static Date noSpecificDate = null;
+    final protected static ZonedDateTime unknownETA = null;
+    final protected static ZonedDateTime noSpecificDate = null;
     final protected static Integer leg1 = 0;
     final protected static Integer leg2 = 1;
     final protected static Integer leg3 = 2;
@@ -123,8 +121,8 @@ public class TestApplication
     final protected static Integer unknownLeg = 0;
     final protected static NextHandlingEvent unknownNextHandlingEvent = null;
 
-    protected Date deadline;
-    protected Date arrival;
+    protected ZonedDateTime deadline;
+    protected ZonedDateTime arrival;
     protected RouteSpecification routeSpec;
     protected RouteSpecification newRouteSpec;
     protected Delivery delivery;
@@ -155,13 +153,13 @@ public class TestApplication
     }
 
     @BeforeClass
-    public static void setup() throws Exception
+    public static void setup()
+        throws Exception
     {
         System.out.println( "\n@@@@@@@@@@@  TEST SUITE  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" );
         app = new Energy4Java().newApplication( new TestAssembler() );
         app.activate();
         Context.prepareContextBaseClass( findHostingModule() );
-
     }
 
     // Allow to test message output from exceptions after they have been thrown
@@ -178,7 +176,7 @@ public class TestApplication
     {
         logger.info( name.getMethodName() );
         Usecase usecase = UsecaseBuilder.newUsecase( "Usecase:" + name );
-        UnitOfWork uow = module.newUnitOfWork(usecase);
+        UnitOfWork uow = module.newUnitOfWork( usecase );
         populateTestData();
 
         ServiceReference<RouteSpecificationFactoryService> routeSpecFactoryServiceRef =
@@ -193,7 +191,7 @@ public class TestApplication
     public void concludeTests()
     {
         UnitOfWork uow = module.currentUnitOfWork();
-        if (uow != null)
+        if( uow != null )
         {
             uow.discard();
         }
@@ -209,7 +207,9 @@ public class TestApplication
                 }
                 else
                 {
-                    throw new InternalError( "I have seen a case where a UoW is on the stack, but not opened. First is: " + uow.usecase().name() );
+                    throw new InternalError( "I have seen a case where a UoW is on the stack, but not opened. First is: " + uow
+                        .usecase()
+                        .name() );
                 }
             }
             new Exception( "UnitOfWork not properly cleaned up" ).printStackTrace();
@@ -217,7 +217,8 @@ public class TestApplication
     }
 
     @AfterClass
-    public static void terminateApplication() throws Exception
+    public static void terminateApplication()
+        throws Exception
     {
         if( app != null )
         {
@@ -231,8 +232,8 @@ public class TestApplication
         assertTrue( message, e.getMessage().contains( msg ) );
     }
 
-
-    private void populateTestData() throws Exception
+    private void populateTestData()
+        throws Exception
     {
         // UnLocode value objects
         AUMEL = unlocode( "AUMEL" ); // Melbourne
@@ -270,54 +271,54 @@ public class TestApplication
 
         // Voyage entity objects for testing
         V201 = voyage( "V201", schedule(
-              carrierMovement( HONGKONG, CHICAGO, DAY1, DAY5 ),
-              carrierMovement( CHICAGO, NEWYORK, DAY5, DAY6 ),
-              carrierMovement( NEWYORK, GOTHENBURG, DAY6, DAY12 )
+            carrierMovement( HONGKONG, CHICAGO, DAY1, DAY5 ),
+            carrierMovement( CHICAGO, NEWYORK, DAY5, DAY6 ),
+            carrierMovement( NEWYORK, GOTHENBURG, DAY6, DAY12 )
         ) );
         V202 = voyage( "V202", schedule(
-              carrierMovement( CHICAGO, NEWYORK, DAY3, DAY5 ),
-              carrierMovement( NEWYORK, DALLAS, DAY7, DAY8 ),
-              carrierMovement( DALLAS, ROTTERDAM, DAY10, DAY17 ),
-              carrierMovement( ROTTERDAM, HAMBURG, DAY17, DAY19 ),
-              carrierMovement( HAMBURG, GOTHENBURG, DAY20, DAY24 )
+            carrierMovement( CHICAGO, NEWYORK, DAY3, DAY5 ),
+            carrierMovement( NEWYORK, DALLAS, DAY7, DAY8 ),
+            carrierMovement( DALLAS, ROTTERDAM, DAY10, DAY17 ),
+            carrierMovement( ROTTERDAM, HAMBURG, DAY17, DAY19 ),
+            carrierMovement( HAMBURG, GOTHENBURG, DAY20, DAY24 )
         ) );
         V203 = voyage( "V203", schedule(
-              carrierMovement( NEWYORK, HAMBURG, DAY3, DAY12 ),
-              carrierMovement( HAMBURG, ROTTERDAM, DAY13, DAY18 ),
-              carrierMovement( ROTTERDAM, STOCKHOLM, DAY20, DAY23 ),
-              carrierMovement( STOCKHOLM, HELSINKI, DAY24, DAY25 )
+            carrierMovement( NEWYORK, HAMBURG, DAY3, DAY12 ),
+            carrierMovement( HAMBURG, ROTTERDAM, DAY13, DAY18 ),
+            carrierMovement( ROTTERDAM, STOCKHOLM, DAY20, DAY23 ),
+            carrierMovement( STOCKHOLM, HELSINKI, DAY24, DAY25 )
         ) );
         V204 = voyage( "V204", schedule(
-              carrierMovement( TOKYO, HANGZHOU, DAY3, DAY6 ),
-              carrierMovement( HANGZHOU, HONGKONG, DAY7, DAY8 ),
-              carrierMovement( HONGKONG, NEWYORK, DAY9, DAY12 ),
-              carrierMovement( NEWYORK, MELBOURNE, DAY13, DAY19 )
+            carrierMovement( TOKYO, HANGZHOU, DAY3, DAY6 ),
+            carrierMovement( HANGZHOU, HONGKONG, DAY7, DAY8 ),
+            carrierMovement( HONGKONG, NEWYORK, DAY9, DAY12 ),
+            carrierMovement( NEWYORK, MELBOURNE, DAY13, DAY19 )
         ) );
         V205 = voyage( "V205", schedule(
-              carrierMovement( HANGZHOU, MOGADISHU, DAY1, DAY2 ),
-              carrierMovement( MOGADISHU, ROTTERDAM, DAY2, DAY4 ),
-              carrierMovement( ROTTERDAM, NEWYORK, DAY4, DAY7 ),
-              carrierMovement( NEWYORK, DALLAS, DAY9, DAY10 )
+            carrierMovement( HANGZHOU, MOGADISHU, DAY1, DAY2 ),
+            carrierMovement( MOGADISHU, ROTTERDAM, DAY2, DAY4 ),
+            carrierMovement( ROTTERDAM, NEWYORK, DAY4, DAY7 ),
+            carrierMovement( NEWYORK, DALLAS, DAY9, DAY10 )
         ) );
 
         itinerary = itinerary(
-              leg( V201, HONGKONG, CHICAGO, DAY1, DAY5 ),
-              leg( V201, CHICAGO, NEWYORK, DAY5, DAY6 ),
-              leg( V202, NEWYORK, DALLAS, DAY7, DAY8 ),
-              leg( V202, DALLAS, ROTTERDAM, DAY10, DAY17 ),
-              leg( V203, ROTTERDAM, STOCKHOLM, DAY20, DAY23 )
+            leg( V201, HONGKONG, CHICAGO, DAY1, DAY5 ),
+            leg( V201, CHICAGO, NEWYORK, DAY5, DAY6 ),
+            leg( V202, NEWYORK, DALLAS, DAY7, DAY8 ),
+            leg( V202, DALLAS, ROTTERDAM, DAY10, DAY17 ),
+            leg( V203, ROTTERDAM, STOCKHOLM, DAY20, DAY23 )
         );
 
         wrongItinerary = itinerary(
-              leg( V201, HONGKONG, CHICAGO, DAY1, DAY5 ),
-              leg( V201, CHICAGO, NEWYORK, DAY5, DAY6 ),
-              leg( V204, NEWYORK, MELBOURNE, DAY13, DAY19 )
+            leg( V201, HONGKONG, CHICAGO, DAY1, DAY5 ),
+            leg( V201, CHICAGO, NEWYORK, DAY5, DAY6 ),
+            leg( V204, NEWYORK, MELBOURNE, DAY13, DAY19 )
         );
     }
 
     public void assertDelivery( HandlingEventType handlingEventType,
                                 Location location,
-                                Date completion,
+                                ZonedDateTime completion,
                                 Voyage voyage,
 
                                 TransportStatus transportStatus,
@@ -325,23 +326,27 @@ public class TestApplication
 
                                 RoutingStatus routingStatus,
                                 Boolean isMisdirected,
-                                Date eta,
+                                ZonedDateTime eta,
                                 Integer itineraryProgress,
 
                                 HandlingEventType nextHandlingEventType,
                                 Location nextLocation,
-                                Date nextTime,
+                                ZonedDateTime nextTime,
                                 Voyage nextVoyage
-    ) throws Exception
+    )
+        throws Exception
     {
         delivery = cargo.delivery().get();
 
         // Last handling event
-        if (delivery.lastHandlingEvent().get() != null
-              || handlingEventType != null || location != null || completion != null || voyage != null)
+        if( delivery.lastHandlingEvent().get() != null
+            || handlingEventType != null || location != null || completion != null || voyage != null )
         {
             assertThat( "lastHandlingEvent - handlingEventType",
-                        delivery.lastHandlingEvent().get().handlingEventType().get(), is( equalTo( handlingEventType ) ) );
+                        delivery.lastHandlingEvent()
+                            .get()
+                            .handlingEventType()
+                            .get(), is( equalTo( handlingEventType ) ) );
             assertThat( "lastHandlingEvent - location",
                         delivery.lastHandlingEvent().get().location().get(), is( equalTo( location ) ) );
             assertThat( "lastHandlingEvent - completionTime",
@@ -356,7 +361,6 @@ public class TestApplication
         assertThat( "isUnloadedAtDestination",
                     delivery.isUnloadedAtDestination().get(), is( equalTo( isUnloadedAtDestination ) ) );
 
-
         // Routing and direction
         assertThat( "routingStatus",
                     delivery.routingStatus().get(), is( equalTo( routingStatus ) ) );
@@ -367,42 +371,45 @@ public class TestApplication
         assertThat( "itineraryProgressIndex",
                     delivery.itineraryProgressIndex().get(), is( equalTo( itineraryProgress ) ) );
 
-
         // Next handling event
-        if (nextHandlingEventType == null)
+        if( nextHandlingEventType == null )
         {
             assertThat( "nextHandlingEvent - handlingEventType",
-                        delivery.nextHandlingEvent().get(), is( equalTo( null ) ) );
+                        delivery.nextHandlingEvent().get(), nullValue() );
         }
         else
         {
             assertThat( "nextHandlingEvent - handlingEventType",
-                        delivery.nextHandlingEvent().get().handlingEventType().get(), is( equalTo( nextHandlingEventType ) ) );
+                        delivery.nextHandlingEvent()
+                            .get()
+                            .handlingEventType()
+                            .get(), is( equalTo( nextHandlingEventType ) ) );
             assertThat( "nextHandlingEvent - location",
                         delivery.nextHandlingEvent().get().location().get(), is( equalTo( nextLocation ) ) );
 
-
-            if (delivery.nextHandlingEvent().get().time().get() != null)
+            if( delivery.nextHandlingEvent().get().time().get() != null )
             {
                 // Estimating a new carrier arrival time might be calculated a second
                 // after initial dates are set, so we skip the seconds
-                SimpleDateFormat parser = new SimpleDateFormat( "yyyy-MM-dd HH:mm" );
-                String calculatedTime = parser.format( delivery.nextHandlingEvent().get().time().get() );
-                String expectedTime = parser.format( nextTime );
-                assertThat( "nextHandlingEvent - time", calculatedTime, is( equalTo( expectedTime ) ) );
+                ZonedDateTime calculatedTime = delivery.nextHandlingEvent().get().time().get();
+                assertThat( "nextHandlingEvent - time", calculatedTime, equalTo( nextTime ) );
             }
             else
-                assertThat( "nextHandlingEvent - time", delivery.nextHandlingEvent().get().time().get(), is( equalTo( nextTime ) ) );
+            {
+                assertThat( "nextHandlingEvent - time", delivery.nextHandlingEvent()
+                    .get()
+                    .time()
+                    .get(), is( equalTo( nextTime ) ) );
+            }
 
             assertThat( "nextHandlingEvent - voyage",
                         delivery.nextHandlingEvent().get().voyage().get(), is( equalTo( nextVoyage ) ) );
         }
     }
 
-
     public void assertDelivery( HandlingEventType handlingEventType,
                                 Location location,
-                                Date completion,
+                                ZonedDateTime completion,
                                 Voyage voyage,
 
                                 TransportStatus transportStatus,
@@ -410,18 +417,19 @@ public class TestApplication
 
                                 RoutingStatus routingStatus,
                                 Boolean isMisdirected,
-                                Date eta,
+                                ZonedDateTime eta,
                                 Integer itineraryProgress,
 
                                 NextHandlingEvent noNextHandlingEvent
-    ) throws Exception
+    )
+        throws Exception
     {
         assertDelivery( handlingEventType, location, completion, voyage,
                         transportStatus, isUnloadedAtDestination, routingStatus, isMisdirected, eta,
                         itineraryProgress, null, null, null, null );
     }
 
-    public void assertRouteSpec( Location origin, Location destination, Date earliestDeparture, Date deadline )
+    public void assertRouteSpec( Location origin, Location destination, ZonedDateTime earliestDeparture, ZonedDateTime deadline )
     {
         newRouteSpec = cargo.routeSpecification().get();
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/booking/BookNewCargoTest.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/booking/BookNewCargoTest.java b/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/booking/BookNewCargoTest.java
index 368ecf0..010801a 100644
--- a/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/booking/BookNewCargoTest.java
+++ b/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/booking/BookNewCargoTest.java
@@ -76,7 +76,7 @@ public class BookNewCargoTest extends TestApplication
     {
         deviation_2a_OriginAndDestinationSame();
         thrown.expect( CannotCreateRouteSpecificationException.class, "Arrival deadline is in the past or Today." );
-        new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, day( -1 ) ).getTrackingId();
+        new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, TODAY.minusDays( 1 ) ).getTrackingId();
     }
 
     @Test
@@ -85,7 +85,7 @@ public class BookNewCargoTest extends TestApplication
     {
         deviation_2b_DeadlineInThePastNotAccepted();
         thrown.expect( CannotCreateRouteSpecificationException.class, "Arrival deadline is in the past or Today." );
-        new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, day( 0 ) ).getTrackingId();
+        new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, TODAY ).getTrackingId();
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/booking/routing/AssignCargoToRouteTest.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/booking/routing/AssignCargoToRouteTest.java b/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/booking/routing/AssignCargoToRouteTest.java
index fc5b3f0..cbaac61 100644
--- a/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/booking/routing/AssignCargoToRouteTest.java
+++ b/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/booking/routing/AssignCargoToRouteTest.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.test.booking.routing;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.junit.Before;
 import org.junit.Test;
 import org.qi4j.api.unitofwork.UnitOfWork;
@@ -60,8 +60,8 @@ public class AssignCargoToRouteTest extends TestApplication
         CargoAggregateRoot CARGOS = uow.get( CargoAggregateRoot.class, CargoAggregateRoot.CARGOS_ID );
 
         // Create new cargo
-        routeSpec = routeSpecFactory.build( HONGKONG, STOCKHOLM, new Date(), deadline = DAY24 );
-        delivery = delivery( TODAY, NOT_RECEIVED, NOT_ROUTED, unknownLeg );
+        routeSpec = routeSpecFactory.build( HONGKONG, STOCKHOLM, ZonedDateTime.now(), deadline = DAY24 );
+        delivery = delivery( TODAY.toInstant(), NOT_RECEIVED, NOT_ROUTED, unknownLeg );
         cargo = CARGOS.createCargo( routeSpec, delivery, "ABC" );
         trackingId = cargo.trackingId().get();
         delivery = cargo.delivery().get();
@@ -71,7 +71,7 @@ public class AssignCargoToRouteTest extends TestApplication
     public void precondition_x1_CannotReRouteClaimedCargo()
         throws Exception
     {
-        cargo.delivery().set( delivery( TODAY, CLAIMED, ROUTED, unknownLeg ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), CLAIMED, ROUTED, unknownLeg ) );
         thrown.expect( RoutingException.class, "Can't re-route claimed cargo" );
         new AssignCargoToRoute( cargo, itinerary ).assign();
     }
@@ -82,7 +82,7 @@ public class AssignCargoToRouteTest extends TestApplication
     {
         precondition_x1_CannotReRouteClaimedCargo();
 
-        cargo.delivery().set( delivery( TODAY, NOT_RECEIVED, NOT_ROUTED, unknownLeg ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), NOT_RECEIVED, NOT_ROUTED, unknownLeg ) );
         thrown.expect( UnsatisfyingRouteException.class, "Route specification was not satisfied with itinerary" );
         new AssignCargoToRoute( cargo, wrongItinerary ).assign();
     }
@@ -93,7 +93,7 @@ public class AssignCargoToRouteTest extends TestApplication
     {
         deviation_1a_UnsatisfyingItinerary();
 
-        cargo.delivery().set( delivery( TODAY, NOT_RECEIVED, NOT_ROUTED, unknownLeg ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), NOT_RECEIVED, NOT_ROUTED, unknownLeg ) );
         new AssignCargoToRoute( cargo, itinerary ).assign();
         assertDelivery( null, null, null, null,
                         NOT_RECEIVED, notArrived,

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/booking/routing/RegisterNewDestinationTest.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/booking/routing/RegisterNewDestinationTest.java b/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/booking/routing/RegisterNewDestinationTest.java
index 38c548f..422c6fb 100644
--- a/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/booking/routing/RegisterNewDestinationTest.java
+++ b/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/booking/routing/RegisterNewDestinationTest.java
@@ -60,7 +60,7 @@ public class RegisterNewDestinationTest extends TestApplication
 
         // Create new cargo
         routeSpec = routeSpecFactory.build( HONGKONG, STOCKHOLM, TODAY, deadline = DAY24 );
-        delivery = delivery( TODAY, NOT_RECEIVED, NOT_ROUTED, leg1 );
+        delivery = delivery( TODAY.toInstant(), NOT_RECEIVED, NOT_ROUTED, leg1 );
         cargo = CARGOS.createCargo( routeSpec, delivery, "ABC" );
         trackingId = cargo.trackingId().get();
         delivery = cargo.delivery().get();
@@ -70,7 +70,7 @@ public class RegisterNewDestinationTest extends TestApplication
     public void precondition_x1_CannotChangeDestinationOfClaimedCargo()
         throws Exception
     {
-        cargo.delivery().set( delivery( DAY1, CLAIMED, ROUTED, leg1 ) );
+        cargo.delivery().set( delivery( DAY1.toInstant(), CLAIMED, ROUTED, leg1 ) );
         thrown.expect( ChangeDestinationException.class, "Can't change destination of claimed cargo" );
         new RegisterNewDestination( cargo ).to( "USCHI" );
     }
@@ -81,7 +81,7 @@ public class RegisterNewDestinationTest extends TestApplication
     {
         precondition_x1_CannotChangeDestinationOfClaimedCargo();
 
-        cargo.delivery().set( delivery( DAY1, IN_PORT, ROUTED, leg1 ) );
+        cargo.delivery().set( delivery( DAY1.toInstant(), IN_PORT, ROUTED, leg1 ) );
         thrown.expect( ChangeDestinationException.class, "Didn't recognize location 'XXXXX'" );
         new RegisterNewDestination( cargo ).to( "XXXXX" );
     }
@@ -92,7 +92,7 @@ public class RegisterNewDestinationTest extends TestApplication
     {
         deviation_1a_UnrecognizedLocation();
 
-        cargo.delivery().set( delivery( DAY1, IN_PORT, ROUTED, leg1 ) );
+        cargo.delivery().set( delivery( DAY1.toInstant(), IN_PORT, ROUTED, leg1 ) );
         thrown.expect( ChangeDestinationException.class, "New destination is same as old destination." );
         new RegisterNewDestination( cargo ).to( "SESTO" );
     }
@@ -104,7 +104,7 @@ public class RegisterNewDestinationTest extends TestApplication
         deviation_1b_NewDestinationSameAsOldDestination();
 
         cargo.routeSpecification().set( routeSpec );
-        cargo.delivery().set( delivery( DAY1, NOT_RECEIVED, NOT_ROUTED, leg1 ) );
+        cargo.delivery().set( delivery( DAY1.toInstant(), NOT_RECEIVED, NOT_ROUTED, leg1 ) );
 
         assertRouteSpec( HONGKONG, STOCKHOLM, TODAY, DAY24 );
         assertDelivery( null, null, null, null,

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/booking/specification/DeriveUpdatedRouteSpecTest.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/booking/specification/DeriveUpdatedRouteSpecTest.java b/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/booking/specification/DeriveUpdatedRouteSpecTest.java
index 7b859f0..ca1e284 100644
--- a/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/booking/specification/DeriveUpdatedRouteSpecTest.java
+++ b/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/booking/specification/DeriveUpdatedRouteSpecTest.java
@@ -48,7 +48,7 @@ public class DeriveUpdatedRouteSpecTest extends TestApplication
 
         // Create new cargo
         routeSpec = routeSpecFactory.build( HONGKONG, STOCKHOLM, TODAY, deadline = DAY24 );
-        delivery = delivery( TODAY, NOT_RECEIVED, ROUTED, unknownLeg );
+        delivery = delivery( TODAY.toInstant(), NOT_RECEIVED, ROUTED, unknownLeg );
         cargo = CARGOS.createCargo( routeSpec, delivery, "ABC" );
         cargo.itinerary().set( itinerary );
         trackingId = cargo.trackingId().get();
@@ -101,7 +101,7 @@ public class DeriveUpdatedRouteSpecTest extends TestApplication
         throws Exception
     {
         cargo.routeSpecification().set( routeSpec );
-        cargo.delivery().set( delivery( TODAY, NOT_RECEIVED, ROUTED, unknownLeg ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), NOT_RECEIVED, ROUTED, unknownLeg ) );
 
         assertRouteSpec( HONGKONG, STOCKHOLM, TODAY, DAY24 );
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectArrivedCargoTest.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectArrivedCargoTest.java b/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectArrivedCargoTest.java
index df136e2..7d3ae43 100644
--- a/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectArrivedCargoTest.java
+++ b/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectArrivedCargoTest.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.test.handling.inspection.event;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.junit.Before;
 import org.junit.Test;
 import org.qi4j.api.unitofwork.UnitOfWork;
@@ -53,8 +53,8 @@ public class InspectArrivedCargoTest extends TestApplication
         CargoAggregateRoot CARGOS = uow.get( CargoAggregateRoot.class, CargoAggregateRoot.CARGOS_ID );
 
         // Create new cargo
-        routeSpec = routeSpecFactory.build( HONGKONG, STOCKHOLM, new Date(), deadline = DAY24 );
-        delivery = delivery( TODAY, IN_PORT, ROUTED, leg5 );
+        routeSpec = routeSpecFactory.build( HONGKONG, STOCKHOLM, ZonedDateTime.now(), deadline = DAY24 );
+        delivery = delivery( TODAY.toInstant(), IN_PORT, ROUTED, leg5 );
         cargo = CARGOS.createCargo( routeSpec, delivery, "Arrived_CARGO" );
         trackingId = cargo.trackingId().get();
     }
@@ -65,7 +65,7 @@ public class InspectArrivedCargoTest extends TestApplication
     {
         // Cargo not routed
         cargo.itinerary().set( null );
-        cargo.delivery().set( delivery( TODAY, ONBOARD_CARRIER, NOT_ROUTED, leg5 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), ONBOARD_CARRIER, NOT_ROUTED, leg5 ) );
 
         // Unload in final destination (with no itinerary!)
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY23, DAY23, trackingId, UNLOAD, STOCKHOLM, V203 );
@@ -92,7 +92,7 @@ public class InspectArrivedCargoTest extends TestApplication
     {
         // Misroute cargo - assign unsatisfying itinerary not going to Stockholm
         cargo.itinerary().set( wrongItinerary );
-        cargo.delivery().set( delivery( TODAY, ONBOARD_CARRIER, MISROUTED, leg5 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), ONBOARD_CARRIER, MISROUTED, leg5 ) );
 
         // Unload in final destination (with wrong itinerary)
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY23, DAY23, trackingId, UNLOAD, STOCKHOLM, V203 );
@@ -117,7 +117,7 @@ public class InspectArrivedCargoTest extends TestApplication
     {
         // Assign satisfying route going to Stockholm
         cargo.itinerary().set( itinerary );
-        cargo.delivery().set( delivery( TODAY, ONBOARD_CARRIER, ROUTED, leg5 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), ONBOARD_CARRIER, ROUTED, leg5 ) );
 
         // Unload in final destination (with satisfying itinerary)
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY23, DAY23, trackingId, UNLOAD, STOCKHOLM, V203 );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectCargoInCustomsTest.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectCargoInCustomsTest.java b/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectCargoInCustomsTest.java
index 6d58924..3bd52f6 100644
--- a/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectCargoInCustomsTest.java
+++ b/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectCargoInCustomsTest.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.test.handling.inspection.event;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.junit.Before;
 import org.junit.Test;
 import org.qi4j.api.unitofwork.UnitOfWork;
@@ -52,8 +52,8 @@ public class InspectCargoInCustomsTest extends TestApplication
         CargoAggregateRoot CARGOS = uow.get( CargoAggregateRoot.class, CargoAggregateRoot.CARGOS_ID );
 
         // Create new cargo
-        routeSpec = routeSpecFactory.build( HONGKONG, STOCKHOLM, new Date(), deadline = DAY24 );
-        delivery = delivery( TODAY, IN_PORT, ROUTED, leg1 );
+        routeSpec = routeSpecFactory.build( HONGKONG, STOCKHOLM, ZonedDateTime.now(), deadline = DAY24 );
+        delivery = delivery( TODAY.toInstant(), IN_PORT, ROUTED, leg1 );
         cargo = CARGOS.createCargo( routeSpec, delivery, "CARGO_in_customs" );
         trackingId = cargo.trackingId().get();
     }
@@ -86,7 +86,7 @@ public class InspectCargoInCustomsTest extends TestApplication
     {
         // Cargo not routed
         cargo.itinerary().set( null );
-        cargo.delivery().set( delivery( TODAY, IN_PORT, NOT_ROUTED, leg5 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), IN_PORT, NOT_ROUTED, leg5 ) );
 
         // Handle in customs (without itinerary!)
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, CUSTOMS, STOCKHOLM, noVoyage );
@@ -104,7 +104,7 @@ public class InspectCargoInCustomsTest extends TestApplication
     {
         // Misroute cargo - assign unsatisfying itinerary not going to Stockholm
         cargo.itinerary().set( wrongItinerary );
-        cargo.delivery().set( delivery( TODAY, IN_PORT, MISROUTED, leg3 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), IN_PORT, MISROUTED, leg3 ) );
 
         // Handle in customs (with wrong itinerary)
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY20, DAY20, trackingId, CUSTOMS, MELBOURNE, noVoyage );
@@ -122,7 +122,7 @@ public class InspectCargoInCustomsTest extends TestApplication
     {
         // Assign satisfying route going to Stockholm
         cargo.itinerary().set( itinerary );
-        cargo.delivery().set( delivery( TODAY, IN_PORT, MISROUTED, leg5 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), IN_PORT, MISROUTED, leg5 ) );
 
         // Handle in customs (without itinerary!)
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY24, DAY24, trackingId, CUSTOMS, STOCKHOLM, noVoyage );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectClaimedCargoTest.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectClaimedCargoTest.java b/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectClaimedCargoTest.java
index 95ae56f..0ea1e31 100644
--- a/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectClaimedCargoTest.java
+++ b/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectClaimedCargoTest.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.test.handling.inspection.event;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.junit.Before;
 import org.junit.Test;
 import org.qi4j.api.unitofwork.UnitOfWork;
@@ -50,8 +50,8 @@ public class InspectClaimedCargoTest extends TestApplication
         CargoAggregateRoot CARGOS = uow.get( CargoAggregateRoot.class, CargoAggregateRoot.CARGOS_ID );
 
         // Create new cargo
-        routeSpec = routeSpecFactory.build( HONGKONG, STOCKHOLM, new Date(), deadline = DAY24 );
-        delivery = delivery( TODAY, IN_PORT, ROUTED, leg1 );
+        routeSpec = routeSpecFactory.build( HONGKONG, STOCKHOLM, ZonedDateTime.now(), deadline = DAY24 );
+        delivery = delivery( TODAY.toInstant(), IN_PORT, ROUTED, leg1 );
         cargo = CARGOS.createCargo( routeSpec, delivery, "Claimed_CARGO" );
         trackingId = cargo.trackingId().get();
     }
@@ -62,7 +62,7 @@ public class InspectClaimedCargoTest extends TestApplication
     {
         // Cargo not routed
         cargo.itinerary().set( null );
-        cargo.delivery().set( delivery( TODAY, IN_PORT, NOT_ROUTED, leg5 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), IN_PORT, NOT_ROUTED, leg5 ) );
 
         // Claim in final destination (without itinerary!)
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, CLAIM, STOCKHOLM, noVoyage );
@@ -81,7 +81,7 @@ public class InspectClaimedCargoTest extends TestApplication
     {
         // Misroute cargo - assign unsatisfying itinerary not going to Stockholm
         cargo.itinerary().set( wrongItinerary );
-        cargo.delivery().set( delivery( TODAY, IN_PORT, MISROUTED, leg3 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), IN_PORT, MISROUTED, leg3 ) );
 
         // Claim in final destination (with wrong itinerary)
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY20, DAY20, trackingId, CLAIM, MELBOURNE, noVoyage );
@@ -99,7 +99,7 @@ public class InspectClaimedCargoTest extends TestApplication
     {
         // Assign satisfying route going to Stockholm
         cargo.itinerary().set( itinerary );
-        cargo.delivery().set( delivery( TODAY, IN_PORT, ROUTED, leg3 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), IN_PORT, ROUTED, leg3 ) );
 
         // Claim in midpoint before arrival at final destination
         // Should this really be considered misdirected?!
@@ -117,7 +117,7 @@ public class InspectClaimedCargoTest extends TestApplication
         throws Exception
     {
         cargo.itinerary().set( itinerary );
-        cargo.delivery().set( delivery( TODAY, IN_PORT, ROUTED, leg5 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), IN_PORT, ROUTED, leg5 ) );
 
         // Claim in final destination
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY24, DAY24, trackingId, CLAIM, STOCKHOLM, noVoyage );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectLoadedCargoTest.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectLoadedCargoTest.java b/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectLoadedCargoTest.java
index c436024..bb3e04c 100644
--- a/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectLoadedCargoTest.java
+++ b/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectLoadedCargoTest.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.test.handling.inspection.event;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.junit.Before;
 import org.junit.Test;
 import org.qi4j.api.unitofwork.UnitOfWork;
@@ -68,7 +68,7 @@ public class InspectLoadedCargoTest extends TestApplication
         HANDLING_EVENTS = uow.get( HandlingEventAggregateRoot.class, HandlingEventAggregateRoot.HANDLING_EVENTS_ID );
         // Create new cargo
         RouteSpecification routeSpec = routeSpecFactory.build( HONGKONG, STOCKHOLM, TODAY, deadline = DAY24 );
-        Delivery delivery = delivery( TODAY, IN_PORT, ROUTED, leg1 );
+        Delivery delivery = delivery( TODAY.toInstant(), IN_PORT, ROUTED, leg1 );
         cargo = CARGOS.createCargo( routeSpec, delivery, "Loaded_CARGO" );
         trackingId = cargo.trackingId().get();
 //        delivery = cargo.delivery().get();
@@ -79,7 +79,7 @@ public class InspectLoadedCargoTest extends TestApplication
         throws Exception
     {
         cargo.itinerary().set( itinerary );
-        cargo.delivery().set( delivery( TODAY, IN_PORT, ROUTED, leg1 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), IN_PORT, ROUTED, leg1 ) );
 
         // V202 doesn't expect a load in Hongkong - can't determine much more before we get a correct voyage schedule
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, LOAD, HONGKONG, V202 );
@@ -105,7 +105,7 @@ public class InspectLoadedCargoTest extends TestApplication
         deviation_2a_WrongCarrierSchedule();
 
         cargo.itinerary().set( itinerary );
-        cargo.delivery().set( delivery( TODAY, IN_PORT, ROUTED, leg1 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), IN_PORT, ROUTED, leg1 ) );
 
         //
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, LOAD, HONGKONG, V201 );
@@ -123,7 +123,7 @@ public class InspectLoadedCargoTest extends TestApplication
         deviation_2a_CarrierOnTime_ArrivalDate_Planned();
 
         cargo.itinerary().set( itinerary );
-        cargo.delivery().set( delivery( TODAY, IN_PORT, ROUTED, leg1 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), IN_PORT, ROUTED, leg1 ) );
 
         //
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY2, DAY2, trackingId, LOAD, HONGKONG, V201 );
@@ -142,7 +142,7 @@ public class InspectLoadedCargoTest extends TestApplication
 
         // Cargo not routed
         cargo.itinerary().set( null );
-        cargo.delivery().set( delivery( TODAY, IN_PORT, NOT_ROUTED, leg1 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), IN_PORT, NOT_ROUTED, leg1 ) );
 
         // Load cargo in Hong Kong (without an itinerary!)
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, LOAD, HONGKONG, V201 );
@@ -169,7 +169,7 @@ public class InspectLoadedCargoTest extends TestApplication
 
         // Misroute cargo - assign unsatisfying itinerary not going to Stockholm
         cargo.itinerary().set( wrongItinerary );
-        cargo.delivery().set( delivery( TODAY, IN_PORT, MISROUTED, leg1 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), IN_PORT, MISROUTED, leg1 ) );
 
         // Load cargo in Hong Kong (with wrong itinerary)
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, LOAD, HONGKONG, V201 );
@@ -196,7 +196,7 @@ public class InspectLoadedCargoTest extends TestApplication
         deviation_3b_Misrouted_LoadLocationOfWrongItinerary_Origin();
 
         cargo.itinerary().set( wrongItinerary );
-        cargo.delivery().set( delivery( TODAY, IN_PORT, MISROUTED, leg1 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), IN_PORT, MISROUTED, leg1 ) );
 
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, LOAD, NEWYORK, V201 );
         thrown.expect( CargoMisroutedException.class, "MISROUTED! Route specification is not satisfied with itinerary" );
@@ -210,7 +210,7 @@ public class InspectLoadedCargoTest extends TestApplication
         deviation_3b_Misrouted_LoadLocationOfWrongItinerary_Midpoint();
 
         cargo.itinerary().set( wrongItinerary );
-        cargo.delivery().set( delivery( TODAY, IN_PORT, MISROUTED, leg1 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), IN_PORT, MISROUTED, leg1 ) );
 
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, LOAD, ROTTERDAM, V205 );
         thrown.expect( CargoMisroutedException.class, "MISROUTED! Route specification is not satisfied with itinerary" );
@@ -225,7 +225,7 @@ public class InspectLoadedCargoTest extends TestApplication
 
         // Assign satisfying route going to Stockholm
         cargo.itinerary().set( itinerary );
-        cargo.delivery().set( delivery( TODAY, IN_PORT, ROUTED, leg1 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), IN_PORT, ROUTED, leg1 ) );
 
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, LOAD, HONGKONG, V201 );
         new InspectLoadedCargo( cargo, handlingEvent ).inspect();
@@ -270,7 +270,7 @@ public class InspectLoadedCargoTest extends TestApplication
 
         // Move the cargo ahead on the route. Third leg of itinerary expects load in Dallas.
         cargo.itinerary().set( itinerary );
-        cargo.delivery().set( delivery( TODAY, IN_PORT, ROUTED, leg3 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), IN_PORT, ROUTED, leg3 ) );
 
         // Unexpected load in previous load location of itinerary (onto expected voyage) - can't go back in time.
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY7, DAY5, trackingId, LOAD, ROTTERDAM, V202 );
@@ -296,7 +296,7 @@ public class InspectLoadedCargoTest extends TestApplication
         deviation_4a_Misdirected_UnexpectedLoadLocation();
 
         cargo.itinerary().set( itinerary );
-        cargo.delivery().set( delivery( TODAY, IN_PORT, ROUTED, leg3 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), IN_PORT, ROUTED, leg3 ) );
 
         // Unexpected load onto previous voyage (in expected location) - can't go back in time.
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY7, DAY7, trackingId, LOAD, NEWYORK, V201 );
@@ -322,7 +322,7 @@ public class InspectLoadedCargoTest extends TestApplication
         deviation_4b_Misdirected_UnexpectedLoadVoyage_PreviousInItinerary();
 
         cargo.itinerary().set( itinerary );
-        cargo.delivery().set( delivery( TODAY, IN_PORT, ROUTED, leg3 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), IN_PORT, ROUTED, leg3 ) );
 
         // Unexpected load onto future voyage (in expected location) - can't jump ahead in route plan.
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY7, DAY7, trackingId, LOAD, NEWYORK, V203 );
@@ -337,7 +337,7 @@ public class InspectLoadedCargoTest extends TestApplication
         deviation_4b_Misdirected_UnexpectedLoadVoyage_NextInItinerary();
 
         cargo.itinerary().set( itinerary );
-        cargo.delivery().set( delivery( TODAY, IN_PORT, ROUTED, leg3 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), IN_PORT, ROUTED, leg3 ) );
 
         // Unexpected load onto voyage not in itinerary
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY7, DAY7, trackingId, LOAD, NEWYORK, V204 );
@@ -352,7 +352,7 @@ public class InspectLoadedCargoTest extends TestApplication
         deviation_4b_Misdirected_UnexpectedLoadVoyage_VoyageNotInItinerary();
 
         cargo.itinerary().set( itinerary );
-        cargo.delivery().set( delivery( TODAY, IN_PORT, ROUTED, leg3 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), IN_PORT, ROUTED, leg3 ) );
 
         // Unexpected load onto voyage not in itinerary - but the carrier is going to our expected arrival location!
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY9, DAY9, trackingId, LOAD, NEWYORK, V205 );
@@ -378,7 +378,7 @@ public class InspectLoadedCargoTest extends TestApplication
         deviation_4c_Misdirected_UnexpectedLoadVoyage_Unplanned_ButGoingToWantedLocation();
 
         cargo.itinerary().set( itinerary );
-        cargo.delivery().set( delivery( TODAY, IN_PORT, ROUTED, leg3 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), IN_PORT, ROUTED, leg3 ) );
 
         // Unexpected voyage schedule change
         V202 = voyage( "V202", schedule(
@@ -412,7 +412,7 @@ public class InspectLoadedCargoTest extends TestApplication
         deviation_4d_Misdirected_ExpectedLoadVoyage_UnexpectedNewVoyageSchedule();
 
         cargo.itinerary().set( itinerary );
-        cargo.delivery().set( delivery( TODAY, IN_PORT, ROUTED, leg3 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), IN_PORT, ROUTED, leg3 ) );
 
         // Restore expected voyage schedule change
         V202 = voyage( "V202", schedule(
@@ -444,8 +444,8 @@ public class InspectLoadedCargoTest extends TestApplication
         success_Load();
 
         // Risk zone destination
-        routeSpec = routeSpecFactory.build( HANGZHOU, ROTTERDAM, new Date(), deadline = DAY24 );
-        delivery = delivery( TODAY, ONBOARD_CARRIER, ROUTED, leg1 );
+        routeSpec = routeSpecFactory.build( HANGZHOU, ROTTERDAM, ZonedDateTime.now(), deadline = DAY24 );
+        delivery = delivery( TODAY.toInstant(), ONBOARD_CARRIER, ROUTED, leg1 );
         cargo = CARGOS.createCargo( routeSpec, delivery, "Naive" );
         trackingId = cargo.trackingId().get();
         itinerary = itinerary(

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectReceivedCargoTest.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectReceivedCargoTest.java b/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectReceivedCargoTest.java
index 5fd01c5..772f63b 100644
--- a/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectReceivedCargoTest.java
+++ b/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectReceivedCargoTest.java
@@ -59,7 +59,7 @@ public class InspectReceivedCargoTest extends TestApplication
 
         // Create new cargo
         routeSpec = routeSpecFactory.build( HONGKONG, STOCKHOLM, TODAY, deadline = DAY24 );
-        delivery = delivery( TODAY, NOT_RECEIVED, NOT_ROUTED, unknownLeg );
+        delivery = delivery( TODAY.toInstant(), NOT_RECEIVED, NOT_ROUTED, unknownLeg );
         cargo = CARGOS.createCargo( routeSpec, delivery, "Received_CARGO" );
         trackingId = cargo.trackingId().get();
     }
@@ -93,7 +93,7 @@ public class InspectReceivedCargoTest extends TestApplication
     {
         // Cargo not routed
         cargo.itinerary().set( null );
-        cargo.delivery().set( delivery( TODAY, NOT_RECEIVED, NOT_ROUTED, leg1 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), NOT_RECEIVED, NOT_ROUTED, leg1 ) );
 
         // Receive cargo in Hong Kong (without an itinerary!)
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, RECEIVE, HONGKONG, noVoyage );
@@ -112,7 +112,7 @@ public class InspectReceivedCargoTest extends TestApplication
     {
         // Misroute cargo - assign unsatisfying itinerary not going to Stockholm
         cargo.itinerary().set( wrongItinerary );
-        cargo.delivery().set( delivery( TODAY, NOT_RECEIVED, MISROUTED, unknownLeg ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), NOT_RECEIVED, MISROUTED, unknownLeg ) );
 
         assertDelivery( null, null, null, null,
                         NOT_RECEIVED, notArrived,
@@ -135,7 +135,7 @@ public class InspectReceivedCargoTest extends TestApplication
         throws Exception
     {
         cargo.itinerary().set( wrongItinerary );
-        cargo.delivery().set( delivery( TODAY, NOT_RECEIVED, MISROUTED, leg1 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), NOT_RECEIVED, MISROUTED, leg1 ) );
 
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, RECEIVE, NEWYORK, noVoyage );
 
@@ -153,7 +153,7 @@ public class InspectReceivedCargoTest extends TestApplication
         throws Exception
     {
         cargo.itinerary().set( wrongItinerary );
-        cargo.delivery().set( delivery( TODAY, NOT_RECEIVED, MISROUTED, unknownLeg ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), NOT_RECEIVED, MISROUTED, unknownLeg ) );
 
         assertDelivery( null, null, null, null,
                         NOT_RECEIVED, notArrived,
@@ -177,7 +177,7 @@ public class InspectReceivedCargoTest extends TestApplication
         throws Exception
     {
         cargo.itinerary().set( wrongItinerary );
-        cargo.delivery().set( delivery( TODAY, NOT_RECEIVED, MISROUTED, unknownLeg ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), NOT_RECEIVED, MISROUTED, unknownLeg ) );
 
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, RECEIVE, HANGZHOU, noVoyage );
 
@@ -195,7 +195,7 @@ public class InspectReceivedCargoTest extends TestApplication
         throws Exception
     {
         cargo.itinerary().set( itinerary );
-        cargo.delivery().set( delivery( TODAY, NOT_RECEIVED, ROUTED, leg1 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), NOT_RECEIVED, ROUTED, leg1 ) );
 
         assertDelivery( null, null, null, null,
                         NOT_RECEIVED, notArrived,
@@ -227,7 +227,7 @@ public class InspectReceivedCargoTest extends TestApplication
     {
         // Assign satisfying route going to Stockholm
         cargo.itinerary().set( itinerary );
-        cargo.delivery().set( delivery( TODAY, NOT_RECEIVED, ROUTED, leg1 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), NOT_RECEIVED, ROUTED, leg1 ) );
 
         // Receipt in cargo/routeSpec destination = no transportation.
         // This must be a unintended booking. Cargo owner should be notified.
@@ -252,7 +252,7 @@ public class InspectReceivedCargoTest extends TestApplication
         throws Exception
     {
         cargo.itinerary().set( itinerary );
-        cargo.delivery().set( delivery( TODAY, NOT_RECEIVED, ROUTED, leg1 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), NOT_RECEIVED, ROUTED, leg1 ) );
 
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, RECEIVE, HANGZHOU, noVoyage );
         thrown.expect( CargoMisdirectedException.class, "MISDIRECTED! Itinerary expected receipt in Hongkong (CNHKG)" );
@@ -264,7 +264,7 @@ public class InspectReceivedCargoTest extends TestApplication
         throws Exception
     {
         cargo.itinerary().set( itinerary );
-        cargo.delivery().set( delivery( TODAY, NOT_RECEIVED, ROUTED, leg1 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), NOT_RECEIVED, ROUTED, leg1 ) );
 
         // Receive cargo as planned in origin
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, RECEIVE, HONGKONG, noVoyage );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectUnhandledCargoTest.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectUnhandledCargoTest.java b/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectUnhandledCargoTest.java
index 0be3b89..a235cab 100644
--- a/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectUnhandledCargoTest.java
+++ b/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectUnhandledCargoTest.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.test.handling.inspection.event;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.junit.Before;
 import org.junit.Test;
 import org.qi4j.api.unitofwork.UnitOfWork;
@@ -52,8 +52,8 @@ public class InspectUnhandledCargoTest extends TestApplication
         CargoAggregateRoot CARGOS = uow.get( CargoAggregateRoot.class, CargoAggregateRoot.CARGOS_ID );
 
         // Create new cargo
-        routeSpec = routeSpecFactory.build( HONGKONG, STOCKHOLM, new Date(), deadline = DAY24 );
-        delivery = delivery( TODAY, NOT_RECEIVED, NOT_ROUTED, leg1 );
+        routeSpec = routeSpecFactory.build( HONGKONG, STOCKHOLM, ZonedDateTime.now(), deadline = DAY24 );
+        delivery = delivery( TODAY.toInstant(), NOT_RECEIVED, NOT_ROUTED, leg1 );
         cargo = CARGOS.createCargo( routeSpec, delivery, "Claimed_CARGO" );
         trackingId = cargo.trackingId().get();
     }
@@ -84,7 +84,7 @@ public class InspectUnhandledCargoTest extends TestApplication
     {
         // Cargo not routed
         cargo.itinerary().set( null );
-        cargo.delivery().set( delivery( TODAY, NOT_RECEIVED, NOT_ROUTED, leg1 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), NOT_RECEIVED, NOT_ROUTED, leg1 ) );
 
         new InspectUnhandledCargo( cargo ).inspect();
 
@@ -100,7 +100,7 @@ public class InspectUnhandledCargoTest extends TestApplication
     {
         // Misroute cargo - assign unsatisfying itinerary not going to Stockholm
         cargo.itinerary().set( wrongItinerary );
-        cargo.delivery().set( delivery( TODAY, NOT_RECEIVED, MISROUTED, leg1 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), NOT_RECEIVED, MISROUTED, leg1 ) );
 
         new InspectUnhandledCargo( cargo ).inspect();
 
@@ -116,7 +116,7 @@ public class InspectUnhandledCargoTest extends TestApplication
     {
         // Assign satisfying route going to Stockholm
         cargo.itinerary().set( itinerary );
-        cargo.delivery().set( delivery( TODAY, NOT_RECEIVED, ROUTED, leg1 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), NOT_RECEIVED, ROUTED, leg1 ) );
 
         new InspectUnhandledCargo( cargo ).inspect();
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectUnloadedCargoTest.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectUnloadedCargoTest.java b/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectUnloadedCargoTest.java
index 3ffa906..9a10404 100644
--- a/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectUnloadedCargoTest.java
+++ b/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/inspection/event/InspectUnloadedCargoTest.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.test.handling.inspection.event;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.junit.Before;
 import org.junit.Test;
 import org.qi4j.api.unitofwork.UnitOfWork;
@@ -60,8 +60,8 @@ public class InspectUnloadedCargoTest extends TestApplication
         CargoAggregateRoot CARGOS = uow.get( CargoAggregateRoot.class, CargoAggregateRoot.CARGOS_ID );
 
         // Create new cargo
-        routeSpec = routeSpecFactory.build( HONGKONG, STOCKHOLM, new Date(), deadline = DAY24 );
-        delivery = delivery( TODAY, ONBOARD_CARRIER, ROUTED, leg1 );
+        routeSpec = routeSpecFactory.build( HONGKONG, STOCKHOLM, ZonedDateTime.now(), deadline = DAY24 );
+        delivery = delivery( TODAY.toInstant(), ONBOARD_CARRIER, ROUTED, leg1 );
         cargo = CARGOS.createCargo( routeSpec, delivery, "Unloaded_CARGO" );
         trackingId = cargo.trackingId().get();
     }
@@ -88,7 +88,7 @@ public class InspectUnloadedCargoTest extends TestApplication
     {
         // Cargo not routed
         cargo.itinerary().set( null );
-        cargo.delivery().set( delivery( TODAY, ONBOARD_CARRIER, NOT_ROUTED, leg1 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), ONBOARD_CARRIER, NOT_ROUTED, leg1 ) );
 
         // Unload in Chicago (without an itinerary!)
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY5, DAY5, trackingId, UNLOAD, CHICAGO, V201 );
@@ -115,7 +115,7 @@ public class InspectUnloadedCargoTest extends TestApplication
     {
         // Misroute cargo - assign unsatisfying itinerary not going to Stockholm
         cargo.itinerary().set( wrongItinerary );
-        cargo.delivery().set( delivery( TODAY, ONBOARD_CARRIER, MISROUTED, leg1 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), ONBOARD_CARRIER, MISROUTED, leg1 ) );
 
         // Unload in Hong Kong (with wrong itinerary)
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, UNLOAD, HONGKONG, V201 );
@@ -141,7 +141,7 @@ public class InspectUnloadedCargoTest extends TestApplication
         throws Exception
     {
         cargo.itinerary().set( wrongItinerary );
-        cargo.delivery().set( delivery( TODAY, ONBOARD_CARRIER, MISROUTED, leg1 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), ONBOARD_CARRIER, MISROUTED, leg1 ) );
 
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, UNLOAD, NEWYORK, V201 );
         thrown.expect( CargoMisroutedException.class, "MISROUTED! Route specification is not satisfied with itinerary" );
@@ -153,7 +153,7 @@ public class InspectUnloadedCargoTest extends TestApplication
         throws Exception
     {
         cargo.itinerary().set( wrongItinerary );
-        cargo.delivery().set( delivery( TODAY, ONBOARD_CARRIER, MISROUTED, leg1 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), ONBOARD_CARRIER, MISROUTED, leg1 ) );
 
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY1, DAY1, trackingId, UNLOAD, ROTTERDAM, V204 );
         thrown.expect( CargoMisroutedException.class, "MISROUTED! Route specification is not satisfied with itinerary" );
@@ -166,7 +166,7 @@ public class InspectUnloadedCargoTest extends TestApplication
     {
         // Assign satisfying route going to Stockholm
         cargo.itinerary().set( itinerary );
-        cargo.delivery().set( delivery( TODAY, ONBOARD_CARRIER, ROUTED, leg1 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), ONBOARD_CARRIER, ROUTED, leg1 ) );
 
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY5, DAY5, trackingId, UNLOAD, CHICAGO, V201 );
         new InspectUnloadedCargo( cargo, handlingEvent ).inspect();
@@ -255,7 +255,7 @@ public class InspectUnloadedCargoTest extends TestApplication
     {
         // Move the cargo ahead on the route. Third leg of itinerary expects unload in Dallas.
         cargo.itinerary().set( itinerary );
-        cargo.delivery().set( delivery( TODAY, ONBOARD_CARRIER, ROUTED, leg3 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), ONBOARD_CARRIER, ROUTED, leg3 ) );
 
         // Unexpected unload in previous unload location of itinerary.
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY7, DAY7, trackingId, UNLOAD, NEWYORK, V201 );
@@ -279,7 +279,7 @@ public class InspectUnloadedCargoTest extends TestApplication
         throws Exception
     {
         cargo.itinerary().set( itinerary );
-        cargo.delivery().set( delivery( TODAY, ONBOARD_CARRIER, ROUTED, leg3 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), ONBOARD_CARRIER, ROUTED, leg3 ) );
 
         // Unexpected load in next load location of itinerary (onto expected voyage) - can't jump ahead in route plan.
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY7, DAY7, trackingId, UNLOAD, GOTHENBURG, V202 );
@@ -292,7 +292,7 @@ public class InspectUnloadedCargoTest extends TestApplication
         throws Exception
     {
         cargo.itinerary().set( itinerary );
-        cargo.delivery().set( delivery( TODAY, ONBOARD_CARRIER, ROUTED, leg3 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), ONBOARD_CARRIER, ROUTED, leg3 ) );
 
         // Unexpected load in unplanned location (onto expected voyage)
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY7, DAY7, trackingId, UNLOAD, HAMBURG, V202 );
@@ -305,7 +305,7 @@ public class InspectUnloadedCargoTest extends TestApplication
         throws Exception
     {
         cargo.itinerary().set( itinerary );
-        cargo.delivery().set( delivery( TODAY, ONBOARD_CARRIER, ROUTED, leg3 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), ONBOARD_CARRIER, ROUTED, leg3 ) );
 
         // Unload in expected location but from unexpected voyage - do we care? For now not.
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY10, DAY10, trackingId, UNLOAD, DALLAS, V205 );
@@ -323,7 +323,7 @@ public class InspectUnloadedCargoTest extends TestApplication
         throws Exception
     {
         cargo.itinerary().set( itinerary );
-        cargo.delivery().set( delivery( TODAY, ONBOARD_CARRIER, ROUTED, leg4 ) );
+        cargo.delivery().set( delivery( TODAY.toInstant(), ONBOARD_CARRIER, ROUTED, leg4 ) );
 
         // Expected unload in leg 4 unload location (Rotterdam)
         handlingEvent = HANDLING_EVENTS.createHandlingEvent( DAY17, DAY17, trackingId, UNLOAD, ROTTERDAM, V202 );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/parsing/ParseHandlingEventDataTest.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/parsing/ParseHandlingEventDataTest.java b/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/parsing/ParseHandlingEventDataTest.java
index 584c332..68c4fdf 100644
--- a/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/parsing/ParseHandlingEventDataTest.java
+++ b/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/parsing/ParseHandlingEventDataTest.java
@@ -17,8 +17,8 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.test.handling.parsing;
 
-import java.text.SimpleDateFormat;
-import java.util.Date;
+import java.time.Instant;
+import java.time.ZonedDateTime;
 import org.junit.Before;
 import org.junit.Test;
 import org.qi4j.api.constraint.ConstraintViolationException;
@@ -38,7 +38,7 @@ import static org.qi4j.sample.dcicargo.sample_b.data.structure.delivery.Transpor
 public class ParseHandlingEventDataTest extends TestApplication
 {
     static ParseHandlingEventData handlingEventParser;
-    static String completionTime;
+    static String completionTime = Instant.now().toString();
 
     @Before
     public void prepareTest()
@@ -50,18 +50,18 @@ public class ParseHandlingEventDataTest extends TestApplication
         CargoAggregateRoot CARGOS = uow.get( CargoAggregateRoot.class, CargoAggregateRoot.CARGOS_ID );
 
         // Create new cargo
-        routeSpec = routeSpecFactory.build( HONGKONG, STOCKHOLM, new Date(), deadline = DAY24 );
-        delivery = delivery( TODAY, NOT_RECEIVED, ROUTED, unknownLeg );
+        routeSpec = routeSpecFactory.build( HONGKONG, STOCKHOLM, ZonedDateTime.now(), deadline = DAY24 );
+        delivery = delivery( TODAY.toInstant(), NOT_RECEIVED, ROUTED, unknownLeg );
         cargo = CARGOS.createCargo( routeSpec, delivery, "ABC" );
         trackingId = cargo.trackingId().get();
         trackingIdString = trackingId.id().get();
         cargo.itinerary().set( itinerary );
-        completionTime = new SimpleDateFormat( "yyyy-MM-dd HH:mm" ).format( new Date() );
 
         // Start ParseHandlingEventData service
         ServiceReference<ParseHandlingEventData> ParseHandlingEventDataRef =
             module.findService( ParseHandlingEventData.class );
         handlingEventParser = ParseHandlingEventDataRef.get();
+
     }
 
     // Null

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/registration/RegisterHandlingEventTest.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/registration/RegisterHandlingEventTest.java b/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/registration/RegisterHandlingEventTest.java
index a6ca313..7b4a256 100644
--- a/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/registration/RegisterHandlingEventTest.java
+++ b/samples/dci-cargo/dcisample_b/src/test/java/org/qi4j/sample/dcicargo/sample_b/context/test/handling/registration/RegisterHandlingEventTest.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_b.context.test.handling.registration;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.junit.Before;
 import org.junit.Test;
 import org.qi4j.api.query.Query;
@@ -65,8 +65,8 @@ public class RegisterHandlingEventTest extends TestApplication
         CargoAggregateRoot CARGOS = uow.get( CargoAggregateRoot.class, CargoAggregateRoot.CARGOS_ID );
 
         // Create new cargo
-        routeSpec = routeSpecFactory.build( HONGKONG, STOCKHOLM, new Date(), deadline = DAY24 );
-        delivery = delivery( TODAY, NOT_RECEIVED, ROUTED, unknownLeg );
+        routeSpec = routeSpecFactory.build( HONGKONG, STOCKHOLM, ZonedDateTime.now(), deadline = DAY24 );
+        delivery = delivery( TODAY.toInstant(), NOT_RECEIVED, ROUTED, unknownLeg );
         cargo = CARGOS.createCargo( routeSpec, delivery, "ABC" );
         cargo.itinerary().set( itinerary );
         trackingId = cargo.trackingId().get();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/forum/src/main/java/org/qi4j/samples/forum/context/view/ViewPost.java
----------------------------------------------------------------------
diff --git a/samples/forum/src/main/java/org/qi4j/samples/forum/context/view/ViewPost.java b/samples/forum/src/main/java/org/qi4j/samples/forum/context/view/ViewPost.java
index 93c8c64..45d4802 100644
--- a/samples/forum/src/main/java/org/qi4j/samples/forum/context/view/ViewPost.java
+++ b/samples/forum/src/main/java/org/qi4j/samples/forum/context/view/ViewPost.java
@@ -1,6 +1,6 @@
 package org.qi4j.samples.forum.context.view;
 
-import java.util.Date;
+import java.time.ZoneId;
 import org.qi4j.api.injection.scope.Structure;
 import org.qi4j.api.injection.scope.Uses;
 import org.qi4j.api.property.Numbers;
@@ -51,7 +51,7 @@ public class ViewPost
             Post post = module.currentUnitOfWork().newEntity( Post.class );
             post.message().set( message );
             post.createdBy().set( poster.self() );
-            post.createdOn().set( new Date( module.currentUnitOfWork().currentTime() ) );
+            post.createdOn().set( module.currentUnitOfWork().currentTime().atZone( ZoneId.systemDefault() ) );
             post.replyTo().set( viewPost.self() );
 
             self().lastPost().set( post );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/forum/src/main/java/org/qi4j/samples/forum/data/entity/Post.java
----------------------------------------------------------------------
diff --git a/samples/forum/src/main/java/org/qi4j/samples/forum/data/entity/Post.java b/samples/forum/src/main/java/org/qi4j/samples/forum/data/entity/Post.java
index 6757332..3771d5b 100644
--- a/samples/forum/src/main/java/org/qi4j/samples/forum/data/entity/Post.java
+++ b/samples/forum/src/main/java/org/qi4j/samples/forum/data/entity/Post.java
@@ -1,6 +1,6 @@
 package org.qi4j.samples.forum.data.entity;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.entity.EntityComposite;
@@ -31,5 +31,5 @@ public interface Post
 
     Property<User> createdBy();
 
-    Property<Date> createdOn();
+    Property<ZonedDateTime> createdOn();
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/forum/src/main/java/org/qi4j/samples/forum/domainevent/DomainEventValue.java
----------------------------------------------------------------------
diff --git a/samples/forum/src/main/java/org/qi4j/samples/forum/domainevent/DomainEventValue.java b/samples/forum/src/main/java/org/qi4j/samples/forum/domainevent/DomainEventValue.java
index b1e1a98..081a8d1 100644
--- a/samples/forum/src/main/java/org/qi4j/samples/forum/domainevent/DomainEventValue.java
+++ b/samples/forum/src/main/java/org/qi4j/samples/forum/domainevent/DomainEventValue.java
@@ -1,5 +1,6 @@
 package org.qi4j.samples.forum.domainevent;
 
+import java.time.Instant;
 import java.util.List;
 import org.qi4j.api.common.UseDefaults;
 import org.qi4j.api.property.Property;
@@ -15,7 +16,7 @@ public interface DomainEventValue
     Property<String> version();
 
     // When the event occurred
-    Property<Long> timestamp();
+    Property<Instant> timestamp();
 
     // Selected objects
     @UseDefaults

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/rental/src/main/java/org/qi4j/sample/rental/domain/Booking.java
----------------------------------------------------------------------
diff --git a/samples/rental/src/main/java/org/qi4j/sample/rental/domain/Booking.java b/samples/rental/src/main/java/org/qi4j/sample/rental/domain/Booking.java
index cf5142b..851e918 100644
--- a/samples/rental/src/main/java/org/qi4j/sample/rental/domain/Booking.java
+++ b/samples/rental/src/main/java/org/qi4j/sample/rental/domain/Booking.java
@@ -18,7 +18,7 @@
 
 package org.qi4j.sample.rental.domain;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.entity.EntityComposite;
@@ -37,9 +37,9 @@ public interface Booking
 
     @Optional
         // if not set, the pickup has not occurred yet.
-    Property<Date> pickedupTime();
+    Property<ZonedDateTime> pickedupTime();
 
     @Optional
         // if not set, the return has not occurred yet.
-    Property<Date> returnedTime();
+    Property<ZonedDateTime> returnedTime();
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/rental/src/main/java/org/qi4j/sample/rental/domain/Car.java
----------------------------------------------------------------------
diff --git a/samples/rental/src/main/java/org/qi4j/sample/rental/domain/Car.java b/samples/rental/src/main/java/org/qi4j/sample/rental/domain/Car.java
index 0f26bcb..0651d3e 100644
--- a/samples/rental/src/main/java/org/qi4j/sample/rental/domain/Car.java
+++ b/samples/rental/src/main/java/org/qi4j/sample/rental/domain/Car.java
@@ -18,7 +18,7 @@
 
 package org.qi4j.sample.rental.domain;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.entity.EntityComposite;
@@ -37,10 +37,10 @@ public interface Car
     Association<CarCategory> category();
 
     @Optional
-    Property<Date> purchasedDate();
+    Property<ZonedDateTime> purchasedDate();
 
     @Optional
-    Property<Date> soldDate();
+    Property<ZonedDateTime> soldDate();
 
     Booking currentBooking();
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/rental/src/main/java/org/qi4j/sample/rental/domain/Period.java
----------------------------------------------------------------------
diff --git a/samples/rental/src/main/java/org/qi4j/sample/rental/domain/Period.java b/samples/rental/src/main/java/org/qi4j/sample/rental/domain/Period.java
index ac783cd..7976166 100644
--- a/samples/rental/src/main/java/org/qi4j/sample/rental/domain/Period.java
+++ b/samples/rental/src/main/java/org/qi4j/sample/rental/domain/Period.java
@@ -18,14 +18,14 @@
 
 package org.qi4j.sample.rental.domain;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.qi4j.api.property.Property;
 import org.qi4j.api.value.ValueComposite;
 
 public interface Period
     extends ValueComposite
 {
-    Property<Date> startOfPeriod();
+    Property<ZonedDateTime> startOfPeriod();
 
-    Property<Date> endOfPeriod();
+    Property<ZonedDateTime> endOfPeriod();
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/rental/src/main/java/org/qi4j/sample/rental/domain/RentalShop.java
----------------------------------------------------------------------
diff --git a/samples/rental/src/main/java/org/qi4j/sample/rental/domain/RentalShop.java b/samples/rental/src/main/java/org/qi4j/sample/rental/domain/RentalShop.java
index 5941854..e9989dd 100644
--- a/samples/rental/src/main/java/org/qi4j/sample/rental/domain/RentalShop.java
+++ b/samples/rental/src/main/java/org/qi4j/sample/rental/domain/RentalShop.java
@@ -20,7 +20,7 @@ package org.qi4j.sample.rental.domain;
 
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
-import java.util.Date;
+import java.time.ZonedDateTime;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
@@ -53,13 +53,13 @@ public interface RentalShop
 
     Booking book( Customer customer, Car car, Period plannedPeriod );
 
-    void pickup( Booking booking, Date time );
+    void pickup( Booking booking, ZonedDateTime time );
 
-    void returned( Booking booking, Date time );
+    void returned( Booking booking, ZonedDateTime time );
 
-    void boughtCar( Car car, Date purchasedate );
+    void boughtCar( Car car, ZonedDateTime purchasedate );
 
-    void soldCar( Car car, Date soldDate );
+    void soldCar( Car car, ZonedDateTime soldDate );
 
     Car createCar( String category, String modelName, String licensePlate );
 
@@ -190,23 +190,23 @@ public interface RentalShop
             return booking;
         }
 
-        public void pickup( Booking booking, Date time )
+        public void pickup( Booking booking, ZonedDateTime time )
         {
             booking.pickedupTime().set( time );
         }
 
-        public void returned( Booking booking, Date time )
+        public void returned( Booking booking, ZonedDateTime time )
         {
             booking.returnedTime().set( time );
         }
 
-        public void boughtCar( Car car, Date purchaseDate )
+        public void boughtCar( Car car, ZonedDateTime purchaseDate )
         {
             state.carsOwned().add( car );
             car.purchasedDate().set( purchaseDate );
         }
 
-        public void soldCar( Car car, Date soldDate )
+        public void soldCar( Car car, ZonedDateTime soldDate )
         {
             state.carsOwned().remove( car );
             car.soldDate().set( soldDate );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/rental/src/main/java/org/qi4j/sample/rental/domain/dev/InitialData.java
----------------------------------------------------------------------
diff --git a/samples/rental/src/main/java/org/qi4j/sample/rental/domain/dev/InitialData.java b/samples/rental/src/main/java/org/qi4j/sample/rental/domain/dev/InitialData.java
index c34ebfe..bd87617 100644
--- a/samples/rental/src/main/java/org/qi4j/sample/rental/domain/dev/InitialData.java
+++ b/samples/rental/src/main/java/org/qi4j/sample/rental/domain/dev/InitialData.java
@@ -18,9 +18,10 @@
 
 package org.qi4j.sample.rental.domain.dev;
 
+import java.time.Duration;
+import java.time.ZonedDateTime;
 import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
+import java.util.Random;
 import org.qi4j.api.composite.TransientComposite;
 import org.qi4j.api.injection.scope.Structure;
 import org.qi4j.api.mixin.Mixins;
@@ -106,22 +107,14 @@ public interface InitialData
 
         private Period createRandomPeriod()
         {
-            Calendar cal = Calendar.getInstance();
-            cal.setTime( new Date() );
-            cal.add( Calendar.DATE, Math.abs( (int) ( Math.random() * 5.0 ) ) );
-            cal.set( Calendar.HOUR_OF_DAY, 15 );
-            cal.set( Calendar.MINUTE, 0 );
-            cal.set( Calendar.SECOND, 0 );
-            Date earliestPickup = cal.getTime();
+            Random random = new Random();
+            ZonedDateTime pickup = ZonedDateTime.now().plusDays( random.nextInt( 5 ) );
+            Duration duration = Duration.ofDays( random.nextInt( 20 ) );
+            ZonedDateTime returned = pickup.plus( duration );
 
-            cal.add( Calendar.DATE, Math.abs( (int) ( Math.random() * 30.0 ) ) );
-            cal.set( Calendar.HOUR_OF_DAY, 12 );
-            cal.set( Calendar.MINUTE, 0 );
-            cal.set( Calendar.SECOND, 0 );
-            Date latestReturn = cal.getTime();
             ValueBuilder<Period> builder = vbf.newValueBuilder( Period.class );
-            builder.prototype().startOfPeriod().set( earliestPickup );
-            builder.prototype().endOfPeriod().set( latestReturn );
+            builder.prototype().startOfPeriod().set( pickup );
+            builder.prototype().endOfPeriod().set( returned );
             return builder.newInstance();
         }
 
@@ -141,55 +134,55 @@ public interface InitialData
         {
             Car car;
             car = shop.createCar( "SUV", "Volvo XC90", "WHO 7878" );
-            shop.boughtCar( car, new Date() );
+            shop.boughtCar( car, ZonedDateTime.now() );
             cars.add( car );
             car = shop.createCar( "SUV", "BMW X5", "WIT 23" );
-            shop.boughtCar( car, new Date() );
+            shop.boughtCar( car, ZonedDateTime.now() );
             cars.add( car );
             car = shop.createCar( "SUV", "Volvo XC90", "WHO 7879" );
-            shop.boughtCar( car, new Date() );
+            shop.boughtCar( car, ZonedDateTime.now() );
             cars.add( car );
             car = shop.createCar( "SUV", "Volvo XC90", "WHO 7880" );
-            shop.boughtCar( car, new Date() );
+            shop.boughtCar( car, ZonedDateTime.now() );
             cars.add( car );
             car = shop.createCar( "SUV", "BMW X5", "WIT 24" );
-            shop.boughtCar( car, new Date() );
+            shop.boughtCar( car, ZonedDateTime.now() );
             cars.add( car );
             car = shop.createCar( "SUV", "BMW X5", "WIT 25" );
-            shop.boughtCar( car, new Date() );
+            shop.boughtCar( car, ZonedDateTime.now() );
             cars.add( car );
             car = shop.createCar( "SUV", "BMW X5", "WIT 26" );
-            shop.boughtCar( car, new Date() );
+            shop.boughtCar( car, ZonedDateTime.now() );
             cars.add( car );
             car = shop.createCar( "SUV", "BMW X5", "WIT 27" );
-            shop.boughtCar( car, new Date() );
+            shop.boughtCar( car, ZonedDateTime.now() );
             cars.add( car );
             car = shop.createCar( "Compact", "Mini Cooper S", "WMY 40" );
-            shop.boughtCar( car, new Date() );
+            shop.boughtCar( car, ZonedDateTime.now() );
             cars.add( car );
             car = shop.createCar( "Compact", "Mini Cooper S", "WMY 41" );
-            shop.boughtCar( car, new Date() );
+            shop.boughtCar( car, ZonedDateTime.now() );
             cars.add( car );
             car = shop.createCar( "Compact", "Mini Cooper S", "WMY 42" );
-            shop.boughtCar( car, new Date() );
+            shop.boughtCar( car, ZonedDateTime.now() );
             cars.add( car );
             car = shop.createCar( "Compact", "Mini Cooper S", "WMY 43" );
-            shop.boughtCar( car, new Date() );
+            shop.boughtCar( car, ZonedDateTime.now() );
             cars.add( car );
             car = shop.createCar( "Compact", "Mini Cooper S", "WMY 44" );
-            shop.boughtCar( car, new Date() );
+            shop.boughtCar( car, ZonedDateTime.now() );
             cars.add( car );
             car = shop.createCar( "Compact", "Mini Cooper S", "WMY 45" );
-            shop.boughtCar( car, new Date() );
+            shop.boughtCar( car, ZonedDateTime.now() );
             cars.add( car );
             car = shop.createCar( "Sedan", "BMW 318i", "WRY 900" );
-            shop.boughtCar( car, new Date() );
+            shop.boughtCar( car, ZonedDateTime.now() );
             cars.add( car );
             car = shop.createCar( "Sedan", "BMW 318i", "WRY 901" );
-            shop.boughtCar( car, new Date() );
+            shop.boughtCar( car, ZonedDateTime.now() );
             cars.add( car );
             car = shop.createCar( "Sedan", "BMW 318i", "WRY 902" );
-            shop.boughtCar( car, new Date() );
+            shop.boughtCar( car, ZonedDateTime.now() );
             cars.add( car );
         }
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/struts2Hello/src/main/java/org/qi4j/library/struts2/example/actions/HelloWorldAction.java
----------------------------------------------------------------------
diff --git a/samples/struts2Hello/src/main/java/org/qi4j/library/struts2/example/actions/HelloWorldAction.java b/samples/struts2Hello/src/main/java/org/qi4j/library/struts2/example/actions/HelloWorldAction.java
index 9805936..91d8def 100644
--- a/samples/struts2Hello/src/main/java/org/qi4j/library/struts2/example/actions/HelloWorldAction.java
+++ b/samples/struts2Hello/src/main/java/org/qi4j/library/struts2/example/actions/HelloWorldAction.java
@@ -23,11 +23,10 @@ import com.opensymphony.xwork2.conversion.annotations.TypeConversion;
 import com.opensymphony.xwork2.validator.annotations.RequiredFieldValidator;
 import com.opensymphony.xwork2.validator.annotations.RequiredStringValidator;
 import com.opensymphony.xwork2.validator.annotations.Validation;
+import java.time.Instant;
 import org.apache.struts2.config.Result;
 import org.apache.struts2.config.Results;
 
-import java.util.Date;
-
 @Validation
 @Conversion
 @Results( { @Result( name = "input", value = "/jsp/index.jsp" ), @Result( value = "/jsp/helloWorld.jsp" ) } )
@@ -37,17 +36,17 @@ public class HelloWorldAction
 
     private static final long serialVersionUID = 1L;
 
-    private Date now;
+    private Instant now;
     private String name;
 
     @TypeConversion( converter = "org.qi4j.library.struts2.example.converters.DateConverter" )
     @RequiredFieldValidator( message = "Please enter the date" )
-    public void setDateNow( Date dateNow )
+    public void setDateNow( Instant dateNow )
     {
         now = dateNow;
     }
 
-    public Date getDateNow()
+    public Instant getDateNow()
     {
         return now;
     }


[49/50] [abbrv] zest-qi4j git commit: build: upgrade Gradle wrapper to 2.2.1

Posted by ni...@apache.org.
build: upgrade Gradle wrapper to 2.2.1


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/aa86f999
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/aa86f999
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/aa86f999

Branch: refs/heads/3.0
Commit: aa86f9999e36243a0e4257129e790d050bbcb09e
Parents: 7d600da
Author: Paul Merlin <pa...@nosphere.org>
Authored: Sat Jan 24 12:22:23 2015 +0100
Committer: Paul Merlin <pa...@nosphere.org>
Committed: Sat Jan 24 12:22:55 2015 +0100

----------------------------------------------------------------------
 build.gradle                             | 8 ++++----
 gradle/wrapper/gradle-wrapper.properties | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/aa86f999/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 8e434c3..2c0db13 100644
--- a/build.gradle
+++ b/build.gradle
@@ -75,12 +75,12 @@ allprojects {
   // UTF-8 For all compilations and javadocs
   // Deprecation warnings for all compilations
   // Unchecked warnings for non-test core compilations
-  tasks.withType(Compile) {
+  tasks.withType(JavaCompile) {
     options.encoding = 'UTF-8'
     options.compilerArgs << "-Xlint:deprecation"
   }
   if("core".equals(group)) {
-    tasks.matching({ task -> task instanceof Compile && !task.name.contains('test') }).
+    tasks.matching({ task -> task instanceof JavaCompile && !task.name.contains('test') }).
         each({ task -> task.options.compilerArgs << "-Xlint:unchecked" })
   }
   tasks.withType(Javadoc) {
@@ -335,7 +335,7 @@ task globalTestReport( type: TestReport ) {
 
 test {
   dependsOn subprojects*.test, globalTestReport
-  testReport = false
+  reports.html.enabled = false
 }
 
 // Jacoco
@@ -650,5 +650,5 @@ task release {
 //  2) /gradlew.bat which is the windows bat script for for executing builds
 //  3) /wrapper which is a directory named by the "jarPath" config which contains other needed files.
 task wrapper( type: Wrapper ) {
-  gradleVersion = '1.12'
+  gradleVersion = '2.2.1'
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/aa86f999/gradle/wrapper/gradle-wrapper.properties
----------------------------------------------------------------------
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 947f764..7185259 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-1.12-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-bin.zip


[26/50] [abbrv] zest-qi4j git commit: Removed Function, Function2 and Specification and replaced with the equivalents in JDK, Function, BiFunction and Predicate.

Posted by ni...@apache.org.
http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/functional/src/main/java/org/qi4j/functional/Specifications.java
----------------------------------------------------------------------
diff --git a/core/functional/src/main/java/org/qi4j/functional/Specifications.java b/core/functional/src/main/java/org/qi4j/functional/Specifications.java
index 7635579..9ff72ad 100644
--- a/core/functional/src/main/java/org/qi4j/functional/Specifications.java
+++ b/core/functional/src/main/java/org/qi4j/functional/Specifications.java
@@ -13,127 +13,104 @@
  */
 package org.qi4j.functional;
 
+import java.util.function.Function;
+import java.util.function.Predicate;
+
 /**
  * Common generic specification expressions
  */
 public class Specifications
 {
-    public static <T> Specification<T> TRUE()
+    public static <T> Predicate<T> TRUE()
     {
-        return new Specification<T>()
-        {
-            @Override
-            public boolean satisfiedBy( T instance )
-            {
-                return true;
-            }
-        };
+        return instance -> true;
     }
 
-    public static <T> Specification<T> not( final Specification<T> specification )
+    public static <T> Predicate<T> not( final Predicate<T> specification )
     {
-        return new Specification<T>()
+        return new Predicate<T>()
         {
             @Override
-            public boolean satisfiedBy( T instance )
+            public boolean test( T instance )
             {
-                return !specification.satisfiedBy( instance );
+                return !specification.test( instance );
             }
         };
     }
 
     @SafeVarargs
-    public static <T> AndSpecification<T> and( final Specification<T>... specifications )
+    public static <T> AndSpecification<T> and( final Predicate<T>... specifications )
     {
         return and( Iterables.iterable( specifications ) );
     }
 
-    public static <T> AndSpecification<T> and( final Iterable<Specification<T>> specifications )
+    public static <T> AndSpecification<T> and( final Iterable<Predicate<T>> specifications )
     {
         return new AndSpecification<>( specifications );
     }
 
     @SafeVarargs
-    public static <T> OrSpecification<T> or( final Specification<T>... specifications )
+    public static <T> OrSpecification<T> or( final Predicate<T>... specifications )
     {
         return or( Iterables.iterable( specifications ) );
     }
 
-    public static <T> OrSpecification<T> or( final Iterable<Specification<T>> specifications )
+    public static <T> OrSpecification<T> or( final Iterable<Predicate<T>> specifications )
     {
         return new OrSpecification<>( specifications );
     }
 
     @SafeVarargs
-    public static <T> Specification<T> in( final T... allowed )
+    public static <T> Predicate<T> in( final T... allowed )
     {
         return in( Iterables.iterable( allowed ) );
     }
 
-    public static <T> Specification<T> in( final Iterable<T> allowed )
+    public static <T> Predicate<T> in( final Iterable<T> allowed )
     {
-        return new Specification<T>()
-        {
-            @Override
-            public boolean satisfiedBy( T item )
+        return item -> {
+            for( T allow : allowed )
             {
-                for( T allow : allowed )
+                if( allow.equals( item ) )
                 {
-                    if( allow.equals( item ) )
-                    {
-                        return true;
-                    }
+                    return true;
                 }
-                return false;
             }
+            return false;
         };
     }
 
-    public static <T> Specification<T> notNull()
+    public static <T> Predicate<T> notNull()
     {
-        return new Specification<T>()
-        {
-            @Override
-            public boolean satisfiedBy( T item )
-            {
-                return item != null;
-            }
-        };
+        return item -> item != null;
     }
 
-    public static <FROM, TO> Specification<FROM> translate( final Function<FROM, TO> function,
-                                                            final Specification<? super TO> specification
+    public static <FROM, TO> Predicate<FROM> translate( final Function<FROM, TO> function,
+                                                            final Predicate<? super TO> specification
     )
     {
-        return new Specification<FROM>()
-        {
-            @Override
-            public boolean satisfiedBy( FROM item )
-            {
-                return specification.satisfiedBy( function.map( item ) );
-            }
-        };
+        return item -> specification.test( function.apply( item ) );
     }
 
     /**
      * AND Specification.
      */
     public static class AndSpecification<T>
-        implements Specification<T>
+        implements Predicate<T>
     {
-        private final Iterable<Specification<T>> specifications;
+        private final Iterable<Predicate<T>> specifications;
 
-        private AndSpecification( Iterable<Specification<T>> specifications )
+        private AndSpecification( Iterable<Predicate<T>> specifications )
         {
             this.specifications = specifications;
         }
 
         @Override
-        public boolean satisfiedBy( T instance )
+        public boolean test( T instance )
         {
-            for( Specification<T> specification : specifications )
+            for( Predicate<T> specification : specifications )
             {
-                if( !specification.satisfiedBy( instance ) )
+                if( !specification.test( instance ) )
                 {
                     return false;
                 }
@@ -143,15 +120,15 @@ public class Specifications
         }
 
         @SafeVarargs
-        public final AndSpecification<T> and( Specification<T>... specifications )
+        public final AndSpecification<T> and( Predicate<T>... specifications )
         {
-            Iterable<Specification<T>> iterable = Iterables.iterable( specifications );
-            Iterable<Specification<T>> flatten = Iterables.flatten( this.specifications, iterable );
+            Iterable<Predicate<T>> iterable = Iterables.iterable( specifications );
+            Iterable<Predicate<T>> flatten = Iterables.flatten( this.specifications, iterable );
             return Specifications.and( flatten );
         }
 
         @SafeVarargs
-        public final OrSpecification<T> or( Specification<T>... specifications )
+        public final OrSpecification<T> or( Predicate<T>... specifications )
         {
             return Specifications.or( Iterables.prepend( this, Iterables.iterable( specifications ) ) );
         }
@@ -161,21 +138,21 @@ public class Specifications
      * OR Specification.
      */
     public static class OrSpecification<T>
-        implements Specification<T>
+        implements Predicate<T>
     {
-        private final Iterable<Specification<T>> specifications;
+        private final Iterable<Predicate<T>> specifications;
 
-        private OrSpecification( Iterable<Specification<T>> specifications )
+        private OrSpecification( Iterable<Predicate<T>> specifications )
         {
             this.specifications = specifications;
         }
 
         @Override
-        public boolean satisfiedBy( T instance )
+        public boolean test( T instance )
         {
-            for( Specification<T> specification : specifications )
+            for( Predicate<T> specification : specifications )
             {
-                if( specification.satisfiedBy( instance ) )
+                if( specification.test( instance ) )
                 {
                     return true;
                 }
@@ -185,16 +162,16 @@ public class Specifications
         }
 
         @SafeVarargs
-        public final AndSpecification<T> and( Specification<T>... specifications )
+        public final AndSpecification<T> and( Predicate<T>... specifications )
         {
             return Specifications.and( Iterables.prepend( this, Iterables.iterable( specifications ) ) );
         }
 
         @SafeVarargs
-        public final OrSpecification<T> or( Specification<T>... specifications )
+        public final OrSpecification<T> or( Predicate<T>... specifications )
         {
-            Iterable<Specification<T>> iterable = Iterables.iterable( specifications );
-            Iterable<Specification<T>> flatten = Iterables.flatten( this.specifications, iterable );
+            Iterable<Predicate<T>> iterable = Iterables.iterable( specifications );
+            Iterable<Predicate<T>> flatten = Iterables.flatten( this.specifications, iterable );
             return Specifications.or( flatten );
         }
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/functional/src/test/java/org/qi4j/functional/FunctionsTest.java
----------------------------------------------------------------------
diff --git a/core/functional/src/test/java/org/qi4j/functional/FunctionsTest.java b/core/functional/src/test/java/org/qi4j/functional/FunctionsTest.java
deleted file mode 100644
index 5f13459..0000000
--- a/core/functional/src/test/java/org/qi4j/functional/FunctionsTest.java
+++ /dev/null
@@ -1,125 +0,0 @@
-package org.qi4j.functional;
-
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.junit.Test;
-
-import static org.hamcrest.CoreMatchers.equalTo;
-import static org.junit.Assert.assertThat;
-import static org.qi4j.functional.ForEach.forEach;
-import static org.qi4j.functional.Functions.compose;
-import static org.qi4j.functional.Functions.count;
-import static org.qi4j.functional.Functions.indexOf;
-import static org.qi4j.functional.Functions.intSum;
-import static org.qi4j.functional.Functions.longSum;
-import static org.qi4j.functional.Iterables.iterable;
-import static org.qi4j.functional.Iterables.last;
-import static org.qi4j.functional.Iterables.map;
-import static org.qi4j.functional.Specifications.in;
-
-/**
- * Test of utility functions
- */
-public class FunctionsTest
-{
-    Function<Object, String> stringifier = new Function<Object, String>()
-    {
-        @Override
-        public String map( Object s )
-        {
-            return s.toString();
-        }
-    };
-
-    Function<String, Integer> length = new Function<String, Integer>()
-    {
-        @Override
-        public Integer map( String s )
-        {
-            return s.length();
-        }
-    };
-
-    @Test
-    public void testCompose()
-    {
-        assertThat( Functions.<Object, String, Integer>compose()
-                        .map( length, stringifier )
-                        .map( 12345L ), equalTo( 5 ) );
-        assertThat( compose( length, stringifier ).map( 12345L ), equalTo( 5 ) );
-    }
-
-    @Test
-    public void testFromMap()
-    {
-        Map<String, String> map = new HashMap<String, String>();
-        map.put( "A", "1" );
-        map.put( "B", "2" );
-        map.put( "C", "3" );
-        assertThat( Iterables.toList( Iterables.filter( Specifications.notNull(), Iterables.map( Functions.fromMap( map ), Iterables
-            .iterable( "A", "B", "D" ) ) ) ).toString(), equalTo( "[1, 2]" ) );
-    }
-
-    @Test
-    public void testWithDefault()
-    {
-        assertThat( Iterables.toList( Iterables.map( Functions.withDefault( "DEFAULT" ), Iterables.iterable( "123", null, "456" ) ) )
-                        .toString(), equalTo( "[123, DEFAULT, 456]" ) );
-    }
-
-    @Test
-    public void testLongSum()
-    {
-        assertThat( last( map( longSum(), iterable( 1, 2L, 3F, 4D ) ) ), equalTo( 10L ) );
-    }
-
-    @Test
-    public void testLongSum2()
-    {
-        assertThat( forEach( iterable( 1, 2, 3, 4 ) ).map( longSum() ).last(), equalTo( 10L ) );
-    }
-
-    @Test
-    public void testIntSum()
-    {
-        assertThat( last( map( intSum(), iterable( 1, 2L, 3F, 4D ) ) ), equalTo( 10 ) );
-    }
-
-    @Test
-    public void testCount()
-    {
-        assertThat( last( map( count( in( "X" ) ), iterable( "X", "Y", "X", "X", "Y" ) ) ), equalTo( 3 ) );
-    }
-
-    @Test
-    public void testIndexOf()
-    {
-        assertThat( last( map( indexOf( in( "D" ) ), iterable( "A", "B", "C", "D", "D" ) ) ), equalTo( 3 ) );
-    }
-
-    @Test
-    public void testIndexOf2()
-    {
-        assertThat( indexOf( "D", iterable( "A", "B", "C", "D", "D" ) ), equalTo( 3 ) );
-    }
-
-    @Test
-    public void testComparator()
-    {
-        Comparator<Integer> comparator = Functions.comparator( new Function<Integer, Comparable>()
-        {
-            @Override
-            public Comparable map( Integer integer )
-            {
-                return integer.toString();
-            }
-        } );
-        Iterable<Integer> iterable = Iterables.iterable( 1, 5, 3, 6, 8 );
-        List<Integer> integers = Iterables.toList( iterable );
-        Collections.sort( integers, comparator );
-        assertThat( integers.toString(), equalTo( "[1, 3, 5, 6, 8]" ) );
-    }
-}

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/functional/src/test/java/org/qi4j/functional/IntegerRangeSpecificationTest.java
----------------------------------------------------------------------
diff --git a/core/functional/src/test/java/org/qi4j/functional/IntegerRangeSpecificationTest.java b/core/functional/src/test/java/org/qi4j/functional/IntegerRangeSpecificationTest.java
deleted file mode 100644
index d29b24b..0000000
--- a/core/functional/src/test/java/org/qi4j/functional/IntegerRangeSpecificationTest.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2012, Niclas Hedhman. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- *
- *     You may obtain a copy of the License at
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.qi4j.functional;
-
-import org.junit.Test;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-// This test exist primarily for the documentation. Don't remove.
-public class IntegerRangeSpecificationTest
-{
-    @Test
-    public void test1()
-    {
-        Specification<Integer> spec = new IntegerRangeSpecification( 10, 12 );
-        assertTrue( spec.satisfiedBy( 10 ) );
-        assertTrue( spec.satisfiedBy( 11 ) );
-        assertTrue( spec.satisfiedBy( 12 ) );
-        assertFalse( spec.satisfiedBy( 9 ) );
-        assertFalse( spec.satisfiedBy( 13 ) );
-    }
-
-    // START SNIPPET: specification
-    public static class IntegerRangeSpecification
-        implements Specification<Integer>
-    {
-
-        private int lower;
-        private int higher;
-
-        public IntegerRangeSpecification( int lower, int higher )
-        {
-            this.lower = lower;
-            this.higher = higher;
-        }
-
-        @Override
-        public boolean satisfiedBy( Integer item )
-        {
-            return item >= lower && item <= higher;
-        }
-    }
-    // END SNIPPET: specification
-}

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/functional/src/test/java/org/qi4j/functional/IterablesTest.java
----------------------------------------------------------------------
diff --git a/core/functional/src/test/java/org/qi4j/functional/IterablesTest.java b/core/functional/src/test/java/org/qi4j/functional/IterablesTest.java
index 6aee556..ee2721c 100644
--- a/core/functional/src/test/java/org/qi4j/functional/IterablesTest.java
+++ b/core/functional/src/test/java/org/qi4j/functional/IterablesTest.java
@@ -18,6 +18,8 @@ import java.util.Collection;
 import java.util.Comparator;
 import java.util.Enumeration;
 import java.util.List;
+import java.util.function.Function;
+import java.util.function.Predicate;
 import org.hamcrest.CoreMatchers;
 import org.junit.Test;
 
@@ -36,19 +38,6 @@ public class IterablesTest
     private Iterable<Integer> numberIntegers = Arrays.asList( 1, 2, 3 );
 
     @Test
-    public void testConstant()
-    {
-        String str = "";
-
-        for( String string : Iterables.limit( 3, Iterables.constant( "123" ) ) )
-        {
-            str += string;
-        }
-
-        assertThat( str, CoreMatchers.equalTo( "123123123" ) );
-    }
-
-    @Test
     public void testUnique()
     {
         String str = "";
@@ -103,7 +92,7 @@ public class IterablesTest
             int sum = 0;
 
             @Override
-            public Integer map( Integer number )
+            public Integer apply( Integer number )
             {
                 return sum += number;
             }
@@ -172,7 +161,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 +173,7 @@ public class IterablesTest
         {
 
             @Override
-            public Integer map( Collection collection )
+            public Integer apply( Collection collection )
             {
                 return collection.size();
             }
@@ -231,7 +220,7 @@ public class IterablesTest
         {
 
             @Override
-            public String map( String s )
+            public String apply( String s )
             {
                 return s + ":" + s.length();
             }
@@ -248,11 +237,11 @@ public class IterablesTest
     {
         final int[] count = new int[ 1 ];
 
-        Iterable<String> b = Iterables.cache( Iterables.filter( Specifications.and( new Specification<String>()
+        Iterable<String> b = Iterables.cache( Iterables.filter( Specifications.and( new Predicate<String>()
         {
 
             @Override
-            public boolean satisfiedBy( String item )
+            public boolean test( String item )
             {
                 count[ 0] = count[ 0] + 1;
                 return true;

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/functional/src/test/java/org/qi4j/functional/SpecificationsTest.java
----------------------------------------------------------------------
diff --git a/core/functional/src/test/java/org/qi4j/functional/SpecificationsTest.java b/core/functional/src/test/java/org/qi4j/functional/SpecificationsTest.java
deleted file mode 100644
index 98b893e..0000000
--- a/core/functional/src/test/java/org/qi4j/functional/SpecificationsTest.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2010, Rickard Öberg. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.qi4j.functional;
-
-import org.junit.Assert;
-import org.junit.Test;
-
-import static org.hamcrest.CoreMatchers.equalTo;
-
-/**
- * JAVADOC
- */
-public class SpecificationsTest
-{
-    @Test
-    public void testTRUE()
-    {
-        Assert.assertThat( Specifications.<Object>TRUE().satisfiedBy( new Object() ), equalTo( true ) );
-    }
-
-    @Test
-    public void testNot()
-    {
-        Assert.assertThat( Specifications.not( Specifications.<Object>TRUE() )
-                               .satisfiedBy( new Object() ), equalTo( false ) );
-    }
-
-    @Test
-    public void testAnd()
-    {
-        Specification<Object> trueSpec = Specifications.<Object>TRUE();
-        Specification<Object> falseSpec = Specifications.not( Specifications.<Object>TRUE() );
-
-        Assert.assertThat( Specifications.and( falseSpec, falseSpec ).satisfiedBy( new Object() ), equalTo( false ) );
-        Assert.assertThat( Specifications.and( trueSpec, falseSpec ).satisfiedBy( new Object() ), equalTo( false ) );
-        Assert.assertThat( Specifications.and( falseSpec, trueSpec ).satisfiedBy( new Object() ), equalTo( false ) );
-        Assert.assertThat( Specifications.and( trueSpec, trueSpec ).satisfiedBy( new Object() ), equalTo( true ) );
-    }
-
-    @Test
-    public void testOr()
-    {
-        Specification<Object> trueSpec = Specifications.<Object>TRUE();
-        Specification<Object> falseSpec = Specifications.not( Specifications.<Object>TRUE() );
-
-        Assert.assertThat( Specifications.or( falseSpec, falseSpec ).satisfiedBy( new Object() ), equalTo( false ) );
-        Assert.assertThat( Specifications.or( trueSpec, falseSpec ).satisfiedBy( new Object() ), equalTo( true ) );
-        Assert.assertThat( Specifications.or( falseSpec, trueSpec ).satisfiedBy( new Object() ), equalTo( true ) );
-        Assert.assertThat( Specifications.or( trueSpec, trueSpec ).satisfiedBy( new Object() ), equalTo( true ) );
-    }
-
-    @Test
-    public void testIn()
-    {
-        Assert.assertThat( Specifications.in( "1", "2", "3" ).satisfiedBy( "2" ), equalTo( true ) );
-        Assert.assertThat( Specifications.in( "1", "2", "3" ).satisfiedBy( "4" ), equalTo( false ) );
-    }
-
-    @Test
-    public void testTranslate()
-    {
-        Function<Object, String> stringifier = new Function<Object, String>()
-        {
-            @Override
-            public String map( Object s )
-            {
-                return s.toString();
-            }
-        };
-
-        Assert.assertTrue( Specifications.translate( stringifier, Specifications.in( "3" ) ).satisfiedBy( 3L ) );
-    }
-}

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/functional/src/test/java/org/qi4j/functional/docsupport/FunctionalDocs.java
----------------------------------------------------------------------
diff --git a/core/functional/src/test/java/org/qi4j/functional/docsupport/FunctionalDocs.java b/core/functional/src/test/java/org/qi4j/functional/docsupport/FunctionalDocs.java
index 30bb31b..c0ca3a6 100644
--- a/core/functional/src/test/java/org/qi4j/functional/docsupport/FunctionalDocs.java
+++ b/core/functional/src/test/java/org/qi4j/functional/docsupport/FunctionalDocs.java
@@ -1,10 +1,11 @@
 package org.qi4j.functional.docsupport;
 
 import java.util.ArrayList;
+import java.util.function.Function;
 
-// START SNIPPET: func2
 import static org.qi4j.functional.ForEach.forEach;
-import static org.qi4j.functional.Functions.longSum;
+
+// START SNIPPET: func2
 // END SNIPPET: func2
 
 public class FunctionalDocs
@@ -34,4 +35,19 @@ public class FunctionalDocs
 // END SNIPPET: func2
         }
     }
+
+    private static Function<Number, Long> longSum()
+    {
+        return new Function<Number, Long>()
+        {
+            long sum;
+
+            @Override
+            public Long apply( Number number )
+            {
+                sum += number.longValue();
+                return sum;
+            }
+        };
+    }
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/io/src/main/java/org/qi4j/io/Transforms.java
----------------------------------------------------------------------
diff --git a/core/io/src/main/java/org/qi4j/io/Transforms.java b/core/io/src/main/java/org/qi4j/io/Transforms.java
index c7bcb7d..8573a0f 100644
--- a/core/io/src/main/java/org/qi4j/io/Transforms.java
+++ b/core/io/src/main/java/org/qi4j/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 org.qi4j.functional.Function;
-import org.qi4j.functional.Specification;
+import java.util.function.Function;
+import java.util.function.Predicate;
 import org.slf4j.Logger;
 
 /**
@@ -38,7 +38,7 @@ public class Transforms
      *
      * @return
      */
-    public static <T, ReceiverThrowableType extends Throwable> Output<T, ReceiverThrowableType> filter( final Specification<? super T> specification,
+    public static <T, ReceiverThrowableType extends Throwable> Output<T, ReceiverThrowableType> filter( final Predicate<? super T> specification,
                                                                                                         final Output<T, ReceiverThrowableType> output
     )
     {
@@ -60,7 +60,7 @@ public class Transforms
                             public void receive( T item )
                                 throws ReceiverThrowableType
                             {
-                                if( specification.satisfiedBy( item ) )
+                                if( specification.test( item ) )
                                 {
                                     receiver.receive( item );
                                 }
@@ -105,7 +105,7 @@ public class Transforms
                             public void receive( From item )
                                 throws ReceiverThrowableType
                             {
-                                receiver.receive( function.map( item ) );
+                                receiver.receive( function.apply( item ) );
                             }
                         } );
                     }
@@ -126,7 +126,7 @@ public class Transforms
      *
      * @return
      */
-    public static <T, ReceiverThrowableType extends Throwable> Output<T, ReceiverThrowableType> filteredMap( final Specification<? super T> specification,
+    public static <T, ReceiverThrowableType extends Throwable> Output<T, ReceiverThrowableType> filteredMap( final Predicate<? super T> specification,
                                                                                                              final Function<? super T, ? extends T> function,
                                                                                                              final Output<T, ReceiverThrowableType> output
     )
@@ -149,9 +149,9 @@ public class Transforms
                             public void receive( T item )
                                 throws ReceiverThrowableType
                             {
-                                if( specification.satisfiedBy( item ) )
+                                if( specification.test( item ) )
                                 {
-                                    receiver.receive( function.map( item ) );
+                                    receiver.receive( function.apply( item ) );
                                 }
                                 else
                                 {
@@ -289,7 +289,7 @@ public class Transforms
         }
 
         @Override
-        public T map( T t )
+        public T apply( T t )
         {
             count++;
             return t;
@@ -311,7 +311,7 @@ public class Transforms
         }
 
         @Override
-        public byte[] map( String s )
+        public byte[] apply( String s )
         {
             return s.getBytes( charSet );
         }
@@ -331,7 +331,7 @@ public class Transforms
         }
 
         @Override
-        public String map( ByteBuffer buffer )
+        public String apply( ByteBuffer buffer )
         {
             return new String( buffer.array(), charSet );
         }
@@ -344,7 +344,7 @@ public class Transforms
         implements Function<Object, String>
     {
         @Override
-        public String map( Object o )
+        public String apply( Object o )
         {
             return o.toString();
         }
@@ -369,7 +369,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;
@@ -408,9 +408,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();
@@ -423,7 +423,7 @@ public class Transforms
         {
             if( log != null )
             {
-                log.map( counter.count + "" );
+                log.apply( counter.count + "" );
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/io/src/test/java/org/qi4j/io/InputOutputTest.java
----------------------------------------------------------------------
diff --git a/core/io/src/test/java/org/qi4j/io/InputOutputTest.java b/core/io/src/test/java/org/qi4j/io/InputOutputTest.java
index 72f2885..7eb06d6 100644
--- a/core/io/src/test/java/org/qi4j/io/InputOutputTest.java
+++ b/core/io/src/test/java/org/qi4j/io/InputOutputTest.java
@@ -33,10 +33,10 @@ 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 org.hamcrest.CoreMatchers;
 import org.junit.Assert;
 import org.junit.Test;
-import org.qi4j.functional.Function;
 import org.qi4j.functional.Visitor;
 import org.slf4j.LoggerFactory;
 
@@ -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-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/association/AbstractAssociationInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/association/AbstractAssociationInstance.java b/core/runtime/src/main/java/org/qi4j/runtime/association/AbstractAssociationInstance.java
index e42b2c5..52e4f2d 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/association/AbstractAssociationInstance.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/association/AbstractAssociationInstance.java
@@ -3,10 +3,10 @@ package org.qi4j.runtime.association;
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Proxy;
 import java.lang.reflect.Type;
+import java.util.function.BiFunction;
 import org.qi4j.api.association.AbstractAssociation;
 import org.qi4j.api.entity.EntityComposite;
 import org.qi4j.api.entity.EntityReference;
-import org.qi4j.functional.Function2;
 import org.qi4j.runtime.composite.ProxyReferenceInvocationHandler;
 import org.qi4j.runtime.entity.EntityInstance;
 
@@ -17,10 +17,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;
@@ -45,7 +45,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-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/association/AssociationInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/association/AssociationInstance.java b/core/runtime/src/main/java/org/qi4j/runtime/association/AssociationInstance.java
index d5babcd..cc8deb4 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/association/AssociationInstance.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/association/AssociationInstance.java
@@ -15,12 +15,12 @@
 package org.qi4j.runtime.association;
 
 import java.lang.reflect.Type;
+import java.util.function.BiFunction;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.association.AssociationDescriptor;
 import org.qi4j.api.association.AssociationWrapper;
 import org.qi4j.api.entity.EntityReference;
 import org.qi4j.api.property.Property;
-import org.qi4j.functional.Function2;
 
 /**
  * Implementation of Association to a single Entity.
@@ -32,7 +32,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-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/association/ManyAssociationInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/association/ManyAssociationInstance.java b/core/runtime/src/main/java/org/qi4j/runtime/association/ManyAssociationInstance.java
index a946862..b28b7cb 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/association/ManyAssociationInstance.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/association/ManyAssociationInstance.java
@@ -6,11 +6,11 @@ import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
+import java.util.function.BiFunction;
 import org.qi4j.api.association.AssociationDescriptor;
 import org.qi4j.api.association.ManyAssociation;
 import org.qi4j.api.association.ManyAssociationWrapper;
 import org.qi4j.api.entity.EntityReference;
-import org.qi4j.functional.Function2;
 import org.qi4j.runtime.composite.ConstraintsCheck;
 import org.qi4j.spi.entity.ManyAssociationState;
 
@@ -24,7 +24,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-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/association/ManyAssociationModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/association/ManyAssociationModel.java b/core/runtime/src/main/java/org/qi4j/runtime/association/ManyAssociationModel.java
index 3cc5d81..3c3b438 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/association/ManyAssociationModel.java
+++ b/core/runtime/src/main/java/org/qi4j/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.qi4j.api.association.AssociationDescriptor;
 import org.qi4j.api.association.GenericAssociationInfo;
 import org.qi4j.api.association.ManyAssociation;
@@ -37,7 +38,6 @@ import org.qi4j.api.entity.Queryable;
 import org.qi4j.api.property.Immutable;
 import org.qi4j.api.util.Classes;
 import org.qi4j.bootstrap.BindingException;
-import org.qi4j.functional.Function2;
 import org.qi4j.functional.Visitable;
 import org.qi4j.functional.Visitor;
 import org.qi4j.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-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/association/NamedAssociationInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/association/NamedAssociationInstance.java b/core/runtime/src/main/java/org/qi4j/runtime/association/NamedAssociationInstance.java
index 4ca67b2..f606f79 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/association/NamedAssociationInstance.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/association/NamedAssociationInstance.java
@@ -22,9 +22,9 @@ import java.lang.reflect.Type;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.function.BiFunction;
 import org.qi4j.api.association.NamedAssociation;
 import org.qi4j.api.entity.EntityReference;
-import org.qi4j.functional.Function2;
 import org.qi4j.runtime.composite.ConstraintsCheck;
 import org.qi4j.spi.entity.NamedAssociationState;
 
@@ -36,7 +36,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 )
     {
         super( associationInfo, associationFunction );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/association/NamedAssociationModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/association/NamedAssociationModel.java b/core/runtime/src/main/java/org/qi4j/runtime/association/NamedAssociationModel.java
index 7c144d0..65a7cfe 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/association/NamedAssociationModel.java
+++ b/core/runtime/src/main/java/org/qi4j/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.qi4j.api.association.AssociationDescriptor;
 import org.qi4j.api.association.GenericAssociationInfo;
 import org.qi4j.api.association.NamedAssociation;
@@ -38,7 +39,6 @@ import org.qi4j.api.entity.Queryable;
 import org.qi4j.api.property.Immutable;
 import org.qi4j.api.util.Classes;
 import org.qi4j.bootstrap.BindingException;
-import org.qi4j.functional.Function2;
 import org.qi4j.functional.Visitable;
 import org.qi4j.functional.Visitor;
 import org.qi4j.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-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/CompositeAssemblyImpl.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/CompositeAssemblyImpl.java b/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/CompositeAssemblyImpl.java
index 7441390..5f064ff 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/CompositeAssemblyImpl.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/CompositeAssemblyImpl.java
@@ -32,6 +32,8 @@ import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
+import java.util.function.Function;
+import java.util.function.Predicate;
 import org.qi4j.api.common.MetaInfo;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.common.QualifiedName;
@@ -58,10 +60,8 @@ import org.qi4j.api.util.Classes;
 import org.qi4j.api.util.Fields;
 import org.qi4j.bootstrap.StateDeclarations;
 import org.qi4j.functional.ForEach;
-import org.qi4j.functional.Function;
 import org.qi4j.functional.HierarchicalVisitorAdapter;
 import org.qi4j.functional.Iterables;
-import org.qi4j.functional.Specification;
 import org.qi4j.functional.Visitor;
 import org.qi4j.runtime.composite.AbstractConstraintModel;
 import org.qi4j.runtime.composite.CompositeConstraintModel;
@@ -314,10 +314,10 @@ public abstract class CompositeAssemblyImpl
         // Check if mixinClass implements the method. If so, check if the mixinClass is generic or if the filter passes.
         // If a mixinClass is both generic AND non-generic at the same time, then the filter applies to the non-generic
         // side only.
-        Specification<Class<?>> appliesToSpec = new Specification<Class<?>>()
+        Predicate<Class<?>> appliesToSpec = new Predicate<Class<?>>()
         {
             @Override
-            public boolean satisfiedBy( Class<?> item )
+            public boolean test( Class<?> item )
             {
                 return helper.appliesTo( item, method, types, item );
             }
@@ -331,10 +331,10 @@ public abstract class CompositeAssemblyImpl
     private Class<?> findGenericImplementation( final Method method, Iterable<Class<?>> mixins )
     {
         // Check if mixinClass is generic and the applies-to filter passes
-        return first( filter( and( GenericSpecification.INSTANCE, new Specification<Class<?>>()
+        return first( filter( and( GenericSpecification.INSTANCE, new Predicate<Class<?>>()
         {
             @Override
-            public boolean satisfiedBy( Class<?> item )
+            public boolean test( Class<?> item )
             {
                 return helper.appliesTo( item, method, types, item );
             }
@@ -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-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/EntityAssemblyImpl.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/EntityAssemblyImpl.java b/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/EntityAssemblyImpl.java
index e74f63c..1d06720 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/EntityAssemblyImpl.java
+++ b/core/runtime/src/main/java/org/qi4j/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-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/LayerAssemblyImpl.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/LayerAssemblyImpl.java b/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/LayerAssemblyImpl.java
index 8853f92..b0d6882 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/LayerAssemblyImpl.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/LayerAssemblyImpl.java
@@ -23,6 +23,7 @@ import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Set;
+import java.util.function.Predicate;
 import org.qi4j.api.activation.Activator;
 import org.qi4j.api.common.MetaInfo;
 import org.qi4j.api.common.Visibility;
@@ -44,7 +45,6 @@ import org.qi4j.bootstrap.TransientAssembly;
 import org.qi4j.bootstrap.TransientDeclaration;
 import org.qi4j.bootstrap.ValueAssembly;
 import org.qi4j.bootstrap.ValueDeclaration;
-import org.qi4j.functional.Specification;
 
 /**
  * Assembly of a Layer. From here you can create more ModuleAssemblies for
@@ -135,7 +135,7 @@ public final class LayerAssemblyImpl
     }
 
     @Override
-    public EntityDeclaration entities( Specification<? super EntityAssembly> specification )
+    public EntityDeclaration entities( Predicate<? super EntityAssembly> specification )
     {
         final List<EntityDeclaration> declarations = new ArrayList<>();
 
@@ -209,7 +209,7 @@ public final class LayerAssemblyImpl
     }
 
     @Override
-    public ServiceDeclaration services( Specification<? super ServiceAssembly> specification )
+    public ServiceDeclaration services( Predicate<? super ServiceAssembly> specification )
     {
         final List<ServiceDeclaration> declarations = new ArrayList<>();
 
@@ -325,7 +325,7 @@ public final class LayerAssemblyImpl
     }
 
     @Override
-    public TransientDeclaration transients( Specification<? super TransientAssembly> specification )
+    public TransientDeclaration transients( Predicate<? super TransientAssembly> specification )
     {
         final List<TransientDeclaration> declarations = new ArrayList<>();
 
@@ -399,7 +399,7 @@ public final class LayerAssemblyImpl
     }
 
     @Override
-    public ValueDeclaration values( Specification<? super ValueAssembly> specification )
+    public ValueDeclaration values( Predicate<? super ValueAssembly> specification )
     {
         final List<ValueDeclaration> declarations = new ArrayList<>();
 
@@ -472,7 +472,7 @@ public final class LayerAssemblyImpl
     }
 
     @Override
-    public ObjectDeclaration objects( Specification<? super ObjectAssembly> specification )
+    public ObjectDeclaration objects( Predicate<? super ObjectAssembly> specification )
     {
         final List<ObjectDeclaration> declarations = new ArrayList<>();
 
@@ -506,7 +506,7 @@ public final class LayerAssemblyImpl
     }
 
     @Override
-    public ImportedServiceDeclaration importedServices( Specification<? super ImportedServiceAssembly> specification )
+    public ImportedServiceDeclaration importedServices( Predicate<? super ImportedServiceAssembly> specification )
     {
         final List<ImportedServiceDeclaration> declarations = new ArrayList<>();
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/ModuleAssemblyImpl.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/ModuleAssemblyImpl.java b/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/ModuleAssemblyImpl.java
index eb038eb..7535b4d 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/ModuleAssemblyImpl.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/ModuleAssemblyImpl.java
@@ -22,6 +22,7 @@ import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.function.Predicate;
 import org.qi4j.api.activation.Activator;
 import org.qi4j.api.common.MetaInfo;
 import org.qi4j.api.common.Visibility;
@@ -51,7 +52,6 @@ import org.qi4j.bootstrap.TransientDeclaration;
 import org.qi4j.bootstrap.ValueAssembly;
 import org.qi4j.bootstrap.ValueDeclaration;
 import org.qi4j.functional.Iterables;
-import org.qi4j.functional.Specification;
 import org.qi4j.runtime.activation.ActivatorsModel;
 import org.qi4j.runtime.composite.TransientModel;
 import org.qi4j.runtime.composite.TransientsModel;
@@ -163,12 +163,12 @@ public final class ModuleAssemblyImpl
     }
 
     @Override
-    public ValueDeclaration values( Specification<? super ValueAssembly> specification )
+    public ValueDeclaration values( Predicate<? super ValueAssembly> specification )
     {
         List<ValueAssemblyImpl> assemblies = new ArrayList<>();
         for( ValueAssemblyImpl transientAssembly : valueAssemblies.values() )
         {
-            if( specification.satisfiedBy( transientAssembly ) )
+            if( specification.test( transientAssembly ) )
             {
                 assemblies.add( transientAssembly );
             }
@@ -201,12 +201,12 @@ public final class ModuleAssemblyImpl
     }
 
     @Override
-    public TransientDeclaration transients( Specification<? super TransientAssembly> specification )
+    public TransientDeclaration transients( Predicate<? super TransientAssembly> specification )
     {
         List<TransientAssemblyImpl> assemblies = new ArrayList<>();
         for( TransientAssemblyImpl transientAssembly : transientAssemblies.values() )
         {
-            if( specification.satisfiedBy( transientAssembly ) )
+            if( specification.test( transientAssembly ) )
             {
                 assemblies.add( transientAssembly );
             }
@@ -239,12 +239,12 @@ public final class ModuleAssemblyImpl
     }
 
     @Override
-    public EntityDeclaration entities( Specification<? super EntityAssembly> specification )
+    public EntityDeclaration entities( Predicate<? super EntityAssembly> specification )
     {
         List<EntityAssemblyImpl> assemblies = new ArrayList<>();
         for( EntityAssemblyImpl entityAssembly : entityAssemblies.values() )
         {
-            if( specification.satisfiedBy( entityAssembly ) )
+            if( specification.test( entityAssembly ) )
             {
                 assemblies.add( entityAssembly );
             }
@@ -281,12 +281,12 @@ public final class ModuleAssemblyImpl
     }
 
     @Override
-    public ObjectDeclaration objects( Specification<? super ObjectAssembly> specification )
+    public ObjectDeclaration objects( Predicate<? super ObjectAssembly> specification )
     {
         List<ObjectAssemblyImpl> assemblies = new ArrayList<>();
         for( ObjectAssemblyImpl objectAssembly : objectAssemblies.values() )
         {
-            if( specification.satisfiedBy( objectAssembly ) )
+            if( specification.test( objectAssembly ) )
             {
                 assemblies.add( objectAssembly );
             }
@@ -333,12 +333,12 @@ public final class ModuleAssemblyImpl
     }
 
     @Override
-    public ServiceDeclaration services( Specification<? super ServiceAssembly> specification )
+    public ServiceDeclaration services( Predicate<? super ServiceAssembly> specification )
     {
         List<ServiceAssemblyImpl> assemblies = new ArrayList<>();
         for( ServiceAssemblyImpl serviceAssembly : serviceAssemblies )
         {
-            if( specification.satisfiedBy( serviceAssembly ) )
+            if( specification.test( serviceAssembly ) )
             {
                 assemblies.add( serviceAssembly );
             }
@@ -370,12 +370,12 @@ public final class ModuleAssemblyImpl
     }
 
     @Override
-    public ImportedServiceDeclaration importedServices( Specification<? super ImportedServiceAssembly> specification )
+    public ImportedServiceDeclaration importedServices( Predicate<? super ImportedServiceAssembly> specification )
     {
         List<ImportedServiceAssemblyImpl> assemblies = new ArrayList<>();
         for( ImportedServiceAssemblyImpl objectAssembly : importedServiceAssemblies.values() )
         {
-            if( specification.satisfiedBy( objectAssembly ) )
+            if( specification.test( objectAssembly ) )
             {
                 assemblies.add( objectAssembly );
             }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/ServiceAssemblyImpl.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/ServiceAssemblyImpl.java b/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/ServiceAssemblyImpl.java
index 1adbfe6..ca7e4e6 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/ServiceAssemblyImpl.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/ServiceAssemblyImpl.java
@@ -17,6 +17,7 @@ package org.qi4j.runtime.bootstrap;
 import java.lang.reflect.Type;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.function.Function;
 import org.qi4j.api.activation.Activator;
 import org.qi4j.api.activation.Activators;
 import org.qi4j.api.common.InvalidApplicationException;
@@ -25,7 +26,6 @@ import org.qi4j.api.util.Annotations;
 import org.qi4j.api.util.Classes;
 import org.qi4j.bootstrap.ServiceAssembly;
 import org.qi4j.bootstrap.StateDeclarations;
-import org.qi4j.functional.Function;
 import org.qi4j.functional.Iterables;
 import org.qi4j.runtime.activation.ActivatorsModel;
 import org.qi4j.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-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/ValueAssemblyImpl.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/ValueAssemblyImpl.java b/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/ValueAssemblyImpl.java
index 605efa1..4c4b38b 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/ValueAssemblyImpl.java
+++ b/core/runtime/src/main/java/org/qi4j/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-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/composite/CompositeMethodModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/composite/CompositeMethodModel.java b/core/runtime/src/main/java/org/qi4j/runtime/composite/CompositeMethodModel.java
index e925b9d..a72f63d 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/composite/CompositeMethodModel.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/composite/CompositeMethodModel.java
@@ -216,7 +216,7 @@ public final class CompositeMethodModel
             try
             {
                 MixinModel model = mixins.mixinFor( method );
-                if( GenericSpecification.INSTANCE.satisfiedBy( model.mixinClass() ) )
+                if( GenericSpecification.INSTANCE.test( model.mixinClass() ) )
                 {
                     return false;
                 }
@@ -237,7 +237,7 @@ public final class CompositeMethodModel
             try
             {
                 MixinModel model = mixins.mixinFor( method );
-                if( !GenericSpecification.INSTANCE.satisfiedBy( model.mixinClass() ) )
+                if( !GenericSpecification.INSTANCE.test( model.mixinClass() ) )
                 {
                     T annotation = annotationClass.cast( model.mixinClass()
                                                              .getMethod( method.getName(), method.getParameterTypes() )
@@ -264,7 +264,7 @@ public final class CompositeMethodModel
             List<Annotation> annotations = new ArrayList<Annotation>();
             MixinModel model = mixins.mixinFor( method );
             Annotation[] mixinAnnotations = new Annotation[ 0 ];
-            if( !GenericSpecification.INSTANCE.satisfiedBy( model.mixinClass() ) )
+            if( !GenericSpecification.INSTANCE.test( model.mixinClass() ) )
             {
                 mixinAnnotations = model.mixinClass().getAnnotations();
                 annotations.addAll( Arrays.asList( mixinAnnotations ) );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/composite/ConstraintDeclaration.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/composite/ConstraintDeclaration.java b/core/runtime/src/main/java/org/qi4j/runtime/composite/ConstraintDeclaration.java
index 048c4ed..91a3b3b 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/composite/ConstraintDeclaration.java
+++ b/core/runtime/src/main/java/org/qi4j/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-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/composite/ConstructorsModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/composite/ConstructorsModel.java b/core/runtime/src/main/java/org/qi4j/runtime/composite/ConstructorsModel.java
index f482d3b..fd869d2 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/composite/ConstructorsModel.java
+++ b/core/runtime/src/main/java/org/qi4j/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.qi4j.api.common.ConstructionException;
 import org.qi4j.api.composite.CompositeDescriptor;
 import org.qi4j.api.composite.InvalidCompositeException;
@@ -32,7 +33,6 @@ import org.qi4j.api.injection.scope.Uses;
 import org.qi4j.api.util.Annotations;
 import org.qi4j.api.util.Classes;
 import org.qi4j.bootstrap.BindingException;
-import org.qi4j.functional.Function;
 import org.qi4j.functional.HierarchicalVisitor;
 import org.qi4j.functional.HierarchicalVisitorAdapter;
 import org.qi4j.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-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/composite/GenericSpecification.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/composite/GenericSpecification.java b/core/runtime/src/main/java/org/qi4j/runtime/composite/GenericSpecification.java
index bc0f612..3908381 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/composite/GenericSpecification.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/composite/GenericSpecification.java
@@ -1,18 +1,18 @@
 package org.qi4j.runtime.composite;
 
 import java.lang.reflect.InvocationHandler;
-import org.qi4j.functional.Specification;
+import java.util.function.Predicate;
 
 /**
  * Specification that checks whether a given class implements InvocationHandler or not.
  */
 public class GenericSpecification
-    implements Specification<Class<?>>
+    implements Predicate<Class<?>>
 {
     public static final GenericSpecification INSTANCE = new GenericSpecification();
 
     @Override
-    public boolean satisfiedBy( Class<?> item )
+    public boolean test( Class<?> item )
     {
         return InvocationHandler.class.isAssignableFrom( item );
     }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/composite/MixinsModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/composite/MixinsModel.java b/core/runtime/src/main/java/org/qi4j/runtime/composite/MixinsModel.java
index 8a4c349..eb5fe4f 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/composite/MixinsModel.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/composite/MixinsModel.java
@@ -23,12 +23,12 @@ import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.function.Function;
+import java.util.function.Predicate;
 import org.qi4j.api.util.Classes;
 import org.qi4j.bootstrap.BindingException;
-import org.qi4j.functional.Function;
 import org.qi4j.functional.HierarchicalVisitor;
 import org.qi4j.functional.HierarchicalVisitorAdapter;
-import org.qi4j.functional.Specification;
 import org.qi4j.functional.VisitableHierarchy;
 import org.qi4j.runtime.injection.DependencyModel;
 import org.qi4j.runtime.injection.InjectedFieldModel;
@@ -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,14 +206,14 @@ 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();
             }
-        }, filter( new Specification<Map.Entry<Method, MixinModel>>()
+        }, filter( new Predicate<Map.Entry<Method, MixinModel>>()
         {
             @Override
-            public boolean satisfiedBy( Map.Entry<Method, MixinModel> item )
+            public boolean test( Map.Entry<Method, MixinModel> item )
             {
                 MixinModel model = item.getValue();
                 return model.mixinClass().equals( mixinClass );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/composite/TransientInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/composite/TransientInstance.java b/core/runtime/src/main/java/org/qi4j/runtime/composite/TransientInstance.java
index 508acf0..bc402c9 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/composite/TransientInstance.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/composite/TransientInstance.java
@@ -142,7 +142,7 @@ public class TransientInstance
         {
             return false;
         }
-        TransientInstance other = (TransientInstance) Qi4j.FUNCTION_COMPOSITE_INSTANCE_OF.map( (Composite) o );
+        TransientInstance other = (TransientInstance) Qi4j.FUNCTION_COMPOSITE_INSTANCE_OF.apply( (Composite) o );
         if( other.mixins.length != mixins.length )
         {
             return false;

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/entity/EntityStateInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/entity/EntityStateInstance.java b/core/runtime/src/main/java/org/qi4j/runtime/entity/EntityStateInstance.java
index d44a3f9..0eaa783 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/entity/EntityStateInstance.java
+++ b/core/runtime/src/main/java/org/qi4j/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.qi4j.api.association.Association;
 import org.qi4j.api.association.AssociationDescriptor;
 import org.qi4j.api.association.AssociationStateHolder;
@@ -33,8 +35,6 @@ import org.qi4j.api.property.Property;
 import org.qi4j.api.property.PropertyDescriptor;
 import org.qi4j.api.unitofwork.UnitOfWork;
 import org.qi4j.api.util.Classes;
-import org.qi4j.functional.Function;
-import org.qi4j.functional.Function2;
 import org.qi4j.functional.Iterables;
 import org.qi4j.runtime.association.AssociationInstance;
 import org.qi4j.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-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/injection/Dependencies.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/injection/Dependencies.java b/core/runtime/src/main/java/org/qi4j/runtime/injection/Dependencies.java
index 39bc468..f2aa380 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/injection/Dependencies.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/injection/Dependencies.java
@@ -1,6 +1,6 @@
 package org.qi4j.runtime.injection;
 
-import org.qi4j.functional.Function;
+import java.util.function.Function;
 
 /**
  * TODO
@@ -10,7 +10,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-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/injection/DependencyModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/injection/DependencyModel.java b/core/runtime/src/main/java/org/qi4j/runtime/injection/DependencyModel.java
index 10eca0d..fd74e3d 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/injection/DependencyModel.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/injection/DependencyModel.java
@@ -19,14 +19,14 @@ 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 java.util.function.Predicate;
 import org.qi4j.api.common.ConstructionException;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.composite.DependencyDescriptor;
 import org.qi4j.bootstrap.BindingException;
 import org.qi4j.bootstrap.InvalidInjectionException;
-import org.qi4j.functional.Function;
 import org.qi4j.functional.Iterables;
-import org.qi4j.functional.Specification;
 import org.qi4j.functional.Visitable;
 import org.qi4j.functional.Visitor;
 import org.qi4j.runtime.injection.provider.InjectionProviderException;
@@ -384,7 +384,7 @@ public final class DependencyModel
     }
 
     public static class ScopeSpecification
-        implements Specification<DependencyModel>
+        implements Predicate<DependencyModel>
     {
         private final Class<? extends Annotation> scope;
 
@@ -394,7 +394,7 @@ public final class DependencyModel
         }
 
         @Override
-        public boolean satisfiedBy( DependencyModel model )
+        public boolean test( DependencyModel model )
         {
             return model.hasScope( scope );
         }
@@ -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-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/injection/InjectedFieldModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/injection/InjectedFieldModel.java b/core/runtime/src/main/java/org/qi4j/runtime/injection/InjectedFieldModel.java
index 6b35f2a..3cb46c6 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/injection/InjectedFieldModel.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/injection/InjectedFieldModel.java
@@ -19,12 +19,12 @@ import java.lang.reflect.Field;
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Proxy;
 import java.util.Collection;
+import java.util.function.Predicate;
 import org.qi4j.api.composite.InjectedFieldDescriptor;
 import org.qi4j.api.util.Classes;
 import org.qi4j.bootstrap.BindingException;
 import org.qi4j.bootstrap.InjectionException;
 import org.qi4j.functional.HierarchicalVisitor;
-import org.qi4j.functional.Specification;
 import org.qi4j.functional.VisitableHierarchy;
 import org.qi4j.runtime.composite.TransientInstance;
 import org.qi4j.runtime.model.Resolution;
@@ -129,9 +129,9 @@ public final class InjectedFieldModel
         return visitor.visitLeave( this );
     }
 
-    public Collection<DependencyModel> filter( Specification<DependencyModel> specification )
+    public Collection<DependencyModel> filter( Predicate<DependencyModel> specification )
     {
-        if( specification.satisfiedBy( dependencyModel ) )
+        if( specification.test( dependencyModel ) )
         {
             return singleton( dependencyModel );
         }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/injection/InjectedFieldsModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/injection/InjectedFieldsModel.java b/core/runtime/src/main/java/org/qi4j/runtime/injection/InjectedFieldsModel.java
index dce28f2..170ed6a 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/injection/InjectedFieldsModel.java
+++ b/core/runtime/src/main/java/org/qi4j/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.qi4j.api.injection.InjectionScope;
 import org.qi4j.api.util.Classes;
 import org.qi4j.api.util.Fields;
-import org.qi4j.functional.Function;
 import org.qi4j.functional.HierarchicalVisitor;
 import org.qi4j.functional.Iterables;
 import org.qi4j.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-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/injection/InjectedMethodsModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/injection/InjectedMethodsModel.java b/core/runtime/src/main/java/org/qi4j/runtime/injection/InjectedMethodsModel.java
index c40dc98..81b3cb2 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/injection/InjectedMethodsModel.java
+++ b/core/runtime/src/main/java/org/qi4j/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-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/injection/InjectedParametersModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/injection/InjectedParametersModel.java b/core/runtime/src/main/java/org/qi4j/runtime/injection/InjectedParametersModel.java
index 1230edb..986269d 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/injection/InjectedParametersModel.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/injection/InjectedParametersModel.java
@@ -17,9 +17,9 @@ package org.qi4j.runtime.injection;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
+import java.util.function.Predicate;
 import org.qi4j.api.composite.InjectedParametersDescriptor;
 import org.qi4j.functional.HierarchicalVisitor;
-import org.qi4j.functional.Specification;
 import org.qi4j.functional.VisitableHierarchy;
 
 /**
@@ -79,12 +79,12 @@ public final class InjectedParametersModel
         return visitor.visitLeave( this );
     }
 
-    public Collection<DependencyModel> filter( Specification<DependencyModel> specification )
+    public Collection<DependencyModel> filter( Predicate<DependencyModel> specification )
     {
         ArrayList<DependencyModel> result = new ArrayList<DependencyModel>();
         for( DependencyModel model : parameterDependencies )
         {
-            if( specification.satisfiedBy( model ) )
+            if( specification.test( model ) )
             {
                 result.add( model );
             }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/injection/provider/InvocationInjectionProviderFactory.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/injection/provider/InvocationInjectionProviderFactory.java b/core/runtime/src/main/java/org/qi4j/runtime/injection/provider/InvocationInjectionProviderFactory.java
index 8780b98..e5b75b9 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/injection/provider/InvocationInjectionProviderFactory.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/injection/provider/InvocationInjectionProviderFactory.java
@@ -25,7 +25,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 ) ||
@@ -57,7 +57,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-qi4j/blob/9479a63e/core/runtime/src/main/java/org/qi4j/runtime/injection/provider/ModifiesInjectionProviderFactory.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/injection/provider/ModifiesInjectionProviderFactory.java b/core/runtime/src/main/java/org/qi4j/runtime/injection/provider/ModifiesInjectionProviderFactory.java
index 2348f91..16fccca 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/injection/provider/ModifiesInjectionProviderFactory.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/injection/provider/ModifiesInjectionProviderFactory.java
@@ -21,7 +21,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();


[04/50] [abbrv] zest-qi4j git commit: Scheduler: use Awaitility in test instead of Thread.sleep

Posted by ni...@apache.org.
Scheduler: use Awaitility in test instead of Thread.sleep

Test now run closer to as fast as possible.
The @minutely test depend on the clock and can last ~0 to ~1 minute.


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/b49eca62
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/b49eca62
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/b49eca62

Branch: refs/heads/3.0
Commit: b49eca6201e702ebcdae810c45fe0bcba3a74773
Parents: 5968ab9
Author: Paul Merlin <pa...@nosphere.org>
Authored: Thu Feb 20 22:21:33 2014 +0100
Committer: Paul Merlin <pa...@nosphere.org>
Committed: Thu Feb 20 22:21:33 2014 +0100

----------------------------------------------------------------------
 libraries/scheduler/build.gradle                |   1 +
 .../qi4j/library/scheduler/SchedulerTest.java   | 152 +++++++++----------
 2 files changed, 76 insertions(+), 77 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b49eca62/libraries/scheduler/build.gradle
----------------------------------------------------------------------
diff --git a/libraries/scheduler/build.gradle b/libraries/scheduler/build.gradle
index 82d7ebb..eab2322 100644
--- a/libraries/scheduler/build.gradle
+++ b/libraries/scheduler/build.gradle
@@ -10,6 +10,7 @@ dependencies {
 
     testCompile project( ":org.qi4j.core:org.qi4j.core.testsupport" )
     testCompile project( ":org.qi4j.extensions:org.qi4j.extension.indexing-rdf" )
+    testCompile libraries.awaitility
 
     testRuntime project( ":org.qi4j.core:org.qi4j.core.runtime" )
     testRuntime libraries.logback

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b49eca62/libraries/scheduler/src/test/java/org/qi4j/library/scheduler/SchedulerTest.java
----------------------------------------------------------------------
diff --git a/libraries/scheduler/src/test/java/org/qi4j/library/scheduler/SchedulerTest.java b/libraries/scheduler/src/test/java/org/qi4j/library/scheduler/SchedulerTest.java
index e115e64..ac38d8e 100644
--- a/libraries/scheduler/src/test/java/org/qi4j/library/scheduler/SchedulerTest.java
+++ b/libraries/scheduler/src/test/java/org/qi4j/library/scheduler/SchedulerTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2012, Paul Merlin. All Rights Reserved.
+ * Copyright (c) 2010-2014, Paul Merlin. All Rights Reserved.
  * Copyright (c) 2012, Niclas Hedhman. All Rights Reserved.
  *
  * Licensed  under the  Apache License,  Version 2.0  (the "License");
@@ -18,6 +18,7 @@
  */
 package org.qi4j.library.scheduler;
 
+import java.util.concurrent.Callable;
 import org.joda.time.DateTime;
 import org.joda.time.Interval;
 import org.junit.Test;
@@ -28,14 +29,19 @@ import org.qi4j.api.usecase.Usecase;
 import org.qi4j.api.usecase.UsecaseBuilder;
 import org.qi4j.bootstrap.AssemblyException;
 import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.functional.Iterables;
 import org.qi4j.library.scheduler.bootstrap.SchedulerAssembler;
 import org.qi4j.library.scheduler.timeline.Timeline;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static com.jayway.awaitility.Awaitility.await;
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
+import static org.hamcrest.core.Is.is;
+import static org.hamcrest.core.IsEqual.equalTo;
+import static org.junit.Assert.assertThat;
+import static org.qi4j.functional.Iterables.count;
+import static org.qi4j.library.scheduler.Constants.BAR;
+import static org.qi4j.library.scheduler.Constants.BAZAR;
 
 public class SchedulerTest
     extends AbstractSchedulerTest
@@ -57,119 +63,111 @@ public class SchedulerTest
     }
 
     @Test
-    public void testTask()
-        throws UnitOfWorkCompletionException,
-               InterruptedException
+    public void testTaskWithoutScheduling()
+        throws UnitOfWorkCompletionException
     {
         Usecase usecase = UsecaseBuilder.newUsecase( "testTask" );
-        UnitOfWork uow = module.newUnitOfWork( usecase );
-        FooTask task = createFooTask( uow, "TestTask", Constants.BAZAR );
-
-        String taskId = task.identity().get();
-        task.run();
-        uow.complete();
-
-        usecase = UsecaseBuilder.newUsecase( "testTask" );
-        uow = module.newUnitOfWork( usecase );
-        task = uow.get( FooTask.class, taskId );
-        assertEquals( Constants.BAR, task.output().get() );
-
-        Thread.sleep( 10 * 1000 );
-        uow.complete();
+        String taskId;
+        try( UnitOfWork uow = module.newUnitOfWork( usecase ) )
+        {
+            FooTask task = createFooTask( uow, "TestTask", BAZAR );
+            taskId = task.identity().get();
+            task.run();
+            uow.complete();
+        }
+        try( UnitOfWork uow = module.newUnitOfWork( usecase ) )
+        {
+            FooTask task = uow.get( FooTask.class, taskId );
+            assertThat( task.output().get(), equalTo( BAR ) );
+        }
     }
 
     @Test
     public void testMinutely()
-        throws Exception
+        throws UnitOfWorkCompletionException
     {
-        Usecase usecase = UsecaseBuilder.newUsecase( "testMinutely" );
-        UnitOfWork uow = module.newUnitOfWork( usecase );
-        try
+        Usecase usecase = UsecaseBuilder.newUsecase( "TestMinutely" );
+        DateTime start = new DateTime();
+        String taskIdentity;
+        long sleepMillis;
+        try( UnitOfWork uow = module.newUnitOfWork( usecase ) )
         {
-            Scheduler scheduler = module.<Scheduler>findService( Scheduler.class ).get();
-            DateTime start = new DateTime();
+            Scheduler scheduler = module.findService( Scheduler.class ).get();
 
-            FooTask task = createFooTask( uow, "TestMinutely", Constants.BAZAR );
-            String taskIdentity = task.identity().get();
+            FooTask task = createFooTask( uow, usecase.name(), BAZAR );
+            taskIdentity = task.identity().get();
 
             DateTime expectedRun = start.withMillisOfSecond( 0 ).withSecondOfMinute( 0 ).plusMinutes( 1 );
             scheduler.scheduleCron( task, "@minutely", true );
 
             uow.complete();
 
+            sleepMillis = new Interval( start, expectedRun ).toDurationMillis();
             LOGGER.info( "Task scheduled on {} to be run at {}", start.getMillis(), expectedRun.getMillis() );
+        }
 
-            Thread.sleep( new Interval( start, expectedRun ).toDurationMillis() + 5000 ); // waiting a little more
-
-            usecase = UsecaseBuilder.newUsecase( "testMinutely" );
-            uow = module.newUnitOfWork( usecase );
-
-            task = uow.get( FooTask.class, taskIdentity );
-            assertNotNull( task );
-            assertEquals( Constants.BAR, task.output().get() );
+        await( usecase.name() ).
+            atMost( sleepMillis + 5000, MILLISECONDS ).
+            until( taskOutput( taskIdentity ), equalTo( BAR ) );
 
-            Timeline timeline = module.<Timeline>findService( Timeline.class ).get();
+        try( UnitOfWork uow = module.newUnitOfWork( usecase ) )
+        {
+            Timeline timeline = module.findService( Timeline.class ).get();
             DateTime now = new DateTime();
 
             // Queries returning past records
-            assertEquals( 2, Iterables.count( timeline.getLastRecords( 5 ) ) );
-            assertEquals( 2, Iterables.count( timeline.getRecords( start.getMillis(), now.getMillis() ) ) );
+            assertThat( count( timeline.getLastRecords( 5 ) ),
+                        is( 2L ) );
+            assertThat( count( timeline.getRecords( start.getMillis(), now.getMillis() ) ),
+                        is( 2L ) );
 
             // Queries returning future records
-            assertEquals( 4, Iterables.count( timeline.getNextRecords( 4 ) ) );
-            assertEquals( 5, Iterables.count( timeline.getRecords( now.getMillis() + 100,
-                                                                   now.plusMinutes( 5 ).getMillis() ) ) );
+            assertThat( count( timeline.getNextRecords( 4 ) ),
+                        is( 4L ) );
+            assertThat( count( timeline.getRecords( now.getMillis() + 100, now.plusMinutes( 5 ).getMillis() ) ),
+                        is( 5L ) );
 
             // Queries returning mixed past and future records
-            assertEquals( 7, Iterables.count( timeline.getRecords( start.getMillis(),
-                                                                   now.plusMinutes( 5 ).getMillis() ) ) );
-
-            uow.complete();
-        }
-        finally
-        {
-            if( uow.isOpen() )
-            {
-                uow.discard();
-            }
+            assertThat( count( timeline.getRecords( start.getMillis(), now.plusMinutes( 5 ).getMillis() ) ),
+                        is( 7L ) );
         }
     }
 
     @Test
     public void testOnce()
-        throws UnitOfWorkCompletionException,
-               InterruptedException
+        throws UnitOfWorkCompletionException
     {
-        Usecase usecase = UsecaseBuilder.newUsecase( "testOnce" );
-        UnitOfWork uow = module.newUnitOfWork( usecase );
-        try
+        final Usecase usecase = UsecaseBuilder.newUsecase( "TestOnce" );
+        final String taskIdentity;
+        try( UnitOfWork uow = module.newUnitOfWork( usecase ) )
         {
-            Scheduler scheduler = module.<Scheduler>findService( Scheduler.class ).get();
+            Scheduler scheduler = module.findService( Scheduler.class ).get();
 
-            FooTask task = createFooTask( uow, "TestOnce", Constants.BAZAR );
-            String taskIdentity = task.identity().get();
+            FooTask task = createFooTask( uow, usecase.name(), BAZAR );
+            taskIdentity = task.identity().get();
 
-            scheduler.scheduleOnce( task, 4, true );
+            scheduler.scheduleOnce( task, 2, true );
 
             uow.complete();
+        }
 
-            Thread.sleep( 5000 );
-
-            usecase = UsecaseBuilder.newUsecase( "testOnce" );
-            uow = module.newUnitOfWork( usecase );
-
-            task = uow.get( FooTask.class, taskIdentity );
-            assertNotNull( task );
-            assertEquals( Constants.BAR, task.output().get() );
+        await( usecase.name() ).until( taskOutput( taskIdentity ), equalTo( BAR ) );
+    }
 
-            uow.complete();
-        }
-        finally
+    private Callable<String> taskOutput( final String taskIdentity )
+    {
+        return new Callable<String>()
         {
-            if( uow.isOpen() )
+            @Override
+            public String call()
+                throws Exception
             {
-                uow.discard();
+                try( UnitOfWork uow = module.newUnitOfWork() )
+                {
+                    FooTask task = uow.get( FooTask.class, taskIdentity );
+                    return task == null ? null : task.output().get();
+                }
             }
-        }
+        };
     }
 }


[03/50] [abbrv] zest-qi4j git commit: CircuitBreaker: use Awaitility in test instead of Thread.sleep

Posted by ni...@apache.org.
CircuitBreaker: use Awaitility in test instead of Thread.sleep


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/5968ab9d
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/5968ab9d
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/5968ab9d

Branch: refs/heads/3.0
Commit: 5968ab9d9ee44ed02cfb2368975a1c7d7bf4c820
Parents: 1acd403
Author: Paul Merlin <pa...@nosphere.org>
Authored: Thu Feb 20 22:17:42 2014 +0100
Committer: Paul Merlin <pa...@nosphere.org>
Committed: Thu Feb 20 22:17:42 2014 +0100

----------------------------------------------------------------------
 libraries/circuitbreaker/build.gradle           | 14 ++++++------
 .../circuitbreaker/CircuitBreakerTest.java      | 24 +++++++++++++++-----
 2 files changed, 25 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/5968ab9d/libraries/circuitbreaker/build.gradle
----------------------------------------------------------------------
diff --git a/libraries/circuitbreaker/build.gradle b/libraries/circuitbreaker/build.gradle
index 597eaf6..8070a77 100644
--- a/libraries/circuitbreaker/build.gradle
+++ b/libraries/circuitbreaker/build.gradle
@@ -3,17 +3,17 @@ description = "Qi4j Circuit Breaker Library provides a framework for connecting
 jar { manifest {name = "Qi4j Library - Circuit Breaker"}}
 
 dependencies {
-  compile(project(":org.qi4j.core:org.qi4j.core.api"))
-  compile( project(':org.qi4j.libraries:org.qi4j.library.jmx' ) )
+    compile project( ':org.qi4j.core:org.qi4j.core.api' )
+    compile project( ':org.qi4j.libraries:org.qi4j.library.jmx' )
 
-  testCompile(project(":org.qi4j.core:org.qi4j.core.testsupport"))
+    testCompile project( ':org.qi4j.core:org.qi4j.core.testsupport' )
+    testCompile libraries.awaitility
 
-  testRuntime(project(":org.qi4j.core:org.qi4j.core.runtime"))
-  testRuntime(libraries.logback)
+    testRuntime project( ':org.qi4j.core:org.qi4j.core.runtime' )
+    testRuntime libraries.logback
 }
 
-task(runSample, dependsOn: 'testClasses', type: JavaExec) {
+task( runSample, dependsOn: 'testClasses', type: JavaExec ) {
     main = 'org.qi4j.library.circuitbreaker.jmx.CircuitBreakerManagementTest'
     classpath = sourceSets.test.runtimeClasspath
 }
-

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/5968ab9d/libraries/circuitbreaker/src/test/java/org/qi4j/library/circuitbreaker/CircuitBreakerTest.java
----------------------------------------------------------------------
diff --git a/libraries/circuitbreaker/src/test/java/org/qi4j/library/circuitbreaker/CircuitBreakerTest.java b/libraries/circuitbreaker/src/test/java/org/qi4j/library/circuitbreaker/CircuitBreakerTest.java
index 6977451..783237f 100644
--- a/libraries/circuitbreaker/src/test/java/org/qi4j/library/circuitbreaker/CircuitBreakerTest.java
+++ b/libraries/circuitbreaker/src/test/java/org/qi4j/library/circuitbreaker/CircuitBreakerTest.java
@@ -20,10 +20,14 @@ import java.beans.PropertyChangeListener;
 import java.beans.PropertyVetoException;
 import java.beans.VetoableChangeListener;
 import java.io.IOException;
+import java.util.concurrent.Callable;
 import org.hamcrest.CoreMatchers;
 import org.junit.Before;
 import org.junit.Test;
 
+import static com.jayway.awaitility.Awaitility.await;
+import static com.jayway.awaitility.Duration.FIVE_HUNDRED_MILLISECONDS;
+import static org.hamcrest.core.Is.is;
 import static org.junit.Assert.assertThat;
 
 /**
@@ -126,12 +130,8 @@ public class CircuitBreakerTest
 
         // END SNIPPET: direct
         assertThat( cb.status(), CoreMatchers.equalTo( CircuitBreaker.Status.off ) );
-        try {
-            System.out.println( "Wait..." );
-            Thread.sleep( 300 );
-        } catch ( InterruptedException e ) {
-            // Ignore
-        }
+        System.out.println( "Wait..." );
+        await().atMost( FIVE_HUNDRED_MILLISECONDS ).until( circuitBreakerStatus(), is( CircuitBreaker.Status.on ) );
 
         // START SNIPPET: direct
         // CircuitBreaker is back on
@@ -139,6 +139,18 @@ public class CircuitBreakerTest
         // END SNIPPET: direct
         assertThat( cb.status(), CoreMatchers.equalTo( CircuitBreaker.Status.on ) );
     }
+    
+    private Callable<CircuitBreaker.Status> circuitBreakerStatus()
+    {
+        return new Callable<CircuitBreaker.Status>()
+        {
+            @Override
+            public CircuitBreaker.Status call() throws Exception
+            {
+                return cb.status();
+            }
+        };
+    }
 
     @Test
     public void GivenCBWhenExceptionsAndSuccessesThenStatusIsOn()


[23/50] [abbrv] zest-qi4j git commit: Removed Function, Function2 and Specification and replaced with the equivalents in JDK, Function, BiFunction and Predicate.

Posted by ni...@apache.org.
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 ) ) );
     }
 


[33/50] [abbrv] zest-qi4j git commit: Replaced Joda Time with Java 8 Time API.

Posted by ni...@apache.org.
http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/booking/CargoListPage.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/booking/CargoListPage.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/booking/CargoListPage.java
index 4962a0f..2b5ae33 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/booking/CargoListPage.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/booking/CargoListPage.java
@@ -17,6 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_a.communication.web.booking;
 
+import java.time.ZonedDateTime;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -70,10 +71,10 @@ public class CargoListPage extends BookingBasePage
 
                 item.add( new Label( "destination", cargo.routeSpecification().get().destination().get().getCode() ) );
 
-                item.add( new Label( "deadline", new Model<Date>( cargo.routeSpecification()
-                                                                      .get()
-                                                                      .arrivalDeadline()
-                                                                      .get() ) ) );
+                ZonedDateTime arrivalDeadline = cargo.routeSpecification().get().arrivalDeadline().get();
+                item.add( new Label( "deadline", new Model<Date>( new Date( arrivalDeadline.plusDays( 1 )
+                                                                                .toInstant()
+                                                                                .toEpochMilli() ) ) ) );
 
                 item.add( new Label( "routingStatus", routingStatus.toString() ).add( new ErrorColor( routingStatus == RoutingStatus.MISROUTED ) ) );
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/booking/RoutePanel.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/booking/RoutePanel.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/booking/RoutePanel.java
index 83fd9bd..0ab7478 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/booking/RoutePanel.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/booking/RoutePanel.java
@@ -73,11 +73,13 @@ public class RoutePanel extends Panel
             protected void populateItem( ListItem<Leg> item )
             {
                 Leg leg = item.getModelObject();
+                Date loadTime = new Date( leg.loadTime().get().toInstant().toEpochMilli() );
+                Date unloadTime = new Date( leg.unloadTime().get().toInstant().toEpochMilli() );
                 item.add( new Label( "voyage", leg.voyage().get().toString() ),
                           new Label( "loadLocation", leg.loadLocation().get().getCode() ),
-                          new Label( "loadTime", new Model<Date>( leg.loadTime().get() ) ),
+                          new Label( "loadTime", new Model<Date>( loadTime ) ),
                           new Label( "unloadLocation", leg.unloadLocation().get().getCode() ),
-                          new Label( "unloadTime", new Model<Date>( leg.unloadTime().get() ) )
+                          new Label( "unloadTime", new Model<Date>( unloadTime ) )
                 );
             }
         } );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/handling/RegisterHandlingEventPage.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/handling/RegisterHandlingEventPage.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/handling/RegisterHandlingEventPage.java
index cd0a242..f98ec0b 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/handling/RegisterHandlingEventPage.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/handling/RegisterHandlingEventPage.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_a.communication.web.handling;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.ajax.markup.html.form.AjaxFallbackButton;
 import org.apache.wicket.markup.html.form.Form;
@@ -25,7 +25,6 @@ import org.apache.wicket.markup.html.panel.FeedbackPanel;
 import org.apache.wicket.model.Model;
 import org.apache.wicket.model.StringResourceModel;
 import org.apache.wicket.util.value.ValueMap;
-import org.joda.time.LocalDate;
 import org.qi4j.sample.dcicargo.sample_a.communication.query.CommonQueries;
 import org.qi4j.sample.dcicargo.sample_a.communication.query.HandlingQueries;
 import org.qi4j.sample.dcicargo.sample_a.communication.web.BasePage;
@@ -56,7 +55,7 @@ public class RegisterHandlingEventPage extends BasePage
     private final class RegisterHandlingEventForm extends AbstractForm<Void>
     {
         // Set by Wicket property resolvers:
-        private Date completion;
+        private ZonedDateTime completion;
         private String trackingId, unLocode, voyageNumber, eventType;
 
         private String lastSubmittedData;
@@ -67,7 +66,7 @@ public class RegisterHandlingEventPage extends BasePage
             add( feedback.setOutputMarkupId( true ) );
 
             final DateTextFieldWithPicker completionDateInput = new DateTextFieldWithPicker( "completion", "Completion", this );
-            completionDateInput.earliestDate( new LocalDate() );
+            completionDateInput.earliestDate( ZonedDateTime.now() );
 
             HandlingQueries fetch = new HandlingQueries();
             add( completionDateInput.setLabel( Model.of( "Completion" ) ) );
@@ -91,7 +90,7 @@ public class RegisterHandlingEventPage extends BasePage
 
                         // Perform use case
                         new RegisterHandlingEvent(
-                            new Date(), completion, trackingId, eventType, unLocode, voyageNumber ).register();
+                            ZonedDateTime.now(), completion, trackingId, eventType, unLocode, voyageNumber ).register();
 
                         // We could redirect to Details, but it's more fun to update details in a separate
                         // window to follow the successive handling event registrations you make...

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/tracking/HandlingHistoryPanel.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/tracking/HandlingHistoryPanel.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/tracking/HandlingHistoryPanel.java
index 85e01f7..5e0d911 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/tracking/HandlingHistoryPanel.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/tracking/HandlingHistoryPanel.java
@@ -17,6 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_a.communication.web.tracking;
 
+import java.time.ZoneOffset;
 import java.util.Date;
 import java.util.List;
 import org.apache.wicket.behavior.AttributeAppender;
@@ -63,7 +64,8 @@ public class HandlingHistoryPanel extends Panel
                 item.add( new WebMarkupContainer( "onTrackIcon" ).add( new AttributeAppender( "src", iconName, "" ) ) );
 
                 // Date
-                item.add( new Label( "completion", new Model<Date>( event.completionTime().get() ) ) );
+                Date completeTime = new Date( event.completionTime().get().toInstant().toEpochMilli() );
+                item.add( new Label( "completion", new Model<Date>( completeTime ) ) );
 
                 // Event description (data substitution in strings from HandlingHistoryPanel.properties)
                 ValueMap map = new ValueMap();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/tracking/TrackCargoPage.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/tracking/TrackCargoPage.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/tracking/TrackCargoPage.java
index a8b4bcc..79719d5 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/tracking/TrackCargoPage.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/communication/web/tracking/TrackCargoPage.java
@@ -17,8 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_a.communication.web.tracking;
 
-import java.text.SimpleDateFormat;
-import java.util.Date;
+import java.time.ZonedDateTime;
 import java.util.List;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
@@ -166,10 +165,9 @@ public class TrackCargoPage extends BasePage
 
                 // ETA ----------------------------------------------------------------------
                 String destination = cargo.routeSpecification().get().destination().get().getString();
-                Date eta = cargo.delivery().get().eta().get();
-                String etaString = eta == null ? "?" : new SimpleDateFormat( "yyyy-MM-dd" ).format( eta );
+                ZonedDateTime eta = cargo.delivery().get().eta().get();
                 add( new Label( "eta", new StringResourceModel(
-                    "eta", this, null, Model.of( destination ), Model.of( etaString ) ) ) );
+                    "eta", this, null, Model.of( destination ), Model.of( eta.toString() ) ) ) );
 
                 // Warning/Notifier ----------------------------------------------------------------------
                 add( new WebMarkupContainer( "isMisdirected" ).setVisible( cargo.delivery()

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/shipping/booking/BookNewCargo.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/shipping/booking/BookNewCargo.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/shipping/booking/BookNewCargo.java
index bf86b64..37f2a7a 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/shipping/booking/BookNewCargo.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/shipping/booking/BookNewCargo.java
@@ -17,9 +17,9 @@
  */
 package org.qi4j.sample.dcicargo.sample_a.context.shipping.booking;
 
-import java.util.Date;
+import java.time.LocalTime;
+import java.time.ZonedDateTime;
 import java.util.List;
-import org.joda.time.DateMidnight;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.injection.scope.Service;
 import org.qi4j.api.injection.scope.This;
@@ -55,7 +55,7 @@ public class BookNewCargo extends Context
     // Methodless Roles
     private Location origin;
     private Location destination;
-    private Date arrivalDeadline;
+    private ZonedDateTime arrivalDeadline;
     private Itinerary itinerary;
 
     // CONTEXT CONSTRUCTORS ------------------------------------------------------
@@ -63,7 +63,7 @@ public class BookNewCargo extends Context
     public BookNewCargo( Cargos cargos,
                          Location origin,
                          Location destination,
-                         Date arrivalDeadline
+                         ZonedDateTime arrivalDeadline
     )
         throws Exception
     {
@@ -86,7 +86,7 @@ public class BookNewCargo extends Context
 
     // Constructor proxies for communication layer
 
-    public BookNewCargo( String originId, String destinationId, Date deadline )
+    public BookNewCargo( String originId, String destinationId, ZonedDateTime deadline )
         throws Exception
     {
         this( loadEntity( CargosEntity.class, CargosEntity.CARGOS_ID ),
@@ -135,7 +135,7 @@ public class BookNewCargo extends Context
 
     // METHODFUL ROLE IMPLEMENTATIONS --------------------------------------------
 
-    @Mixins( CargoFactoryRole.Mixin.class )
+    @Mixins(CargoFactoryRole.Mixin.class)
     public interface CargoFactoryRole
     {
         void setContext( BookNewCargo context );
@@ -166,7 +166,7 @@ public class BookNewCargo extends Context
         }
     }
 
-    @Mixins( RoutingFacadeRole.Mixin.class )
+    @Mixins(RoutingFacadeRole.Mixin.class)
     public interface RoutingFacadeRole
     {
         void setContext( BookNewCargo context );
@@ -212,7 +212,7 @@ public class BookNewCargo extends Context
             public void changeDestination( Location newDestination )
             {
                 Location currentOrigin = cargo.routeSpecification().get().origin().get();
-                Date currentDeadline = cargo.routeSpecification().get().arrivalDeadline().get();
+                ZonedDateTime currentDeadline = cargo.routeSpecification().get().arrivalDeadline().get();
 
                 RouteSpecification newRouteSpecification =
                     context.buildRouteSpecification( vbf, currentOrigin, newDestination, currentDeadline );
@@ -226,7 +226,7 @@ public class BookNewCargo extends Context
     }
 
     public RouteSpecification buildRouteSpecification(
-        ValueBuilderFactory vbf, Location origin, Location destination, Date deadline
+        ValueBuilderFactory vbf, Location origin, Location destination, ZonedDateTime deadline
     )
     {
         if( origin == destination )
@@ -239,12 +239,9 @@ public class BookNewCargo extends Context
             throw new RouteException( "Arrival deadline cannot be null." );
         }
 
-        Date endOfToday = new DateMidnight().plusDays( 1 ).toDate();
-        if( deadline.before( endOfToday ) )
+        if( deadline.isBefore( ZonedDateTime.now().plusDays( 1 ).with( LocalTime.MIDNIGHT ) ) )
         {
-            throw new RouteException( "Arrival deadline is in the past or Today." +
-                                        "\nDeadline           " + deadline +
-                                        "\nToday (midnight)   " + endOfToday );
+            throw new RouteException( "Arrival deadline is in the past or Today: " + deadline );
         }
 
         ValueBuilder<RouteSpecification> routeSpec = vbf.newValueBuilder( RouteSpecification.class );

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/shipping/booking/BuildDeliverySnapshot.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/shipping/booking/BuildDeliverySnapshot.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/shipping/booking/BuildDeliverySnapshot.java
index 54741b6..e9a5c57 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/shipping/booking/BuildDeliverySnapshot.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/shipping/booking/BuildDeliverySnapshot.java
@@ -17,7 +17,8 @@
  */
 package org.qi4j.sample.dcicargo.sample_a.context.shipping.booking;
 
-import java.util.Date;
+import java.time.Instant;
+import java.time.ZonedDateTime;
 import java.util.Iterator;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.mixin.Mixins;
@@ -80,11 +81,10 @@ public class BuildDeliverySnapshot extends Context
         }
 
         // Deviation 2b
-        if( routeSpecification.arrivalDeadline().get().before( new Date() ) )
+        ZonedDateTime deadline = routeSpecification.arrivalDeadline().get();
+        if( deadline.isBefore( ZonedDateTime.now() ) )
         {
-            throw new RouteException( "Arrival deadline is in the past or Today." +
-                                        "\nDeadline " + routeSpecification.arrivalDeadline().get() +
-                                        "\nToday    " + new Date() );
+            throw new RouteException( "Arrival deadline is in the past or Today: " + deadline );
         }
 
         factory = rolePlayer( FactoryRole.class, routeSpecification );
@@ -121,7 +121,7 @@ public class BuildDeliverySnapshot extends Context
      * When the Cargo has a delivery history the FactoryRole delegates to the LastHandlingEventRole
      * to derive data from the last HandlingEvent.
      */
-    @Mixins( FactoryRole.Mixin.class )
+    @Mixins(FactoryRole.Mixin.class)
     public interface FactoryRole
     {
         void setContext( BuildDeliverySnapshot context );
@@ -155,7 +155,7 @@ public class BuildDeliverySnapshot extends Context
                 // Build delivery snapshot object
                 deliveryBuilder = vbf.newValueBuilder( Delivery.class );
                 context.newDeliverySnapshot = deliveryBuilder.prototype();
-                context.newDeliverySnapshot.timestamp().set( new Date() );
+                context.newDeliverySnapshot.timestamp().set( Instant.now() );
 
                 // Deviation 2c: Cargo is not routed yet
                 if( context.itinerary == null )
@@ -232,7 +232,7 @@ public class BuildDeliverySnapshot extends Context
      *
      * The HandlingEventRole uses the ItineraryRole heavily to calculate values based on Itinerary data.
      */
-    @Mixins( HandlingEventRole.Mixin.class )
+    @Mixins(HandlingEventRole.Mixin.class)
     public interface HandlingEventRole
     {
         void setContext( BuildDeliverySnapshot context );
@@ -412,12 +412,12 @@ public class BuildDeliverySnapshot extends Context
     /**
      * The ItineraryRole supports the HandlingEventRole with calculated results derived from Itinerary Legs.
      */
-    @Mixins( ItineraryRole.Mixin.class )
+    @Mixins(ItineraryRole.Mixin.class)
     public interface ItineraryRole
     {
         void setContext( BuildDeliverySnapshot context );
 
-        Date eta();
+        ZonedDateTime eta();
 
         boolean expectsOrigin( Location location );
 
@@ -440,7 +440,7 @@ public class BuildDeliverySnapshot extends Context
             @This
             Itinerary itinerary;
 
-            public Date eta()
+            public ZonedDateTime eta()
             {
                 return itinerary.lastLeg().unloadTime().get();
             }
@@ -490,8 +490,8 @@ public class BuildDeliverySnapshot extends Context
             {
                 // After RECEIVE, expect LOAD location and voyage of first itinerary leg
                 final Leg firstLeg = itinerary.legs().get().iterator().next();
-                return buildEvent( HandlingEventType.LOAD, firstLeg.loadLocation().get(), firstLeg.loadTime()
-                    .get(), firstLeg.voyage().get() );
+                return buildEvent( HandlingEventType.LOAD, firstLeg.loadLocation().get(),
+                                   firstLeg.loadTime().get(), firstLeg.voyage().get() );
             }
 
             public ExpectedHandlingEvent expectedEventAfterLoadAt( Location lastLoadLocation )
@@ -542,7 +542,7 @@ public class BuildDeliverySnapshot extends Context
 
             private ExpectedHandlingEvent buildEvent( HandlingEventType eventType,
                                                       Location location,
-                                                      Date time,
+                                                      ZonedDateTime time,
                                                       Voyage voyage
             )
             {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/shipping/handling/RegisterHandlingEvent.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/shipping/handling/RegisterHandlingEvent.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/shipping/handling/RegisterHandlingEvent.java
index 64665d7..effcb6f 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/shipping/handling/RegisterHandlingEvent.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/shipping/handling/RegisterHandlingEvent.java
@@ -17,8 +17,8 @@
  */
 package org.qi4j.sample.dcicargo.sample_a.context.shipping.handling;
 
+import java.time.ZonedDateTime;
 import java.util.Arrays;
-import java.util.Date;
 import org.qi4j.api.injection.scope.Service;
 import org.qi4j.api.injection.scope.This;
 import org.qi4j.api.mixin.Mixins;
@@ -51,8 +51,8 @@ public class RegisterHandlingEvent extends Context
 
     private HandlingEventFactoryRole handlingEventFactory;
 
-    private Date registrationTime;
-    private Date completionTime;
+    private ZonedDateTime registrationTime;
+    private ZonedDateTime completionTime;
     private String trackingIdString;
     private String eventTypeString;
     private String unLocodeString;
@@ -60,8 +60,8 @@ public class RegisterHandlingEvent extends Context
 
     // CONTEXT CONSTRUCTORS ------------------------------------------------------
 
-    public RegisterHandlingEvent( Date registrationTime,
-                                  Date completionTime,
+    public RegisterHandlingEvent( ZonedDateTime registrationTime,
+                                  ZonedDateTime completionTime,
                                   String trackingIdString,
                                   String eventTypeString,
                                   String unLocodeString,

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/support/ApplicationEvents.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/support/ApplicationEvents.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/support/ApplicationEvents.java
index eb951fa..6b49074 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/support/ApplicationEvents.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/support/ApplicationEvents.java
@@ -18,7 +18,6 @@
 package org.qi4j.sample.dcicargo.sample_a.context.support;
 
 import java.text.SimpleDateFormat;
-import java.util.Date;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.service.ServiceComposite;
 import org.qi4j.sample.dcicargo.sample_a.data.shipping.cargo.Cargo;
@@ -83,7 +82,7 @@ public interface ApplicationEvents
         public void cargoWasHandled( HandlingEvent registeredHandlingEvent )
         {
             id = registeredHandlingEvent.trackingId().get().id().get();
-            time = parseDate( registeredHandlingEvent.completionTime().get() );
+            time = registeredHandlingEvent.completionTime().get().toString();
             type = registeredHandlingEvent.handlingEventType().get().name();
             unloc = registeredHandlingEvent.location().get().getCode();
             loc = registeredHandlingEvent.location().get().name().get();
@@ -119,7 +118,7 @@ public interface ApplicationEvents
 
         public void receivedHandlingEventRegistrationAttempt( RegisterHandlingEventAttemptDTO attempt )
         {
-            time = parseDate( attempt.completionTime().get() );
+            time = attempt.completionTime().get().toString();
             id = parse( attempt.trackingIdString().get() );
             type = parse( attempt.eventTypeString().get() );
             unloc = parse( attempt.unLocodeString().get() );
@@ -144,9 +143,5 @@ public interface ApplicationEvents
             return str == null ? "null" : str;
         }
 
-        private String parseDate( Date date )
-        {
-            return date == null ? "null" : new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" ).format( date );
-        }
     }
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/support/FoundNoRoutesException.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/support/FoundNoRoutesException.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/support/FoundNoRoutesException.java
index fde107a..ba2c595 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/support/FoundNoRoutesException.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/support/FoundNoRoutesException.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_a.context.support;
 
-import org.joda.time.LocalDate;
+import java.time.ZonedDateTime;
 
 /**
  * Custom messages when the deadline is too close and we can't find a route.
@@ -25,9 +25,9 @@ import org.joda.time.LocalDate;
 public class FoundNoRoutesException extends Exception
 {
     private final String city;
-    private final LocalDate deadline;
+    private final ZonedDateTime deadline;
 
-    public FoundNoRoutesException( String city, LocalDate deadline )
+    public FoundNoRoutesException( String city, ZonedDateTime deadline )
     {
         this.city = city;
         this.deadline = deadline;
@@ -36,17 +36,17 @@ public class FoundNoRoutesException extends Exception
     @Override
     public String getMessage()
     {
-        if( deadline.isBefore( new LocalDate().plusDays( 2 ) ) )
+        if( deadline.isBefore( ZonedDateTime.now().plusDays( 2 ) ) )
         {
             return "Impossible to get the cargo to " + city + " before " + deadline
                    + "! Make a new booking with a deadline 2-3 weeks ahead in time.";
         }
-        else if( deadline.isBefore( new LocalDate().plusDays( 4 ) ) )
+        else if( deadline.isBefore( ZonedDateTime.now().plusDays( 4 ) ) )
         {
             return "Couldn't find any routes arriving in " + city + " before " + deadline
                    + ". Please try again or make a new booking with a deadline 2-3 weeks ahead in time.";
         }
-        else if( deadline.isBefore( new LocalDate().plusDays( 6 ) ) )
+        else if( deadline.isBefore( ZonedDateTime.now().plusDays( 6 ) ) )
         {
             return "Sorry, our system couldn't immediately find a route arriving in " + city + " before " + deadline
                    + ". Please try again, and we should hopefully be able to find a new route for you.";

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/support/RegisterHandlingEventAttemptDTO.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/support/RegisterHandlingEventAttemptDTO.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/support/RegisterHandlingEventAttemptDTO.java
index c37930b..90c4869 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/support/RegisterHandlingEventAttemptDTO.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/support/RegisterHandlingEventAttemptDTO.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_a.context.support;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.property.Immutable;
 import org.qi4j.api.property.Property;
@@ -30,10 +30,10 @@ import org.qi4j.sample.dcicargo.sample_a.infrastructure.conversion.DTO;
 public interface RegisterHandlingEventAttemptDTO extends DTO
 {
     @Optional
-    Property<Date> registrationTime();
+    Property<ZonedDateTime> registrationTime();
 
     @Optional
-    Property<Date> completionTime();
+    Property<ZonedDateTime> completionTime();
 
     @Optional
     Property<String> trackingIdString();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/support/RoutingService.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/support/RoutingService.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/support/RoutingService.java
index 694322c..09dcc4f 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/support/RoutingService.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/context/support/RoutingService.java
@@ -21,7 +21,6 @@ import java.rmi.RemoteException;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
-import org.joda.time.LocalDate;
 import org.qi4j.api.injection.scope.Service;
 import org.qi4j.api.injection.scope.Structure;
 import org.qi4j.api.mixin.Mixins;
@@ -117,7 +116,7 @@ public interface RoutingService
             if( itineraries.size() == 0 )
             {
                 throw new FoundNoRoutesException( destination.name().get(),
-                                                  new LocalDate( routeSpecification.arrivalDeadline().get() ) );
+                                                  routeSpecification.arrivalDeadline().get() );
             }
 
             return itineraries;

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/cargo/RouteSpecification.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/cargo/RouteSpecification.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/cargo/RouteSpecification.java
index 582d633..d5ead11 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/cargo/RouteSpecification.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/cargo/RouteSpecification.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_a.data.shipping.cargo;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.property.Property;
@@ -51,7 +51,7 @@ public interface RouteSpecification
 
     Association<Location> destination();
 
-    Property<Date> arrivalDeadline();
+    Property<ZonedDateTime> arrivalDeadline();
 
     // Can we accept to have this "intelligent" logic here?
     // DCI Data is supposed to be dumb, but it's really convenient to have this logic here,
@@ -67,7 +67,7 @@ public interface RouteSpecification
                    !itinerary.legs().get().isEmpty() &&
                    origin().get().equals( itinerary.firstLeg().loadLocation().get() ) &&
                    destination().get().equals( itinerary.lastLeg().unloadLocation().get() ) &&
-                   arrivalDeadline().get().after( itinerary.finalArrivalDate() );
+                   arrivalDeadline().get().isAfter( itinerary.finalArrivalDate() );
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/delivery/Delivery.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/delivery/Delivery.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/delivery/Delivery.java
index 4d46fbe..af7555a 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/delivery/Delivery.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/delivery/Delivery.java
@@ -17,7 +17,8 @@
  */
 package org.qi4j.sample.dcicargo.sample_a.data.shipping.delivery;
 
-import java.util.Date;
+import java.time.Instant;
+import java.time.ZonedDateTime;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.common.UseDefaults;
@@ -76,7 +77,7 @@ import org.qi4j.sample.dcicargo.sample_a.data.shipping.voyage.Voyage;
 public interface Delivery
     extends ValueComposite
 {
-    Property<Date> timestamp();
+    Property<Instant> timestamp();
 
     /*
    * NOT_ROUTED
@@ -120,7 +121,7 @@ public interface Delivery
     Association<Voyage> currentVoyage();
 
     @Optional
-    Property<Date> eta();
+    Property<ZonedDateTime> eta();
 
     @UseDefaults
     Property<Boolean> isUnloadedAtDestination();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/delivery/ExpectedHandlingEvent.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/delivery/ExpectedHandlingEvent.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/delivery/ExpectedHandlingEvent.java
index 194ea24..bb44e01 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/delivery/ExpectedHandlingEvent.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/delivery/ExpectedHandlingEvent.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_a.data.shipping.delivery;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.property.Property;
@@ -39,7 +39,7 @@ public interface ExpectedHandlingEvent
 
     // Added expected time for the event to happen (compared to the original DDD sample)
     @Optional
-    Property<Date> time();
+    Property<ZonedDateTime> time();
 
     @Optional
     Association<Voyage> voyage();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/handling/HandlingEvent.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/handling/HandlingEvent.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/handling/HandlingEvent.java
index c256201..da19296 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/handling/HandlingEvent.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/handling/HandlingEvent.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_a.data.shipping.handling;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.common.UseDefaults;
@@ -47,10 +47,10 @@ import org.qi4j.sample.dcicargo.sample_a.data.shipping.voyage.Voyage;
 public interface HandlingEvent
 {
     @Immutable
-    Property<Date> registrationTime();
+    Property<ZonedDateTime> registrationTime();
 
     @Immutable
-    Property<Date> completionTime();
+    Property<ZonedDateTime> completionTime();
 
     @Immutable
     Property<TrackingId> trackingId();

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/handling/HandlingEvents.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/handling/HandlingEvents.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/handling/HandlingEvents.java
index d267b3f..c4a3296 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/handling/HandlingEvents.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/handling/HandlingEvents.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_a.data.shipping.handling;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.qi4j.api.common.Optional;
 import org.qi4j.api.entity.EntityBuilder;
 import org.qi4j.api.injection.scope.Structure;
@@ -32,11 +32,11 @@ import org.qi4j.sample.dcicargo.sample_a.data.shipping.voyage.Voyage;
  * HandlingEvent "collection" - could have had a many-association to
  * Handling Events if it was part of the domain model.
  */
-@Mixins( HandlingEvents.Mixin.class )
+@Mixins(HandlingEvents.Mixin.class)
 public interface HandlingEvents
 {
-    HandlingEvent createHandlingEvent( Date registrationTime,
-                                       Date completionTime,
+    HandlingEvent createHandlingEvent( ZonedDateTime registrationTime,
+                                       ZonedDateTime completionTime,
                                        TrackingId trackingId,
                                        HandlingEventType handlingEventType,
                                        Location location,
@@ -50,8 +50,8 @@ public interface HandlingEvents
         @Structure
         UnitOfWorkFactory uowf;
 
-        public HandlingEvent createHandlingEvent( Date registrationTime,
-                                                  Date completionTime,
+        public HandlingEvent createHandlingEvent( ZonedDateTime registrationTime,
+                                                  ZonedDateTime completionTime,
                                                   TrackingId trackingId,
                                                   HandlingEventType handlingEventType,
                                                   Location location,

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/itinerary/Itinerary.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/itinerary/Itinerary.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/itinerary/Itinerary.java
index 329cc7a..f3e3749 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/itinerary/Itinerary.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/itinerary/Itinerary.java
@@ -17,10 +17,10 @@
  */
 package org.qi4j.sample.dcicargo.sample_a.data.shipping.itinerary;
 
-import java.util.Date;
+import java.time.LocalDate;
+import java.time.ZonedDateTime;
+import java.time.temporal.ChronoUnit;
 import java.util.List;
-import org.joda.time.Days;
-import org.joda.time.LocalDate;
 import org.qi4j.api.mixin.Mixins;
 import org.qi4j.api.property.Property;
 import org.qi4j.library.constraints.annotation.NotEmpty;
@@ -33,7 +33,7 @@ import org.qi4j.library.constraints.annotation.NotEmpty;
  *
  * List of legs is mandatory and immutable.
  */
-@Mixins( Itinerary.Mixin.class )
+@Mixins(Itinerary.Mixin.class)
 public interface Itinerary
 {
     @NotEmpty
@@ -44,7 +44,7 @@ public interface Itinerary
 
     Leg lastLeg();
 
-    Date finalArrivalDate();
+    ZonedDateTime finalArrivalDate();
 
     int days();
 
@@ -71,21 +71,21 @@ public interface Itinerary
             return legs().get().get( legs().get().size() - 1 );
         }
 
-        public Date finalArrivalDate()
+        public ZonedDateTime finalArrivalDate()
         {
             if( lastLeg() == null )
             {
-                return new Date( new Date( Long.MAX_VALUE ).getTime() );
+                return ZonedDateTime.from( LocalDate.MAX );
             }
 
-            return new Date( lastLeg().unloadTime().get().getTime() );
+            return lastLeg().unloadTime().get();
         }
 
         public int days()
         {
-            Date dep = firstLeg().loadTime().get();
-            Date arr = lastLeg().unloadTime().get();
-            return Days.daysBetween( new LocalDate( dep ), new LocalDate( arr ) ).getDays();
+            ZonedDateTime dep = firstLeg().loadTime().get();
+            ZonedDateTime arr = lastLeg().unloadTime().get();
+            return (int) arr.until( dep, ChronoUnit.DAYS );
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/itinerary/Leg.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/itinerary/Leg.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/itinerary/Leg.java
index 8978a05..cd6736e 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/itinerary/Leg.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/itinerary/Leg.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_a.data.shipping.itinerary;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.property.Property;
 import org.qi4j.api.value.ValueComposite;
@@ -36,11 +36,11 @@ public interface Leg
 {
     Association<Location> loadLocation();
 
-    Property<Date> loadTime();
+    Property<ZonedDateTime> loadTime();
 
     Association<Voyage> voyage();
 
-    Property<Date> unloadTime();
+    Property<ZonedDateTime> unloadTime();
 
     Association<Location> unloadLocation();
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/voyage/CarrierMovement.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/voyage/CarrierMovement.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/voyage/CarrierMovement.java
index 41c1b2a..d14ce61 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/voyage/CarrierMovement.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/data/shipping/voyage/CarrierMovement.java
@@ -17,7 +17,7 @@
  */
 package org.qi4j.sample.dcicargo.sample_a.data.shipping.voyage;
 
-import java.util.Date;
+import java.time.ZonedDateTime;
 import org.qi4j.api.association.Association;
 import org.qi4j.api.property.Property;
 import org.qi4j.api.value.ValueComposite;
@@ -35,7 +35,7 @@ public interface CarrierMovement
 
     Association<Location> arrivalLocation();
 
-    Property<Date> departureTime();
+    Property<ZonedDateTime> departureTime();
 
-    Property<Date> arrivalTime();
+    Property<ZonedDateTime> arrivalTime();
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/infrastructure/wicket/form/DateTextFieldWithPicker.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/infrastructure/wicket/form/DateTextFieldWithPicker.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/infrastructure/wicket/form/DateTextFieldWithPicker.java
index fc5d172..7ae9f39 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/infrastructure/wicket/form/DateTextFieldWithPicker.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/infrastructure/wicket/form/DateTextFieldWithPicker.java
@@ -18,6 +18,10 @@
 package org.qi4j.sample.dcicargo.sample_a.infrastructure.wicket.form;
 
 import com.google.code.joliratools.StatelessAjaxEventBehavior;
+import java.time.LocalTime;
+import java.time.ZoneId;
+import java.time.ZonedDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.Date;
 import java.util.Map;
 import org.apache.wicket.Component;
@@ -33,9 +37,6 @@ import org.apache.wicket.model.Model;
 import org.apache.wicket.model.PropertyModel;
 import org.apache.wicket.request.mapper.parameter.PageParameters;
 import org.apache.wicket.validation.validator.DateValidator;
-import org.joda.time.DateTime;
-import org.joda.time.LocalDate;
-import org.joda.time.LocalTime;
 
 //import org.wicketstuff.stateless.StatelessAjaxEventBehavior;
 
@@ -48,8 +49,8 @@ public class DateTextFieldWithPicker extends DateTextField
     DatePicker datePicker;
 
     // Configurable widget options
-    LocalDate earliestDate;
-    LocalDate selectedDate;
+    ZonedDateTime earliestDate;
+    ZonedDateTime selectedDate;
 
     final static String YUI_DATE_FORMAT = "MM/dd/yyyy";
 
@@ -176,7 +177,7 @@ public class DateTextFieldWithPicker extends DateTextField
         widgetProperties.put( "selected", getSelectedDateStr() );
     }
 
-    public DateTextFieldWithPicker earliestDate( LocalDate newEarliestDate )
+    public DateTextFieldWithPicker earliestDate( ZonedDateTime newEarliestDate )
     {
         if( selectedDate != null && newEarliestDate.isAfter( selectedDate ) )
         {
@@ -186,8 +187,8 @@ public class DateTextFieldWithPicker extends DateTextField
         earliestDate = newEarliestDate;
 
         // Input field validation - date should be _after_ minimumDate (not the same)
-        LocalDate minimumDate = newEarliestDate.minusDays( 1 );
-        Date convertedMinimumDate = new DateTime( minimumDate.toDateTime( new LocalTime() ) ).toDate();
+        ZonedDateTime minimumDate = newEarliestDate.minusDays( 1 );
+        Date convertedMinimumDate = new Date( minimumDate.with( LocalTime.MAX ).toInstant().toEpochMilli() );
         add( DateValidator.minimum( convertedMinimumDate ) );
 
         return this;
@@ -195,7 +196,7 @@ public class DateTextFieldWithPicker extends DateTextField
 
     // Add latestDate(..) + other configuration options if needed..
 
-    public DateTextFieldWithPicker selectedDate( LocalDate newSelectedDate )
+    public DateTextFieldWithPicker selectedDate( ZonedDateTime newSelectedDate )
     {
         if( earliestDate != null && newSelectedDate.isBefore( earliestDate ) )
         {
@@ -211,17 +212,22 @@ public class DateTextFieldWithPicker extends DateTextField
     {
         if( selectedDate != null )
         {
-            return selectedDate.toString( YUI_DATE_FORMAT );
+            return formatDate( selectedDate );
         }
 
         // Select today or earliest date (if later) as default
         return earliestDate == null ?
-               new LocalDate().toString( YUI_DATE_FORMAT ) :
-               earliestDate.toString( YUI_DATE_FORMAT );
+               formatDate( ZonedDateTime.now() ) :
+               formatDate( earliestDate );
+    }
+
+    private String formatDate( ZonedDateTime date )
+    {
+        return date.format( DateTimeFormatter.ofPattern( YUI_DATE_FORMAT ) );
     }
 
     private String getEarliestDateStr()
     {
-        return earliestDate == null ? "" : earliestDate.toString( YUI_DATE_FORMAT );
+        return earliestDate == null ? "" : formatDate( earliestDate );
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/b71c878d/samples/dci-cargo/dcisample_a/src/test/java/org/qi4j/sample/dcicargo/sample_a/context/shipping/booking/BookNewCargoTest.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/test/java/org/qi4j/sample/dcicargo/sample_a/context/shipping/booking/BookNewCargoTest.java b/samples/dci-cargo/dcisample_a/src/test/java/org/qi4j/sample/dcicargo/sample_a/context/shipping/booking/BookNewCargoTest.java
index dbb3ea3..4baeda9 100644
--- a/samples/dci-cargo/dcisample_a/src/test/java/org/qi4j/sample/dcicargo/sample_a/context/shipping/booking/BookNewCargoTest.java
+++ b/samples/dci-cargo/dcisample_a/src/test/java/org/qi4j/sample/dcicargo/sample_a/context/shipping/booking/BookNewCargoTest.java
@@ -17,7 +17,9 @@
  */
 package org.qi4j.sample.dcicargo.sample_a.context.shipping.booking;
 
-import java.util.Date;
+import java.time.Instant;
+import java.time.LocalDate;
+import java.time.ZonedDateTime;
 import java.util.List;
 import org.junit.Before;
 import org.junit.Test;
@@ -37,6 +39,7 @@ import org.qi4j.sample.dcicargo.sample_a.data.shipping.location.Location;
 
 import static org.hamcrest.CoreMatchers.equalTo;
 import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.nullValue;
 import static org.junit.Assert.*;
 
 /**
@@ -51,7 +54,7 @@ public class BookNewCargoTest
       extends TestApplication
 {
 
-    private static final Date TODAY = new Date();
+    private static final Instant TODAY = Instant.now();
 
     @Before
     public void prepareTest()
@@ -126,18 +129,18 @@ public class BookNewCargoTest
 
         // Test derived delivery snapshot
         Delivery delivery = cargo.delivery().get();
-        assertThat( delivery.timestamp().get().after( TODAY ), is( equalTo( true ) ) ); // TODAY is set first
+        assertThat( delivery.timestamp().get().isAfter( TODAY ), is( equalTo( true ) ) ); // TODAY is set first
         assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.NOT_ROUTED ) ) );
         assertThat( delivery.transportStatus().get(), is( equalTo( TransportStatus.NOT_RECEIVED ) ) );
         assertThat( delivery.nextExpectedHandlingEvent().get().handlingEventType().get(), is( equalTo( HandlingEventType.RECEIVE ) ) );
         assertThat( delivery.nextExpectedHandlingEvent().get().location().get(), is( equalTo( HONGKONG ) ) );
-        assertThat( delivery.nextExpectedHandlingEvent().get().voyage().get(), is( equalTo( null ) ) );
-        assertThat( delivery.lastHandlingEvent().get(), is( equalTo( null ) ) );
-        assertThat( delivery.lastKnownLocation().get(), is( equalTo( null ) ) );
-        assertThat( delivery.currentVoyage().get(), is( equalTo( null ) ) );
-        assertThat( delivery.eta().get(), is( equalTo( null ) ) ); // Is set when itinerary is assigned
-        assertThat( delivery.isMisdirected().get(), is( equalTo( false ) ) );
-        assertThat( delivery.isUnloadedAtDestination().get(), is( equalTo( false ) ) );
+        assertThat( delivery.nextExpectedHandlingEvent().get().voyage().get(), nullValue() );
+        assertThat( delivery.lastHandlingEvent().get(), nullValue() );
+        assertThat( delivery.lastKnownLocation().get(), nullValue() );
+        assertThat( delivery.currentVoyage().get(), nullValue() );
+        assertThat( delivery.eta().get(), nullValue() ); // Is set when itinerary is assigned
+        assertThat( delivery.isMisdirected().get(), equalTo( false ) );
+        assertThat( delivery.isUnloadedAtDestination().get(), equalTo( false ) );
     }
 
     @Test( expected = FoundNoRoutesException.class )
@@ -179,7 +182,10 @@ public class BookNewCargoTest
                         itinerary.lastLeg().unloadLocation().get(),
                         is( equalTo( cargo.routeSpecification().get().destination().get() ) ) );
             assertThat( "Cargo will be delivered in time.",
-                        itinerary.finalArrivalDate().before( cargo.routeSpecification().get().arrivalDeadline().get() ),
+                        itinerary.finalArrivalDate().isBefore( cargo.routeSpecification()
+                                                                   .get()
+                                                                   .arrivalDeadline()
+                                                                   .get() ),
                         is( equalTo( true ) ) );
         }
     }
@@ -193,7 +199,7 @@ public class BookNewCargoTest
         Cargos CARGOS = uow.get( Cargos.class, CargosEntity.CARGOS_ID );
 
         // Create valid cargo
-        Date deadline = day( 30 );
+        ZonedDateTime deadline = day( 60 );
         TrackingId trackingId = new BookNewCargo( CARGOS, HONGKONG, STOCKHOLM, deadline ).book();
         Cargo cargo = uow.get( Cargo.class, trackingId.id().get() );
 
@@ -215,6 +221,6 @@ public class BookNewCargoTest
         assertThat( delivery.routingStatus().get(), is( equalTo( RoutingStatus.ROUTED ) ) );
 
         // ETA (= Unload time of last Leg) is before Deadline (set in previous test)
-        assertTrue( delivery.eta().get().before( deadline ) );
+        assertTrue( delivery.eta().get().isBefore( deadline ) );
     }
 }


[05/50] [abbrv] zest-qi4j git commit: Dominic Jones reported a problem with SideEffects being exectued more than once. Test and fix for that.

Posted by ni...@apache.org.
Dominic Jones reported a problem with SideEffects being exectued more than once. Test and fix for that.


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/116fa089
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/116fa089
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/116fa089

Branch: refs/heads/3.0
Commit: 116fa089c55f3e45cd03244337344133f58a994c
Parents: b49eca6
Author: Niclas Hedhman <ni...@hedhman.org>
Authored: Sat May 24 23:47:30 2014 +0200
Committer: Niclas Hedhman <ni...@hedhman.org>
Committed: Sat May 24 23:47:30 2014 +0200

----------------------------------------------------------------------
 .../bootstrap/CompositeAssemblyImpl.java        | 79 +++++++++---------
 .../sideeffects/SampleTransientTest.java        | 84 ++++++++++++++++++++
 .../sideeffects/SpecificSideEffectTest.java     |  2 +-
 .../src/test/java/org/qi4j/test/ASMTest.java    |  2 +-
 4 files changed, 123 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/116fa089/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/CompositeAssemblyImpl.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/CompositeAssemblyImpl.java b/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/CompositeAssemblyImpl.java
index 61eb547..7441390 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/CompositeAssemblyImpl.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/bootstrap/CompositeAssemblyImpl.java
@@ -173,9 +173,10 @@ public abstract class CompositeAssemblyImpl
         compositeMethodsModel = new CompositeMethodsModel( mixinsModel );
 
         // Implement composite methods
-        Iterable<Class<? extends Constraint<?, ?>>> constraintClasses = constraintDeclarations( this.types );
-        Iterable<Class<?>> concernClasses = flatten( concerns, concernDeclarations( this.types ) );
-        Iterable<Class<?>> sideEffectClasses = flatten( sideEffects, sideEffectDeclarations( this.types ) );
+        ArrayList<Type> allTypes = getTypes( this.types );
+        Iterable<Class<? extends Constraint<?, ?>>> constraintClasses = constraintDeclarations( getTypes( this.types ) );
+        Iterable<Class<?>> concernClasses = flatten( concerns, concernDeclarations( allTypes ) );
+        Iterable<Class<?>> sideEffectClasses = flatten( sideEffects, sideEffectDeclarations( allTypes ) );
         Iterable<Class<?>> mixinClasses = flatten( mixins, mixinDeclarations( this.types ) );
         implementMixinType( types, constraintClasses, concernClasses, sideEffectClasses, mixinClasses );
 
@@ -683,20 +684,12 @@ public abstract class CompositeAssemblyImpl
     @SuppressWarnings( "unchecked" )
     private Iterable<Class<? extends Constraint<?, ?>>> constraintDeclarations( Class<?> type )
     {
-        Iterable<? extends Class<?>> iterable = iterable( type );
-        return constraintDeclarations( iterable );
+        ArrayList<Type> allTypes = getTypes( type );
+        return constraintDeclarations( allTypes );
     }
 
-    private Iterable<Class<? extends Constraint<?, ?>>> constraintDeclarations( Iterable<? extends Class<?>> typess )
+    private Iterable<Class<? extends Constraint<?, ?>>> constraintDeclarations( ArrayList<Type> allTypes )
     {
-        // Find constraint declarations
-        List<Type> allTypes = new ArrayList<>();
-        for( Class<?> type : typess )
-        {
-            Iterable<Type> types = typesOf( type );
-            addAll( allTypes, types );
-        }
-
         // Find all constraints and flatten them into an iterable
         Function<Type, Iterable<Class<? extends Constraint<?, ?>>>> function = new Function<Type, Iterable<Class<? extends Constraint<?, ?>>>>()
         {
@@ -722,27 +715,11 @@ public abstract class CompositeAssemblyImpl
     private Iterable<Class<?>> concernDeclarations( Class<?> type )
     {
         Iterable<? extends Class<?>> iterable = iterable( type );
-        return concernDeclarations( iterable );
+        return concernDeclarations( getTypes( iterable ) );
     }
 
-    private Iterable<Class<?>> concernDeclarations( Iterable<? extends Class<?>> typess )
+    private Iterable<Class<?>> concernDeclarations( ArrayList<Type> allTypes )
     {
-        // Find concern declarations
-        ArrayList<Type> allTypes = new ArrayList<>();
-        for( Class<?> type : typess )
-        {
-            Iterable<Type> types;
-            if( type.isInterface() )
-            {
-                types = typesOf( type );
-            }
-            else
-            {
-                types = cast( classHierarchy( type ) );
-            }
-            addAll( allTypes, types );
-        }
-
         // Find all concerns and flattern them into an iterable
         Function<Type, Iterable<Class<?>>> function = new Function<Type, Iterable<Class<?>>>()
         {
@@ -768,19 +745,11 @@ public abstract class CompositeAssemblyImpl
     protected Iterable<Class<?>> sideEffectDeclarations( Class<?> type )
     {
         Iterable<? extends Class<?>> iterable = iterable( type );
-        return sideEffectDeclarations( iterable );
+        return sideEffectDeclarations( getTypes( iterable ) );
     }
 
-    protected Iterable<Class<?>> sideEffectDeclarations( Iterable<? extends Class<?>> typess )
+    protected Iterable<Class<?>> sideEffectDeclarations( ArrayList<Type> allTypes )
     {
-        // Find side-effect declarations
-        ArrayList<Type> allTypes = new ArrayList<>();
-        for( Class<?> type : typess )
-        {
-            Iterable<Type> types = typesOf( type );
-            addAll( allTypes, types );
-        }
-
         // Find all side-effects and flattern them into an iterable
         Function<Type, Iterable<Class<?>>> function = new Function<Type, Iterable<Class<?>>>()
         {
@@ -802,6 +771,32 @@ public abstract class CompositeAssemblyImpl
         return toList( flatten );
     }
 
+    private ArrayList<Type> getTypes( Class<?> type )
+    {
+        Iterable<? extends Class<?>> iterable = iterable( type );
+        return getTypes( iterable );
+    }
+
+    private ArrayList<Type> getTypes( Iterable<? extends Class<?>> typess )
+    {
+        // Find side-effect declarations
+        ArrayList<Type> allTypes = new ArrayList<>();
+        for( Class<?> type : typess )
+        {
+            Iterable<Type> types;
+            if( type.isInterface() )
+            {
+                types = typesOf( type );
+            }
+            else
+            {
+                types = cast( classHierarchy( type ) );
+            }
+            addAll( allTypes, types );
+        }
+        return allTypes;
+    }
+
     @SuppressWarnings( "unchecked" )
     protected Iterable<Class<?>> mixinDeclarations( Class<?> type )
     {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/116fa089/core/runtime/src/test/java/org/qi4j/runtime/sideeffects/SampleTransientTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/runtime/sideeffects/SampleTransientTest.java b/core/runtime/src/test/java/org/qi4j/runtime/sideeffects/SampleTransientTest.java
new file mode 100644
index 0000000..6a0d4f6
--- /dev/null
+++ b/core/runtime/src/test/java/org/qi4j/runtime/sideeffects/SampleTransientTest.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2014, Niclas Hedhman. All Rights Reserved.
+ * Copyright (c) 2014, Dominic Jones. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.qi4j.runtime.sideeffects;
+
+import org.junit.Test;
+import org.qi4j.api.common.UseDefaults;
+import org.qi4j.api.composite.TransientBuilderFactory;
+import org.qi4j.api.injection.scope.Structure;
+import org.qi4j.api.mixin.Mixins;
+import org.qi4j.api.property.Property;
+import org.qi4j.api.sideeffect.SideEffectOf;
+import org.qi4j.api.sideeffect.SideEffects;
+import org.qi4j.bootstrap.AssemblyException;
+import org.qi4j.bootstrap.ModuleAssembly;
+import org.qi4j.test.AbstractQi4jTest;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.junit.Assert.assertThat;
+
+public class SampleTransientTest extends AbstractQi4jTest
+{
+
+    @Structure
+    TransientBuilderFactory transientBuilderFactory;
+
+    @Override
+    public void assemble( ModuleAssembly module )
+        throws AssemblyException
+    {
+        module.transients( SampleTransient.class );
+    }
+
+    @Test
+    public void givenTransientWithSideEffectsWhenInvokingMethodShouldExecuteSideEffectOnlyOnce()
+    {
+        SampleTransient sample = transientBuilderFactory.newTransient( SampleTransient.class );
+        sample.execute();
+        assertThat( sample.count().get(), equalTo(1));
+    }
+
+    @SideEffects( SampleSideEffect.class )
+    @Mixins( SampleTransientMixin.class )
+    public static interface SampleTransient
+    {
+        void execute();
+
+        @UseDefaults
+        Property<Integer> count();
+    }
+
+    public abstract static class SampleTransientMixin
+        implements SampleTransient
+    {
+        @Override
+        public void execute()
+        {
+            System.out.println( "Invocation of Transient" );
+        }
+    }
+
+    public abstract static class SampleSideEffect extends SideEffectOf<SampleTransient>
+        implements SampleTransient
+    {
+        @Override
+        public void execute()
+        {
+            System.out.println( "Invocation of SideEffect" );
+            count().set( count().get() + 1 );
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/116fa089/core/runtime/src/test/java/org/qi4j/runtime/sideeffects/SpecificSideEffectTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/runtime/sideeffects/SpecificSideEffectTest.java b/core/runtime/src/test/java/org/qi4j/runtime/sideeffects/SpecificSideEffectTest.java
index 7bbbd73..21f8c4e 100644
--- a/core/runtime/src/test/java/org/qi4j/runtime/sideeffects/SpecificSideEffectTest.java
+++ b/core/runtime/src/test/java/org/qi4j/runtime/sideeffects/SpecificSideEffectTest.java
@@ -50,7 +50,7 @@ public class SpecificSideEffectTest
         Property<Integer> count = some.count();
         assertThat( "count is zero", count.get(), equalTo( 0 ) );
         some.doStuff();
-        assertThat( "count is not zero", count.get(), not( equalTo( 0 ) ) );
+        assertThat( "count is not zero", count.get(), equalTo( 1 ) );
     }
 
     @SideEffects( CounterSideEffect.class )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/116fa089/core/runtime/src/test/java/org/qi4j/test/ASMTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/test/ASMTest.java b/core/runtime/src/test/java/org/qi4j/test/ASMTest.java
index f0cbc6c..797fc0a 100644
--- a/core/runtime/src/test/java/org/qi4j/test/ASMTest.java
+++ b/core/runtime/src/test/java/org/qi4j/test/ASMTest.java
@@ -143,7 +143,7 @@ public class ASMTest
     }
 
     @Test
-    @Ignore( "This was dead commented code, ~70% of this source file ... What should we do about this!?!" )
+    @Ignore( "Convenience to look at what code is generated in the Fragment Classloader, and is not really a test case." )
     public void fragmentClassLoaderGenerateClassTest()
         throws Exception
     {


[48/50] [abbrv] zest-qi4j git commit: Fix Java 8 DocLint errors across the whole SDK

Posted by ni...@apache.org.
Fix Java 8 DocLint errors across the whole SDK


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/7d600da2
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/7d600da2
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/7d600da2

Branch: refs/heads/3.0
Commit: 7d600da201ad6315a1f7eb59e299c2261afca059
Parents: 63512db
Author: Paul Merlin <pa...@nosphere.org>
Authored: Sat Jan 24 12:18:40 2015 +0100
Committer: Paul Merlin <pa...@nosphere.org>
Committed: Sat Jan 24 12:18:40 2015 +0100

----------------------------------------------------------------------
 .../runtime/entity/EntityPropertyInstance.java     |  2 +-
 .../qi4j/runtime/injection/DependencyModel.java    | 12 ++++--------
 .../injection/InjectionProviderFactory.java        |  6 ++++--
 .../rest/server/DomainEventSourceResource.java     |  2 +-
 .../application/replay/ApplicationEventPlayer.java |  7 +++----
 .../application/source/ApplicationEventSource.java | 11 ++++++-----
 .../source/helper/ApplicationEventParameters.java  |  1 -
 .../domain/replay/DomainEventPlayer.java           |  6 +++---
 .../eventsourcing/domain/source/EventSource.java   |  1 +
 .../domain/source/helper/EventParameters.java      |  1 -
 .../domain/source/helper/EventRouter.java          |  2 +-
 .../domain/source/helper/UnitOfWorkRouter.java     |  2 +-
 .../java/org/qi4j/lang/groovy/GroovyMixin.java     |  2 +-
 .../org/qi4j/lang/javascript/JavaScriptMixin.java  |  2 +-
 .../main/java/org/qi4j/lang/jruby/JRubyMixin.java  |  2 +-
 .../spring/bootstrap/Qi4jApplicationBootstrap.java | 17 ++++++++---------
 .../library/spring/importer/SpringImporter.java    |  2 +-
 .../qi4j/library/struts2/Qi4jPropertyAccessor.java |  2 +-
 .../wicket/form/DateTextFieldWithPicker.java       |  2 +-
 .../interaction/handling/ProcessHandlingEvent.java |  2 +-
 .../wicket/form/DateTextFieldWithPicker.java       |  2 +-
 21 files changed, 41 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/7d600da2/core/runtime/src/main/java/org/qi4j/runtime/entity/EntityPropertyInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/entity/EntityPropertyInstance.java b/core/runtime/src/main/java/org/qi4j/runtime/entity/EntityPropertyInstance.java
index 46dc01b..0bc6583 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/entity/EntityPropertyInstance.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/entity/EntityPropertyInstance.java
@@ -30,7 +30,7 @@ public class EntityPropertyInstance<T>
      * Construct an instance of {@code PropertyInstance} with the specified arguments.
      *
      * @param aPropertyInfo The property info. This argument must not be {@code null}.
-     * @param entityState
+     * @param entityState EntityState
      */
     @SuppressWarnings( "unchecked" )
     public EntityPropertyInstance( PropertyInfo aPropertyInfo, EntityState entityState )

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/7d600da2/core/runtime/src/main/java/org/qi4j/runtime/injection/DependencyModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/injection/DependencyModel.java b/core/runtime/src/main/java/org/qi4j/runtime/injection/DependencyModel.java
index fd74e3d..fd4a606 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/injection/DependencyModel.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/injection/DependencyModel.java
@@ -213,18 +213,14 @@ public final class DependencyModel
      * <p>
      * If the dependency uses generics this is the raw type,
      * and otherwise it is the type of the field.
-     * </p>
      * <p>
      * Examples:
-     * </p>
-     * {@code @Service MyService service} -> MyService
-     * </p>
      * <p>
-     * {@code @Entity Iterable<Foo> fooList} -> Iterable
-     * </p>
+     * {@code @Service MyService service} -&gt; MyService
      * <p>
-     * {@code @Entity Query<Foo> fooQuery} -> Query
-     * </p>
+     * {@code @Entity Iterable<Foo> fooList} -&gt; Iterable
+     * <p>
+     * {@code @Entity Query<Foo> fooQuery} -&gt; Query
      *
      * @return raw injection type.
      */

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/7d600da2/core/runtime/src/main/java/org/qi4j/runtime/injection/InjectionProviderFactory.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/qi4j/runtime/injection/InjectionProviderFactory.java b/core/runtime/src/main/java/org/qi4j/runtime/injection/InjectionProviderFactory.java
index 0fb9ffd..a594397 100644
--- a/core/runtime/src/main/java/org/qi4j/runtime/injection/InjectionProviderFactory.java
+++ b/core/runtime/src/main/java/org/qi4j/runtime/injection/InjectionProviderFactory.java
@@ -27,8 +27,10 @@ public interface InjectionProviderFactory
      * can be found, return null. If the dependency is optional the dependency will
      * then be explicitly set to null.
      *
-     * @param resolution
-     * @param dependencyModel
+     * @param resolution Injection resolution
+     * @param dependencyModel Dependency model
+     * @return InjectionProvider
+     * @throws InvalidInjectionException if the injection is invalid
      */
     InjectionProvider newInjectionProvider( Resolution resolution, DependencyModel dependencyModel )
         throws InvalidInjectionException;

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/7d600da2/libraries/eventsourcing-rest/src/main/java/org/qi4j/library/eventsourcing/domain/rest/server/DomainEventSourceResource.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing-rest/src/main/java/org/qi4j/library/eventsourcing/domain/rest/server/DomainEventSourceResource.java b/libraries/eventsourcing-rest/src/main/java/org/qi4j/library/eventsourcing/domain/rest/server/DomainEventSourceResource.java
index 083694d..2de35d2 100644
--- a/libraries/eventsourcing-rest/src/main/java/org/qi4j/library/eventsourcing/domain/rest/server/DomainEventSourceResource.java
+++ b/libraries/eventsourcing-rest/src/main/java/org/qi4j/library/eventsourcing/domain/rest/server/DomainEventSourceResource.java
@@ -53,7 +53,7 @@ import static org.qi4j.functional.Iterables.iterable;
  * / = current set of most recent events (event range: count-pagesize to count)
  * /n,m = events from index n to index m. These are archive pages.
  * /n = working set page, where n is the first event index to be presented
- * </code></pre>>
+ * </code></pre>
  */
 public class DomainEventSourceResource
         extends Restlet

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/7d600da2/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/replay/ApplicationEventPlayer.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/replay/ApplicationEventPlayer.java b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/replay/ApplicationEventPlayer.java
index e0e66d7..075988c 100644
--- a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/replay/ApplicationEventPlayer.java
+++ b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/replay/ApplicationEventPlayer.java
@@ -28,10 +28,9 @@ public interface ApplicationEventPlayer
      * be the original object, but could also be a service that wants
      * to be invoked to handle the event.
      *
-     * @param applicationEvent
-     * @param object
-     * @throws ApplicationEventReplayException
-     *
+     * @param applicationEvent Application event
+     * @param object target
+     * @throws ApplicationEventReplayException if unable to play event
      */
     public void playEvent( ApplicationEvent applicationEvent, Object object )
             throws ApplicationEventReplayException;

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/7d600da2/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/source/ApplicationEventSource.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/source/ApplicationEventSource.java b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/source/ApplicationEventSource.java
index bb47de2..0019e00 100644
--- a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/source/ApplicationEventSource.java
+++ b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/source/ApplicationEventSource.java
@@ -29,11 +29,12 @@ public interface ApplicationEventSource
      * Get list of event transactions after the given timestamp.
      * <p>
      * If they are on the exact same timestamp, they will not be included.
-     * </p>
      * <p>
      * The method uses the visitor pattern, so a visitor is sent in which is given each transaction, one at a time.
-     * </p>
+     *
      * @param afterTimestamp timestamp of transactions
+     * @param maxTransactions maximum transactions
+     * @return list of event transactions
      */
     Input<TransactionApplicationEvents, IOException> transactionsAfter( long afterTimestamp, long maxTransactions );
 
@@ -41,14 +42,14 @@ public interface ApplicationEventSource
      * Get list of event transactions before the given timestamp.
      * <p>
      * If they are on the exact same timestamp, they will not be included.
-     * </p>
      * <p>
      * The method uses the visitor pattern, so a visitor is sent in which is given each transaction, one at a time.
-     * </p>
      * <p>
      * The transactions are sent to the visitor with the latest transaction first, i.e. walking backwards in the stream.
-     * </p>
+     *
      * @param beforeTimestamp timestamp of transactions
+     * @param maxTransactions maximum transactions
+     * @return list of event transactions
      */
     Input<TransactionApplicationEvents, IOException> transactionsBefore( long beforeTimestamp, long maxTransactions );
 }

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/7d600da2/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/source/helper/ApplicationEventParameters.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/source/helper/ApplicationEventParameters.java b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/source/helper/ApplicationEventParameters.java
index 5faf3e9..50e2e36 100644
--- a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/source/helper/ApplicationEventParameters.java
+++ b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/application/source/helper/ApplicationEventParameters.java
@@ -51,7 +51,6 @@ public class ApplicationEventParameters
      * @param event event with parameters
      * @param idx   index of parameter
      * @return the parameter with the given index or null
-     * @throws org.json.JSONException
      */
     public static String getParameter( ApplicationEvent event, int idx )
     {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/7d600da2/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/replay/DomainEventPlayer.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/replay/DomainEventPlayer.java b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/replay/DomainEventPlayer.java
index 4347043..05a5d67 100644
--- a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/replay/DomainEventPlayer.java
+++ b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/replay/DomainEventPlayer.java
@@ -33,9 +33,9 @@ public interface DomainEventPlayer
      * be the original object, but could also be a service that wants
      * to be invoked to handle the event.
      *
-     * @param domainEventValue
-     * @param object
-     * @throws EventReplayException
+     * @param domainEventValue Domain event value
+     * @param object target
+     * @throws EventReplayException if unable to play event
      */
     public void playEvent( DomainEventValue domainEventValue, Object object )
             throws EventReplayException;

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/7d600da2/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/EventSource.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/EventSource.java b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/EventSource.java
index e025b3f..4bb5508 100644
--- a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/EventSource.java
+++ b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/EventSource.java
@@ -34,6 +34,7 @@ public interface EventSource
      *
      * @param offset where in the list of events to start
      * @param limit maximum number of events returned
+     * @return list of UnitOfWorkDomainEventsValue after the given offset
      */
     Input<UnitOfWorkDomainEventsValue, IOException> events( long offset, long limit );
 

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/7d600da2/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/helper/EventParameters.java
----------------------------------------------------------------------
diff --git a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/helper/EventParameters.java b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/helper/EventParameters.java
index 1c53d21..536e68f 100644
--- a/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/helper/EventParameters.java
+++ b/libraries/eventsourcing/src/main/java/org/qi4j/library/eventsourcing/domain/source/helper/EventParameters.java
@@ -52,7 +52,6 @@ public class EventParameters
      * @param eventValue eventValue with parameters
      * @param idx   index of parameter
      * @return the parameter with the given index or null
-     * @throws JSONException
      */
     public static String getParameter( DomainEventValue eventValue, int idx )
     {

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/7d600da2/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 dcdd1f0..db952ec 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
@@ -27,7 +27,7 @@ import org.qi4j.library.eventsourcing.domain.api.DomainEventValue;
 import org.qi4j.library.eventsourcing.domain.api.UnitOfWorkDomainEventsValue;
 
 /**
- * Event handling router. Add specification->receiver routes. When an event comes in
+ * Event handling router. Add specification-&gt;receiver routes. When an event comes in
  * the router will ask each specification if it matches, and if so, delegate to the
  * receiver and return whether it successfully handled it or not. If no routes match,
  * delegate to the default receiver

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/7d600da2/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 72b188e..eed95ff 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
@@ -26,7 +26,7 @@ import org.qi4j.io.Sender;
 import org.qi4j.library.eventsourcing.domain.api.UnitOfWorkDomainEventsValue;
 
 /**
- * UnitOfWork handling router. Add specification->receiver routes. When a UnitOfWorkEDomainEventsValue comes in
+ * UnitOfWork handling router. Add specification-&gt;receiver routes. When a UnitOfWorkEDomainEventsValue comes in
  * the router will ask each specification if it matches, and if so, delegate to the
  * receiver. If no routes match, delegate to the default receiver.
  */

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/7d600da2/libraries/lang-groovy/src/main/java/org/qi4j/lang/groovy/GroovyMixin.java
----------------------------------------------------------------------
diff --git a/libraries/lang-groovy/src/main/java/org/qi4j/lang/groovy/GroovyMixin.java b/libraries/lang-groovy/src/main/java/org/qi4j/lang/groovy/GroovyMixin.java
index dd15683..d2d72eb 100644
--- a/libraries/lang-groovy/src/main/java/org/qi4j/lang/groovy/GroovyMixin.java
+++ b/libraries/lang-groovy/src/main/java/org/qi4j/lang/groovy/GroovyMixin.java
@@ -40,7 +40,7 @@ import org.qi4j.io.Outputs;
 /**
  * Generic mixin that implements interfaces by delegating to Groovy functions
  * using Groovy. Each method in an interface is declared by a Groovy method
- * in a file located in classpath with the name "<interface>.groovy",
+ * in a file located in classpath with the name "&lt;interface&gt;.groovy",
  * where the interface name includes the package, and has "." replaced with "/".
  * <p>
  * Example:

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/7d600da2/libraries/lang-javascript/src/main/java/org/qi4j/lang/javascript/JavaScriptMixin.java
----------------------------------------------------------------------
diff --git a/libraries/lang-javascript/src/main/java/org/qi4j/lang/javascript/JavaScriptMixin.java b/libraries/lang-javascript/src/main/java/org/qi4j/lang/javascript/JavaScriptMixin.java
index f924f89..c242424 100644
--- a/libraries/lang-javascript/src/main/java/org/qi4j/lang/javascript/JavaScriptMixin.java
+++ b/libraries/lang-javascript/src/main/java/org/qi4j/lang/javascript/JavaScriptMixin.java
@@ -30,7 +30,7 @@ import org.qi4j.library.scripting.ScriptReloadable;
 /**
  * Generic mixin that implements interfaces by delegating to JavaScript functions
  * using Rhino. Each method in an interface is declared as a JS function
- * in a file located in classpath with the name "<interface>.<method>.js",
+ * in a file located in classpath with the name "&lt;interface&gt;.&lt;method&gt;.js",
  * where the interface name includes the package, and has "." replaced with "/".
  * <p>
  * Example:

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/7d600da2/libraries/lang-jruby/src/main/java/org/qi4j/lang/jruby/JRubyMixin.java
----------------------------------------------------------------------
diff --git a/libraries/lang-jruby/src/main/java/org/qi4j/lang/jruby/JRubyMixin.java b/libraries/lang-jruby/src/main/java/org/qi4j/lang/jruby/JRubyMixin.java
index c36d7f6..9d4bd01 100644
--- a/libraries/lang-jruby/src/main/java/org/qi4j/lang/jruby/JRubyMixin.java
+++ b/libraries/lang-jruby/src/main/java/org/qi4j/lang/jruby/JRubyMixin.java
@@ -39,7 +39,7 @@ import org.qi4j.library.scripting.ScriptReloadable;
 /**
  * Generic mixin that implements interfaces by delegating to Ruby functions
  * using JRuby. Each method in an interface is declared by a Ruby method
- * in a file located in classpath with the name "<interface>.rb",
+ * in a file located in classpath with the name "&lt;interface&gt;.rb",
  * where the interface name includes the package, and has "." replaced with "/".
  * <p>
  * Example:

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/7d600da2/libraries/spring/src/main/java/org/qi4j/library/spring/bootstrap/Qi4jApplicationBootstrap.java
----------------------------------------------------------------------
diff --git a/libraries/spring/src/main/java/org/qi4j/library/spring/bootstrap/Qi4jApplicationBootstrap.java b/libraries/spring/src/main/java/org/qi4j/library/spring/bootstrap/Qi4jApplicationBootstrap.java
index 02ca11f..dccc63d 100644
--- a/libraries/spring/src/main/java/org/qi4j/library/spring/bootstrap/Qi4jApplicationBootstrap.java
+++ b/libraries/spring/src/main/java/org/qi4j/library/spring/bootstrap/Qi4jApplicationBootstrap.java
@@ -33,32 +33,31 @@ import org.springframework.context.ApplicationContextAware;
  * <li>Assemble qi4j application by implementing #assemble method.</li>
  * <li>Sets the identity of bean factory service. This identity is the spring
  * bean name.</li>
- * <li>Declare qi4j bootstrap in spring xml application context. </li>
- * 
+ * <li>Declare qi4j bootstrap in spring xml application context.
  * <pre><code>
- * &lt?xml version="1.0" encoding="UTF-8"?&gt
+ * &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  *
  * &lt;beans xmlns="http://www.springframework.org/schema/beans"
  * xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  * xmlns:qi4j="http://www.qi4j.org/schema/qi4j/spring"
  * xsi:schemaLocation="
  * http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
- * http://www.qi4j.org/schema/qi4j/spring http://www.qi4j.org/schema/qi4j/spring/spring-0.5.xsd"&gt
+ * http://www.qi4j.org/schema/qi4j/spring http://www.qi4j.org/schema/qi4j/spring/spring-0.5.xsd"&gt;
  *
- * &lt!-- class that implements Qi4jApplicationBootstrap --&gt
+ * &lt;!-- class that implements Qi4jApplicationBootstrap --&gt;
  *
- * &lt;qi4j:bootstrap class="org.qi4j.library.spring.bootstrap.Qi4jTestBootstrap"/&gt
+ * &lt;qi4j:bootstrap class="org.qi4j.library.spring.bootstrap.Qi4jTestBootstrap"/&gt;
  *
- * &lt;bean id="commentServiceHolder" class="org.qi4j.library.spring.bootstrap.CommentServiceHolder"&gt
+ * &lt;bean id="commentServiceHolder" class="org.qi4j.library.spring.bootstrap.CommentServiceHolder"&gt;
  *
- * &lt;constructor-arg ref="commentService"/&gt &lt;!-- Reference qi4j comment service --&gt
+ * &lt;constructor-arg ref="commentService"/&gt; &lt;!-- Reference qi4j comment service --&gt;
  *
  * &lt;/bean&gt;
  * </code></pre>
  * </li>
  * </ul>
  * <p>
- * <b>Importing Spring beans as services</b><br/>
+ * <b>Importing Spring beans as services</b><br>
  * </p>
  * <ol>
  * <li>Application bootstrap class must implement interface

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/7d600da2/libraries/spring/src/main/java/org/qi4j/library/spring/importer/SpringImporter.java
----------------------------------------------------------------------
diff --git a/libraries/spring/src/main/java/org/qi4j/library/spring/importer/SpringImporter.java b/libraries/spring/src/main/java/org/qi4j/library/spring/importer/SpringImporter.java
index 2d2e7f7..46e9161 100644
--- a/libraries/spring/src/main/java/org/qi4j/library/spring/importer/SpringImporter.java
+++ b/libraries/spring/src/main/java/org/qi4j/library/spring/importer/SpringImporter.java
@@ -32,7 +32,7 @@ public class SpringImporter
      *
      * @param serviceDescriptor The service descriptor.
      * @return a service instance
-     * @throws ServiceImporterException
+     * @throws ServiceImporterException if unable to import the service
      */
     @Override
     public Object importService( ImportedServiceDescriptor serviceDescriptor ) throws ServiceImporterException

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/7d600da2/libraries/struts2-plugin/src/main/java/org/qi4j/library/struts2/Qi4jPropertyAccessor.java
----------------------------------------------------------------------
diff --git a/libraries/struts2-plugin/src/main/java/org/qi4j/library/struts2/Qi4jPropertyAccessor.java b/libraries/struts2-plugin/src/main/java/org/qi4j/library/struts2/Qi4jPropertyAccessor.java
index 6ed8df3..673de8b 100644
--- a/libraries/struts2-plugin/src/main/java/org/qi4j/library/struts2/Qi4jPropertyAccessor.java
+++ b/libraries/struts2-plugin/src/main/java/org/qi4j/library/struts2/Qi4jPropertyAccessor.java
@@ -42,7 +42,7 @@ import static org.qi4j.library.struts2.ConstraintViolationInterceptor.CONTEXT_CO
  *
  * <p>NOTE: We can't do this as a regular converter because Qi4j composites doesn't (nor should it be) following the
  * JavaBean standard.  We might be able to only override the getProperty() method here and have regular converters for
- * Property, Association and SetAssociation but I haven't tried that yet so it may not work as expected.</>
+ * Property, Association and SetAssociation but I haven't tried that yet so it may not work as expected.</p>
  *
  * <p>TODO: Doesn't yet handle ManyAssociations, but these shouldn't be too hard to add</p>
  */

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/7d600da2/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/infrastructure/wicket/form/DateTextFieldWithPicker.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/infrastructure/wicket/form/DateTextFieldWithPicker.java b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/infrastructure/wicket/form/DateTextFieldWithPicker.java
index 7ae9f39..9bd8796 100644
--- a/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/infrastructure/wicket/form/DateTextFieldWithPicker.java
+++ b/samples/dci-cargo/dcisample_a/src/main/java/org/qi4j/sample/dcicargo/sample_a/infrastructure/wicket/form/DateTextFieldWithPicker.java
@@ -166,7 +166,7 @@ public class DateTextFieldWithPicker extends DateTextField
      * href="http://developer.yahoo.com/yui/calendar/">the widget's documentation</a> for the
      * available options. If you want to override/ remove properties, you should call
      * super.configure(properties) first. If you don't call that, be aware that you will have to
-     * call {@link #localize(Map)} manually if you like localized strings to be added.
+     * call {@literal #localize(Map)} manually if you like localized strings to be added.
      *
      * @param widgetProperties the current widget properties
      */

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/7d600da2/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/ProcessHandlingEvent.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/ProcessHandlingEvent.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/ProcessHandlingEvent.java
index 5641a85..5348568 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/ProcessHandlingEvent.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/context/interaction/handling/ProcessHandlingEvent.java
@@ -50,7 +50,7 @@ import org.slf4j.LoggerFactory;
  *
  * 1. Data Parser in {@link ParseHandlingEventData}
  * 2. Event Registrar in {@link RegisterHandlingEvent}
- * 3. Delivery Inspector in {@link com.marcgrue.dcisample_b.context.interaction.handling.inspection.InspectCargoDeliveryStatus}
+ * 3. Delivery Inspector in {@link org.qi4j.sample.dcicargo.sample_b.context.interaction.handling.inspection.InspectCargoDeliveryStatus}
  *
  * For now we simply (synchronously) invoke each subfunction use case with a method call. But
  * we could also implement this asynchronously with JMS or other similar solutions and have

http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/7d600da2/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/infrastructure/wicket/form/DateTextFieldWithPicker.java
----------------------------------------------------------------------
diff --git a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/infrastructure/wicket/form/DateTextFieldWithPicker.java b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/infrastructure/wicket/form/DateTextFieldWithPicker.java
index 361ae8c..5f2672c 100644
--- a/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/infrastructure/wicket/form/DateTextFieldWithPicker.java
+++ b/samples/dci-cargo/dcisample_b/src/main/java/org/qi4j/sample/dcicargo/sample_b/infrastructure/wicket/form/DateTextFieldWithPicker.java
@@ -165,7 +165,7 @@ public class DateTextFieldWithPicker extends DateTextField
      * href="http://developer.yahoo.com/yui/calendar/">the widget's documentation</a> for the
      * available options. If you want to override/ remove properties, you should call
      * super.configure(properties) first. If you don't call that, be aware that you will have to
-     * call {@link #localize(Map)} manually if you like localized strings to be added.
+     * call {@literal #localize(Map)} manually if you like localized strings to be added.
      *
      * @param widgetProperties the current widget properties
      */


[41/50] [abbrv] zest-qi4j git commit: Replacing loops with Stream API.

Posted by ni...@apache.org.
Replacing loops with Stream API.


Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/978c18c5
Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/978c18c5
Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/978c18c5

Branch: refs/heads/3.0
Commit: 978c18c529e520b189cd9a511f12822d94d04711
Parents: 90f612e
Author: Niclas Hedhman <ni...@hedhman.org>
Authored: Sat Oct 4 14:21:40 2014 +0800
Committer: Niclas Hedhman <ni...@hedhman.org>
Committed: Sat Oct 4 14:21:40 2014 +0800

----------------------------------------------------------------------
 .../src/main/java/org/qi4j/api/composite/DecoratorMixin.java   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/978c18c5/core/api/src/main/java/org/qi4j/api/composite/DecoratorMixin.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/qi4j/api/composite/DecoratorMixin.java b/core/api/src/main/java/org/qi4j/api/composite/DecoratorMixin.java
index 6b81844..045f5e7 100644
--- a/core/api/src/main/java/org/qi4j/api/composite/DecoratorMixin.java
+++ b/core/api/src/main/java/org/qi4j/api/composite/DecoratorMixin.java
@@ -21,6 +21,7 @@ import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
+import java.util.Arrays;
 import org.qi4j.api.injection.scope.Uses;
 
 /**
@@ -85,8 +86,7 @@ public class DecoratorMixin
         builder.append( "\ndelegateType: " );
         builder.append( delegate == null ? "n/a" : delegate.getClass().getName() );
         builder.append( "\narguments: \n" );
-        for( Object arg : args )
-        {
+        Arrays.stream(args).map( arg -> {
             builder.append( "    " );
             Class argClass = arg.getClass();
             if( Proxy.isProxyClass( argClass ) )
@@ -98,7 +98,7 @@ public class DecoratorMixin
                 builder.append( argClass.getName() );
             }
             builder.append( '\n' );
-        }
+        });
         return builder.toString();
     }
 }