code: static void addIfSupported(Set<String> supported, List<String> enabled, String... names) {
          for (String n: names) {
              if (supported.contains(n)) {
                  enabled.add(n);
              }
          }
      }
docs: Add elements from {@code names} into {@code enabled} if they are in {@code supported}.