code: void addSourceTargetSet(UnicodeSet filter, UnicodeSet sourceSet, UnicodeSet targetSet, UnicodeSet revisiting) {
          int limit = anteContextLength + keyLength;
          UnicodeSet tempSource = new UnicodeSet();
          UnicodeSet temp = new UnicodeSet();
  
          // We need to walk through the pattern.
          // Iff some of the characters at ALL of the the positions are matched by the filter, then we add temp to toUnionTo
          for (int i=anteContextLength; i<limit; ) {
              int ch = UTF16.charAt(pattern, i);
              i += UTF16.getCharCount(ch);
              UnicodeMatcher matcher = data.lookupMatcher(ch);
              if (matcher == null) {
                  if (!filter.contains(ch)) {
                      return;
                  }
                  tempSource.add(ch);
              } else {
                  try {
                      if (!filter.containsSome((UnicodeSet) matcher)) {
                          return;
                      }
                      matcher.addMatchSetTo(tempSource);
                  } catch (ClassCastException e) { // if the matcher is not a UnicodeSet
                      temp.clear();
                      matcher.addMatchSetTo(temp);
                      if (!filter.containsSome(temp)) {
                          return;
                      }
                      tempSource.addAll(temp);
                  }
              }
          }
          // if we made our way through the gauntlet, add to source/target
          sourceSet.addAll(tempSource);
          output.addReplacementSetTo(targetSet);
      }
docs: However, following code applying the filter won't catch that case.