[java] How to call a method with a separate thread in Java?