private void doRegisterListener() {
    InterestRegistrationListener listener = new InterestRegistrationListener() {
      @Override
      public void close() {}

      @Override
      public void afterUnregisterInterest(InterestRegistrationEvent event) {
        Integer count = listnerMap.get(UNREGISTER_INTEREST);
        int intCount = 0;
        if (count != null) {
          intCount = count;
        }
        intCount++;
        listnerMap.put(UNREGISTER_INTEREST, intCount);
        LogWriterUtils.getLogWriter()
            .info("InterestRegistrationListener afterUnregisterInterest  for "
                + event.getRegionName() + " keys " + event.getKeysOfInterest() + "Count " + intCount
                + " Client : " + event.getClientSession().toString());
      }

      @Override
      public void afterRegisterInterest(InterestRegistrationEvent event) {
        Integer count = listnerMap.get(REGISTER_INTEREST);
        int intCount = 0;
        if (count != null) {
          intCount = count;
        }
        intCount++;
        listnerMap.put(REGISTER_INTEREST, intCount);
        LogWriterUtils.getLogWriter()
            .info("InterestRegistrationListener afterRegisterInterest  for " + event.getRegionName()
                + " keys " + event.getKeysOfInterest() + "Count " + intCount + " Client : "
                + event.getClientSession().toString());
      }
    };
    LogWriterUtils.getLogWriter().info("Registered InterestRegistationLister");
    cacheServer.registerInterestRegistrationListener(listener);
  }
Written to test fix for Bug #47132
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/InterestRegrListenerDUnitTest.java