private static ImmutableSet<OpenOption> addWrite(Collection<? extends OpenOption> options) {
    return options.contains(WRITE)
        ? ImmutableSet.copyOf(options)
        : ImmutableSet.<OpenOption>builder().add(WRITE).addAll(options).build();
  }
Returns an {@link ImmutableSet} copy of the given {@code options}, adding {@link
StandardOpenOption#WRITE} if it isn't already present.
jimfs/src/main/java/com/google/common/jimfs/Options.java