formatting java code snippet