Reorder Java code