Added main.java

Also added some test code