/*
 * Copyright 2015-2018 the original author or authors.
 *
 * All rights reserved. This program and the accompanying materials are
 * made available under the terms of the Eclipse Public License v2.0 which
 * accompanies this distribution and is available at
 *
 * http://www.eclipse.org/legal/epl-v20.html
 */

package org.junit.jupiter.params.provider;

import static org.apiguardian.api.API.Status.EXPERIMENTAL;

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.apiguardian.api.API;

/**
 * {@code @MethodSource} is an {@link ArgumentsSource} which provides access
 * to values returned by {@linkplain #value() methods} of the class in
 * which this annotation is declared.
 *
 * <p>By default such methods must be {@code static} unless the
 * {@link org.junit.jupiter.api.TestInstance.Lifecycle#PER_CLASS PER_CLASS}
 * test instance lifecycle mode is used for the test class.
 *
 * <p>The values returned by such methods will be provided as arguments to the
 * annotated {@code @ParameterizedTest} method.
 *
 * @since 5.0
 * @see org.junit.jupiter.params.provider.ArgumentsSource
 * @see org.junit.jupiter.params.ParameterizedTest
 * @see org.junit.jupiter.api.TestInstance
 */
@Target({ ElementType.ANNOTATION_TYPE, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@Documented
@API(status = EXPERIMENTAL, since = "5.0")
@ArgumentsSource(MethodArgumentsProvider.class)
public @interface MethodSource {

	/**
	 * The names of the test class methods to use as sources for arguments;
	 * leave empty if the source method has the same name as the test method.
	 */
	String[] value() default "";

}

@@ -616,39 +616,149 @@
 et;%0A
-%0Aimport org.apiguardian.api.API
+import java.util.Iterator;%0Aimport java.util.stream.Stream;%0A%0Aimport org.apiguardian.api.API;%0Aimport org.junit.jupiter.params.ParameterizedTest
 ;%0A%0A/
@@ -882,16 +882,24 @@
 #value()
+ factory
  methods
@@ -953,24 +953,617 @@
 eclared.%0A *%0A
+ * %3Cp%3EEach factory method must return a %7B@link Stream%7D, %7B@link Iterable%7D,%0A * %7B@link Iterator%7D, or array of arguments. The returned values will be provided%0A * as arguments to the annotated %7B@link ParameterizedTest @ParameterizedTest%7D%0A * method. If the parameterized test has a single parameter, each factory method%0A * may return value instances, e.g. as %7B@code Stream%3CString%3E%7D for a single%0A * %7B@code String%7D parameter, directly. If a parameterized test method declares%0A * multiple parameters, factory methods must return instances of%0A * %7B@link Arguments%7D, e.g. as %7B@code Stream%3CArguments%3E%7D.%0A *%0A
  * %3Cp%3EBy def
@@ -1566,22 +1566,31 @@
  default
+,
  such 
+factory 
 methods 
@@ -1762,137 +1762,71 @@
 ass.
-%0A *%0A * %3Cp%3EThe values returned by such methods will be provided as arguments to the%0A * annotated %7B@code @ParameterizedTest%7D method
+ Either way, factory%0A * methods must not declare any parameters
 .%0A *
@@ -1852,91 +1852,50 @@
 see 
-org.junit.jupiter.params.provider.ArgumentsSource%0A * @see org.junit.jupiter.params.
+Arguments%0A * @see ArgumentsSource%0A * @see 
 Para

Document allowed return types of @MethodSource factory methods