package ru.job4j.tracker.start;

/**
 * Class StubInput.
 * @author yuzyakav.
 * @since 09.03.2017
 * @version 1.0
 */

public class StubInput implements Input {

	/**
	 * answers.
	 */
	private String[] answers;

	/**
	 * position of answer.
	 */
	private int position = 0;

	/**
	 * constructor for StubInput.
	 * @param answers - array of String's
	 */
	public StubInput(String[] answers) {
		this.answers = answers;
	}

	/**
	 * Method for asking question.
	 * @param question asking user for input.
	 * @return answers.
	 */
	public String ask(String question) {
		return answers[position++];
	}

	@Override
	public int ask(String question, int[] range) {
		int key = Integer.parseInt(this.ask(question));
		boolean exist = false;
		for (int value : range) {
			if (value == key) {
				exist = true;
				break;
			}
		}
		if (exist) {
			return key;
		} else {
			throw new MenuOutException("Out of menu range");
		}
	}
}
@@ -26,16 +26,45 @@
 start;%0A%0A
+import java.util.ArrayList;%0A%0A
 /**%0A * C
@@ -94,17 +94,15 @@
 hor 
+A
 yuzyak
-av.
 %0A * 
@@ -108,17 +108,17 @@
  @since 
-0
+2
 9.03.201
@@ -670,13 +670,26 @@
 on, 
-int%5B%5D
+ArrayList%3CInteger%3E
  ran
@@ -959,8 +959,9 @@
 %09%09%7D%0A%09%7D%0A%7D
+%0A

Update StubInput.java