public <K> List<List<K>> registerInterest(final @NotNull K key,
      final @NotNull InterestType interestType, final @NotNull InterestResultPolicy policy,
      final boolean isDurable, final boolean receiveUpdatesAsInvalidates,
      final @NotNull DataPolicy regionDataPolicy) {
    if (interestType == InterestType.KEY && key instanceof List) {
      logger.warn(
          "Usage of registerInterest(List) has been deprecated. Please use registerInterestForKeys(Iterable)");
      return registerInterestList(uncheckedCast(key), policy, isDurable,
          receiveUpdatesAsInvalidates,
          regionDataPolicy);
    } else {
      final RegisterInterestTracker rit = pool.getRITracker();
      boolean finished = false;
      try {
        // register with the tracker early
        rit.addSingleInterest(region, key, interestType, policy, isDurable,
            receiveUpdatesAsInvalidates);
        final List<List<K>> result =
            RegisterInterestOp.execute(pool, regionName, key, interestType, policy,
                isDurable, receiveUpdatesAsInvalidates, regionDataPolicy);
        //////// TEST PURPOSE ONLY ///////////
        if (PoolImpl.AFTER_REGISTER_CALLBACK_FLAG) {
          ClientServerObserver bo = ClientServerObserverHolder.getInstance();
          bo.afterInterestRegistration();
        }
        /////////////////////////////////////////
        finished = true;
        return result;
      } finally {
        if (!finished) {
          rit.removeSingleInterest(region, key, interestType, isDurable,
              receiveUpdatesAsInvalidates);
        }
      }
    }
  }
Does a region registerInterest on a server

@param key describes what we are interested in
@param interestType the {@link InterestType} for this registration
@param policy the interest result policy for this registration
@param isDurable true if this registration is durable
@param receiveUpdatesAsInvalidates whether to act like notify-by-subscription is false.
@param regionDataPolicy the data policy ordinal of the region
@return list of keys
geode-core/src/main/java/org/apache/geode/cache/client/internal/ServerRegionProxy.java