General purpose java utilities