Skip to content

Instantly share code, notes, and snippets.

@tarynsauer
Created January 10, 2014 04:01
Show Gist options
  • Save tarynsauer/8346804 to your computer and use it in GitHub Desktop.
Save tarynsauer/8346804 to your computer and use it in GitHub Desktop.
import java.io.BufferedReader;
import java.io.Reader;
import java.util.ArrayList;
import java.io.InputStreamReader;
import java.io.IOException;
public class MockBufferedReader extends BufferedReader {
public ArrayList<String> inputHistory;
public void setInputHistory(ArrayList<String> inputHistory) {
this.inputHistory = inputHistory;
}
public MockBufferedReader(Reader reader) {
super(reader);
}
public MockBufferedReader(InputStreamReader inputStreamReader) {
super(inputStreamReader);
}
@Override
public String readLine() throws IOException {
return inputHistory.get(inputHistory.size()-1);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment