Finalized test code in main.java