Better way to check for CGLIB objects