@Nullable
              @Override
              public NotificationEventResponse apply(@Nullable NotificationEventResponse eventIdList) {
                if (null != eventIdList) {
                  List<NotificationEvent> eventIds = eventIdList.getEvents();
                  List<NotificationEvent> outEventIds = new ArrayList<>();
                  for (NotificationEvent event : eventIds) {
                    // Skip the last db event.
                    if (event.getDbName().equalsIgnoreCase(replicatedDbName)) {
                      injectionPathCalled = true;
                      continue;
                    }
                    outEventIds.add(event);
                  }

                  // Return the new list
                  return new NotificationEventResponse(outEventIds);
                } else {
                  return null;
                }
              }
Test replication scenarios with staging on replica.
itests/hive-unit/src/test/java/org/apache/hadoop/hive/ql/parse/TestReplicationScenariosExclusiveReplica.java