@Test
public void testMergeFile14() throws Exception {

    // 引数の設定
    String classFileName = this.getClass().getSimpleName() + ".class";
    URL url = this.getClass().getResource(classFileName);
    String directoryPath = url.getPath().substring(0,
            url.getPath().length() - classFileName.length());
    List<String> fileList = new ArrayList<String>();
    String srcFile1 = directoryPath + "testMergeFile14_src1.txt";
    fileList.add(srcFile1);
    String srcFile2 = null;
    fileList.add(srcFile2);
    String srcFile3 = directoryPath + "testMergeFile14_src3.txt";
    fileList.add(srcFile3);
    String newFile = directoryPath + "testMergeFile14_new.txt";
    // 前提条件の設定
    Field field = FileUtility.class.getDeclaredField("checkFileExist");
    field.setAccessible(true);
    field.set(FileUtility.class, true);        
    // テスト対象ファイルを初期化する。
    File testSrcFile1 = new File(srcFile1);
    testSrcFile1.delete();
    testSrcFile1.createNewFile();
    File testSrcFile3 = new File(srcFile3);
    testSrcFile3.delete();
    testSrcFile3.createNewFile();
    File testNewFile = new File(newFile);
    testNewFile.delete();
    testNewFile.createNewFile();
    FileWriter testSrcFile1FileWriter = null;
    FileWriter testSrcFile3FileWriter = null;
    FileWriter testNewFileFileWriter = null;
    BufferedReader postReader = null;
    try {
        testSrcFile1FileWriter = new FileWriter(testSrcFile1);
        testSrcFile1FileWriter.write("testMergeFile14_src1.txtデータ");
        testSrcFile1FileWriter.flush();
        testSrcFile1FileWriter.close();
        testSrcFile3FileWriter = new FileWriter(testSrcFile3);
        testSrcFile3FileWriter.write("testMergeFile14_src3.txtデータ");
        testSrcFile3FileWriter.flush();
        testSrcFile3FileWriter.close();
        testNewFileFileWriter = new FileWriter(testNewFile);
        testNewFileFileWriter.write("testMergeFile14_new.txtデータ");
        testNewFileFileWriter.flush();
        testNewFileFileWriter.close();
        PowerMockito.mockStatic(FileUtility.class, Mockito.CALLS_REAL_METHODS);
        // テスト実施
        FileUtility.mergeFile(fileList, newFile);
        fail("FileExceptionが発生しませんでした。失敗です。");
    } catch (FileException e) {
        // 例外の確認
        assertTrue(FileException.class.isAssignableFrom(e.getClass()));
        assertEquals("File path is not set.", e.getMessage());
        assertNull(e.getFileName());
        // 状態変化の確認
        PowerMockito.verifyPrivate(FileUtility.class, Mockito.times(3)).invoke("checkAbsolutePath", Mockito.anyString());
        PowerMockito.verifyPrivate(FileUtility.class).invoke("checkAbsolutePath", newFile);
        PowerMockito.verifyPrivate(FileUtility.class).invoke("checkAbsolutePath", srcFile1);
        // マージ先のファイル内容確認
        File mergeFile = new File(newFile);
        assertTrue(mergeFile.exists());
        postReader = new BufferedReader(new InputStreamReader(
                new FileInputStream(mergeFile)));
        assertTrue(postReader.ready());
        String expectationResultData = "testMergeFile14_src1.txtデータ";
        String data = "";
        for (int i = 0; i < expectationResultData.length(); i++) {
            assertTrue(i + "回目の判定で失敗しました。", postReader.ready());
            data += (char) postReader.read();
        }
        assertEquals(expectationResultData, data);
        assertFalse(postReader.ready());
    } finally {
        if (testSrcFile1FileWriter != null) {
            testSrcFile1FileWriter.close();
        }
        if (testSrcFile3FileWriter != null) {
            testSrcFile3FileWriter.close();
        }
        if (postReader != null) {
            postReader.close();
        }
        // テスト後ファイルを削除
        File file = new File(srcFile1);
        file.delete();
        file = new File(srcFile3);
        file.delete();
        file = new File(newFile);
        file.delete();
    }
}