this is not supported directly by the JVM. but of course you could write some code reading from command line and calling the corresponding method.
how many instances of your TestClass will there be ? is the test() method static ? if there are many instances and the method is not static then you need to keep a list of the instances and pick one (random, some algorithm, fifo, ...). if its static then there is nothing to pick.
you might want to check reflection which would allow you to find/invoke a method which name you typed on the command line.
do you just want to trigger execution of methods from command line or is there something else running in the background. if there is something else, then you need to think about threads since otherwise your application would be blocked waiting for IO on command line (or use java.nio stuff).
depending on how many methods there are to be called and how dynamic you want to be... you can use either reflection or some predefined keywords;
perhaps you can come up with something and post again if you are stuck.