private static boolean checkResolveResult(GroovyResolveResult result) {
    return result != null &&
           result.getElement() != null &&
           !result.isAccessible();
  }
private static boolean checkResolveResult(GroovyResolveResult result)