added main method tests to formatter.java