/*
 * Java Genetic Algorithm Library (@__identifier__@).
 * Copyright (c) @__year__@ Franz Wilhelmstötter
 *
 * 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.
 *
 * Author:
 *    Franz Wilhelmstötter (franz.wilhelmstoetter@gmx.at)
 */
package org.jenetics.util;

/**
 * @param <T> the object type this factory creates.
 *
 * @author <a href="mailto:franz.wilhelmstoetter@gmx.at">Franz Wilhelmstötter</a>
 * @since 1.0
 * @version 1.0 &mdash; <em>$Date: 2014-04-14 $</em>
 */
@FunctionalInterface
public interface Factory<T> {

	/**
	 * Create a new instance of type T.
	 *
	 * @return a new instance of type T.
	 */
	public T newInstance();

}

@@ -762,16 +762,49 @@
 .util;%0A%0A
+import java.util.stream.Stream;%0A%0A
 /**%0A * @
@@ -994,13 +994,13 @@
 014-
-04-14
+10-08
  $%3C/
@@ -1137,25 +1137,24 @@
 ce of type T
-.
 %0A%09 */%0A%09publi
@@ -1173,10 +1173,240 @@
 nce();%0A%0A
+%09/**%0A%09 * Return a new stream of object instances, created by this factory.%0A%09 *%0A%09 * @return a stream of objects, created by this factory%0A%09 */%0A%09public default Stream%3CT%3E instances() %7B%0A%09%09return Stream.generate(this::newInstance);%0A%09%7D%0A%0A
 %7D%0A

Add default method 'Factory.instances'.