[java] When to use static methods