### Question:
PathOperations { @Nonnull public static FileIOError deleteFile (@Nonnull final Path aFile) { ValueEnforcer.notNull (aFile, "Path"); final Path aRealFile = _getUnifiedPath (aFile); if (!aRealFile.toFile ().isFile ()) return EFileIOErrorCode.SOURCE_DOES_NOT_EXIST.getAsIOError (EFileIOOperation.DELETE_FILE, aRealFile); final Path aParentDir = aRealFile.getParent (); if (aParentDir != null && !Files.isWritable (aParentDir)) return EFileIOErrorCode.SOURCE_PARENT_NOT_WRITABLE.getAsIOError (EFileIOOperation.DELETE_FILE, aRealFile); return _perform (EFileIOOperation.DELETE_FILE, Files::delete, aRealFile); } private  PathOperations(); static boolean isExceptionOnDeleteRoot(); static void setExceptionOnDeleteRoot(final boolean bExceptionOnDeleteRoot); @Nonnull static FileIOError createDir(@Nonnull final Path aDir); @Nonnull static FileIOError createDirIfNotExisting(@Nonnull final Path aDir); @Nonnull static FileIOError createDirRecursive(@Nonnull final Path aDir); @Nonnull static FileIOError createDirRecursiveIfNotExisting(@Nonnull final Path aDir); @Nonnull static FileIOError deleteDir(@Nonnull final Path aDir); @Nonnull static FileIOError deleteDirIfExisting(@Nonnull final Path aDir); @Nonnull static FileIOError deleteDirRecursive(@Nonnull final Path aDir); @Nonnull static FileIOError deleteDirRecursiveIfExisting(@Nonnull final Path aDir); @Nonnull static FileIOError deleteFile(@Nonnull final Path aFile); @Nonnull static FileIOError deleteFileIfExisting(@Nonnull final Path aFile); @Nonnull static FileIOError renameFile(@Nonnull final Path aSourceFile, @Nonnull final Path aTargetFile); @Nonnull static FileIOError renameDir(@Nonnull final Path aSourceDir, @Nonnull final Path aTargetDir); @Nonnull static FileIOError copyFile(@Nonnull final Path aSourceFile, @Nonnull final Path aTargetFile); @Nonnull static FileIOError copyDirRecursive(@Nonnull final Path aSourceDir, @Nonnull final Path aTargetDir); static final boolean DEFAULT_EXCEPTION_ON_DELETE_ROOT; }### Answer:
@Test public void testDeleteFile () { _expectedError (PathOperations.deleteFile (Paths.get ("warum sollte es diese Datei geben")), EFileIOErrorCode.SOURCE_DOES_NOT_EXIST); final Path f = Paths.get ("delfile.test"); try { SimpleFileIO.writeFile (f.toFile (), "abc".getBytes (StandardCharsets.ISO_8859_1)); assertTrue (Files.isRegularFile (f)); _expectedSuccess (PathOperations.deleteFile (f)); assertFalse (Files.isRegularFile (f)); _expectedError (PathOperations.deleteFile (f), EFileIOErrorCode.SOURCE_DOES_NOT_EXIST); } finally { PathOperations.deleteFile (f); } try { PathOperations.deleteFile (null); fail (); } catch (final NullPointerException ex) {} }