Generic helper code for Java applications