anchor.diff:  
   [source,java]
   ----
  -StringWriter sw = new StringWriter();
   MyApp app = new MyApp();
   CommandLine cmd = new CommandLine(app);
  +
  +StringWriter sw = new StringWriter();
   cmd.setOut(new PrintWriter(sw));
   
   // black box testing
  
positive.code: 
      public void run() {
          // make testing easier by printing to the Err and Out streams provided by picocli
          spec.commandLine.getOut().println("Your output is abc...");
      }
  }
  ----
  
negative.code: PrintStream oldErr = System.err;
  PrintStream oldOut = System.out;
  try {
      System.setErr(new PrintStream(err));           // setup
      System.setOut(new PrintStream(out));
      String[] args = "my command args".split(" ");  // test
      new CommandLine(new MyApp()).execute(args);
  } finally {
      System.setErr(oldErr);                         // teardown
      System.setOut(oldOut);
  }
  assertEquals("MY COMMAND OUTPUT", out.toString()); // verify
  assertEquals("", err.toString());
  ----
  
  If you're testing with JUnit 4, you can do the setup in a `@org.junit.Before`-annotated method and teardown in an `@org.junit.After`-annotated method.
  