docs: protected Map<String, Object> collectConstants(Class<?> type) {
          Map<String, Object> constants = new ConstantsHashMap<>(type);
  
          // Go through all the fields, and put static ones in a map.
          Field[] fields = type.getDeclaredFields();
  
          for (Field field : fields) {
              // Check to see if this is public static final. If not, it's not a constant.
              int modifiers = field.getModifiers();
              if (!Modifier.isFinal(modifiers) || !Modifier.isStatic(modifiers) || !Modifier.isPublic(modifiers)) {
                  continue;
              }
  
              try {
                  Object value = field.get(null); // null for static fields.
                  constants.put(field.getName(), value);
              }
              catch (Exception e) {
                  throw new FacesException("Could not get value of " + field.getName() + " in " + type.getName() + ".", e);
              }
          }
  
          return constants;
      }