Evaluate if a method exists

I’m trying to make sure that I can execute a method - eg setHue - before making that call.

I’ve tried respondsTo - but that doesn’t seem to work.

I’m using the below - i don’t think it is very elegant.

        	log.debug("Trying to set colour to $colour")
            try {
            } catch (Exception e) {
                log.debug "$thisSwitch does not support setHue"