### Question:
FileOperationManager implements IFileOperationManager { @Nonnull public FileIOError renameFile (@Nonnull final File aSourceFile, @Nonnull final File aTargetFile) { m_aLastError = FileOperations.renameFile (aSourceFile, aTargetFile); _handleLastError (m_aLastError); return m_aLastError; } FileOperationManager(); @Nonnull @ReturnsMutableObject CallbackList <IFileOperationCallback> callbacks(); @Nullable FileIOError getLastError(); @Nullable EFileIOOperation getLastOperation(); @Nonnull FileIOError createDir(@Nonnull final File aDir); @Nonnull FileIOError createDirIfNotExisting(@Nonnull final File aDir); @Nonnull FileIOError createDirRecursive(@Nonnull final File aDir); @Nonnull FileIOError createDirRecursiveIfNotExisting(@Nonnull final File aDir); @Nonnull FileIOError deleteDir(@Nonnull final File aDir); @Nonnull FileIOError deleteDirIfExisting(@Nonnull final File aDir); @Nonnull FileIOError deleteDirRecursive(@Nonnull final File aDir); @Nonnull FileIOError deleteDirRecursiveIfExisting(@Nonnull final File aDir); @Nonnull FileIOError deleteFile(@Nonnull final File aFile); @Nonnull FileIOError deleteFileIfExisting(@Nonnull final File aFile); @Nonnull FileIOError renameDir(@Nonnull final File aSourceDir, @Nonnull final File aTargetDir); @Nonnull FileIOError renameFile(@Nonnull final File aSourceFile, @Nonnull final File aTargetFile); @Nonnull FileIOError copyDirRecursive(@Nonnull final File aSourceDir, @Nonnull final File aTargetDir); @Nonnull FileIOError copyFile(@Nonnull final File aSourceFile, @Nonnull final File aTargetFile); @Override String toString(); static final IFileOperationManager INSTANCE; }### Answer:
@Test public void testRenameFile () { final IFileOperationManager aFOM = new FileOperationManager (); final File aFile = new File ("renfile.test"); final File aFile2 = new File ("renfile.renamed"); try { assertFalse (FileHelper.existsFile (aFile)); _expectedError (aFOM.renameFile (aFile, aFile2), EFileIOErrorCode.SOURCE_DOES_NOT_EXIST); assertEquals (EFileIOOperation.RENAME_FILE, aFOM.getLastOperation ()); SimpleFileIO.writeFile (aFile, "hhsad".getBytes (StandardCharsets.ISO_8859_1)); assertTrue (FileHelper.existsFile (aFile)); assertFalse (FileHelper.existsFile (aFile2)); _expectedSuccess (aFOM.renameFile (aFile, aFile2)); assertEquals (EFileIOOperation.RENAME_FILE, aFOM.getLastOperation ()); assertFalse (FileHelper.existsFile (aFile)); assertTrue (FileHelper.existsFile (aFile2)); } finally { aFOM.deleteFile (aFile); assertEquals (EFileIOOperation.DELETE_FILE, aFOM.getLastOperation ()); aFOM.deleteFile (aFile2); assertEquals (EFileIOOperation.DELETE_FILE, aFOM.getLastOperation ()); } }