### Question:
SecureIOUtils { public static FileOutputStream createForWrite(File f, int permissions) throws IOException { if (skipSecurity) { return insecureCreateForWrite(f, permissions); } else { try { FileDescriptor fd = NativeIO.open(f.getAbsolutePath(), NativeIO.O_WRONLY | NativeIO.O_CREAT | NativeIO.O_EXCL, permissions); return new FileOutputStream(fd); } catch (NativeIOException nioe) { if (nioe.getErrno() == Errno.EEXIST) { throw new AlreadyExistsException(nioe); } throw nioe; } } }  static FileInputStream openForRead(File f, String expectedOwner, 
      String expectedGroup); static FileOutputStream createForWrite(File f, int permissions);  }### Answer:
@Test public void testCreateForWrite() throws IOException { try { SecureIOUtils.createForWrite(testFilePath, 0777); fail("Was able to create file at " + testFilePath); } catch (SecureIOUtils.AlreadyExistsException aee) { } }