Валидатор выдавал Timeout, хотя решение работало верно.
public class QuestionFileOutputStream implements AmigoOutputStream {
private static AmigoOutputStream amigoOut;
public QuestionFileOutputStream(AmigoOutputStream amigoOut) {
this.amigoOut = amigoOut;
}
public QuestionFileOutputStream() {}
@Override
public void close() throws IOException {
System.out.println("Вы действительно хотите закрыть поток? Д/Н");
BufferedReader bfr = new BufferedReader(new InputStreamReader(System.in));
String str;
//if (bfr.readLine().equals("Д")){
// amigoOut.close();
//}
while (!(str = bfr.readLine()).equals("Д")) {
}
while (amigoOut!=null) {
amigoOut.close();
}
}
// public static void main(String[] args) throws IOException {
// AmigoOutputStream amigoOuts = new QuestionFileOutputStream();
// amigoOuts.close();
// }
}