@Nonnull public static Set<Flag> parse(@Nonnegative final int bitmask){
  Check.notNegative(bitmask,"bitmask");
  final Set<Flag> flags=new HashSet<Flag>();
  for (  final Flag flag : values()) {
    if ((bitmask & flag.getNumber()) != 0) {
      flags.add(flag);
    }
  }
  return flags;
}

@ Nonnull public static Set < Flag > parse ( @ Nonnegative final int bitmask ) { Check . notNegative ( bitmask , "bitmask" ) ; final Set < Flag > flags = new HashSet < Flag > ( ) ; for ( final Flag flag : values ( ) ) { if ( ( bitmask & flag . getNumber ( ) ) != 0 ) { flags . add ( flag ) ; } } return flags ; }
parses a sum of flags as numerical values ( bitmask ) and translates it to set of enum values .
