In Geb, if you need to check if some element does exists on page or not the best looking way to do it is method
isPresent()
, so it can be called like:!notNeededLink.present
otherLink.present
Of course if you plan to check non-existing elements like this they need to be defined as not required and with wait - false. For example:
notNeededLink(to: SomePage, required:false, wait: false) {$('a', text:'Some')}