to help with testing you could wrap a run method inside the main method so that you can pass in err and out and avoid calls to exit.
something like
```
void main(String[] args) {
...
   System.exit(run(Main.out, Main.err));
}
```