refactored simple test to use mock object for PrintStream