code: Set<RequiresFlag> readRequiresFlags(int flags) {
          Set<RequiresFlag> set = EnumSet.noneOf(RequiresFlag.class);
          for (RequiresFlag f: RequiresFlag.values()) {
              if ((flags & f.value) != 0)
                  set.add(f);
          }
          return set;
      }
docs: Read requires_flags.