Added debugging functionality to Java class