Utils methods for Java