code: public static boolean executeCurrentMethod(ITestNGListener listener) {
          String className = listener.getClass().getName();
          logger.entering("Listener Class : " + className);
          if (isServiceLoaderDisabled()) {
              logger.info("Listener Management was disabled. None of the managed listeners will be invoked.");
              logger.exiting(false);
              return false;
          }
  
          boolean runCurrentMethod = listenerMap.get(className).isEnabled();
  
          // below lines of code are only intended to pretty print the exiting message.
          String instanceName = listener.toString();
          if (instanceName.indexOf('@') >= 0) {
              instanceName = ((instanceName.split("@").length >= 2) ? (instanceName.split("@")[1]) : instanceName);
          }
  
          logger.exiting(String.format("Execute listener methods of class %s on instance %s ? %s", className,
                  instanceName, runCurrentMethod));
          return runCurrentMethod;
      }
docs: This method decides if a TestNG interface implementation should be executed or skipped. The decision is made
  after checking if the current Listener enabled/disabled as determined by {@link ListenerInfo#isEnabled()}.
  
  @param listener
  - A {@link ITestNGListener} object which represents your listener.
  
  @return - A flag which states if the current method is to be skipped or executed.