code: public static ImmutableSet<OpenOption> getOptionsForOutputStream(OpenOption... options) {
      if (options.length == 0) {
        return DEFAULT_WRITE;
      }
  
      ImmutableSet<OpenOption> result = addWrite(Arrays.asList(options));
      if (result.contains(READ)) {
        throw new UnsupportedOperationException("'READ' not allowed");
      }
      return result;
    }
docs: Returns an immutable set of open options for opening a new output stream.