Update HelloWorld.java

added method test