package ru.matevosyan.start;

/**
 * Class StubInput implements interface Input and created for testing the programs system input.
 * Created on 07.12.2016.
 * @since 1.0
 * @version 1.0
 * @author Matevosyan Vardan
 */

public class StubInput implements Input {

    /**
     * Instance variable answer for using to save input parameters for testing StartUI class.
     */

    private String[] answers;

    /**
     * Element position in an instance variable answer.
     */

    private int position = 0;

    /**
     * Constructor for StubInput.
     * @param answers for imitation user answer
     */

    public StubInput(String[] answers) {
        this.answers = answers;
    }

    /**
     * Override interface Inputs method ask.
     * @param question use for showing messages to user
     * @return imitation user answers
     */

    @Override
    public String ask(String question) {
        return answers[position++];
    }

    @Override
    public int ask(String question, int[] range) {
        return Integer.valueOf(answers[position++]);
    }

    @Override
    public int ask(String question, String[] availableIdRange) {
        return Integer.valueOf(answers[position++]);
    }
}

@@ -23,16 +23,45 @@
 start;%0A%0A
+import java.util.ArrayList;%0A%0A
 /**%0A * C
@@ -1019,154 +1019,28 @@
 on, 
-int%5B%5D range) %7B%0A        return Integer.valueOf(answers%5Bposition++%5D);%0A    %7D%0A%0A    @Override%0A    public int ask(String question, String%5B%5D availableIdR
+ArrayList%3CInteger%3E r
 ange
@@ -1102,10 +1102,11 @@
 ;%0A    %7D%0A
+%0A
 %7D%0A

change all array to arrayList