public static Set<OpenFlag> set(Collection<OpenFlag> flags) {
			if (flags.contains(O_RDONLY) && flags.contains(O_WRONLY)) {
				throw new IllegalArgumentException("Cannot be read only and write only");
			}
			if (flags instanceof EnumSet) {
				return Collections.unmodifiableSet((EnumSet<OpenFlag>) flags);
			}
			return Collections.unmodifiableSet(EnumSet.copyOf(flags));
		}
Construct a set of flags

@param flags the flags
@return the set
Ghidra/Features/SystemEmulation/src/main/java/ghidra/pcode/emu/unix/EmuUnixFileSystem.java