Implement the filter method. Call the suppliers to get the Scanner and PrintWriter. Make sure that they are closed under all circumstances—when an exception occurs during initialization, reading, writing, or closing (!).
filter
Scanner
PrintWriter