public Container getLatestContainer(List<Container> containers) {
        long newest = 0;
        Container result = null;

        for (Container container : containers) {
            long timestamp = container.getCreated();

            if (timestamp < newest) {
                continue;
            }

            newest = timestamp;
            result = container;
        }

        return result;
    }
Finds the latest container.

@param containers containers to find the latest.
@return the latest container or <code>null</code> if given <code>containers</code> is empty.
src/main/java/io/fabric8/maven/docker/service/QueryService.java