testCommand function added for JUnit testing

allows LogicTest to test the functions in Logic
individual functions changed to testCommand function