public void updateFilter(String filter) {
      Pattern pattern = Pattern.compile(filter);
      filteredElements = new ArrayList<>();
      for (Object element : allElements) {
        if (pattern.matcher(element.toString()).find()) {
          filteredElements.add(element);
        }
      }

      fireContentsChanged(this, 0, filteredElements.size());
    }
A listener for changes to the graph selections
geode-core/src/test/java/org/apache/geode/sequence/SelectGraphDialog.java