### Question:
FileOperations { @Nonnull public static FileIOError createDirIfNotExisting (@Nonnull final File aDir) { final FileIOError aError = createDir (aDir); if (aError.getErrorCode ().equals (EFileIOErrorCode.TARGET_ALREADY_EXISTS)) return EFileIOErrorCode.NO_ERROR.getAsIOError (EFileIOOperation.CREATE_DIR, aDir); return aError; } private  FileOperations(); static boolean isExceptionOnDeleteRoot(); static void setExceptionOnDeleteRoot(final boolean bExceptionOnDeleteRoot); @Nonnull static FileIOError createDir(@Nonnull final File aDir); @Nonnull static FileIOError createDirIfNotExisting(@Nonnull final File aDir); @Nonnull static FileIOError createDirRecursive(@Nonnull final File aDir); @Nonnull static FileIOError createDirRecursiveIfNotExisting(@Nonnull final File aDir); @Nonnull static FileIOError deleteDir(@Nonnull final File aDir); @Nonnull static FileIOError deleteDirIfExisting(@Nonnull final File aDir); @Nonnull static FileIOError deleteDirRecursive(@Nonnull final File aDir); @Nonnull static FileIOError deleteDirRecursiveIfExisting(@Nonnull final File aDir); @Nonnull static FileIOError deleteFile(@Nonnull final File aFile); @Nonnull static FileIOError deleteFileIfExisting(@Nonnull final File aFile); @Nonnull static FileIOError renameFile(@Nonnull final File aSourceFile, @Nonnull final File aTargetFile); @Nonnull static FileIOError renameDir(@Nonnull final File aSourceDir, @Nonnull final File aTargetDir); @Nonnull static FileIOError copyFile(@Nonnull final File aSourceFile, @Nonnull final File aTargetFile); @Nonnull static FileIOError copyDirRecursive(@Nonnull final File aSourceDir, @Nonnull final File aTargetDir); static final boolean DEFAULT_EXCEPTION_ON_DELETE_ROOT; }### Answer:
@Test public void testCreateDirIfNotExisting () { final File aDir1 = new File ("TestDir"); assertFalse (FileHelper.existsDir (aDir1)); _expectedSuccess (FileOperations.createDirIfNotExisting (aDir1)); try { assertTrue (FileHelper.existsDir (aDir1)); _expectedSuccess (FileOperations.createDirIfNotExisting (aDir1)); } finally { _expectedSuccess (FileOperations.deleteDir (aDir1)); assertFalse (FileHelper.existsDir (aDir1)); } _expectedError (FileOperations.createDirIfNotExisting (new File ("\0")), EFileIOErrorCode.OPERATION_FAILED); try { FileOperations.createDirIfNotExisting (null); fail (); } catch (final NullPointerException ex) {} }