@SuppressWarnings("rawtypes")
@Test
public void testPrintList04() throws Exception {

    // 前処理(ファイル)
    String fileName = TEMP_FILE_NAME;
    // 前処理(試験対象)
    Class<AbstractFileLineWriter_Stub10> clazz = AbstractFileLineWriter_Stub10.class;
    Map<String, ColumnFormatter> columnFormatterMap = new HashMap<String, ColumnFormatter>();
    columnFormatterMap.put("int", new IntColumnFormatter());
    columnFormatterMap.put("java.lang.String", new NullColumnFormatter());
    AbstractFileLineWriter<AbstractFileLineWriter_Stub10> fileLineWriter = new AbstractFileLineWriterImpl01<AbstractFileLineWriter_Stub10>(fileName, clazz, columnFormatterMap);
    Reader postReader = null;
    Writer writer = null;
    try {
        fileLineWriter.init();
        // 前処理(引数)
        List<String> stringList = new ArrayList<String>();
        stringList.add("testPrintList04_data1");
        stringList.add("testPrintList04_data2");
        stringList.add("testPrintList04_data3");
        // 前処理(フィールド)
        ReflectionTestUtils.setField(fileLineWriter, "lineFeedChar", System
                .getProperty("line.separator"));
        ReflectionTestUtils.setField(fileLineWriter, "currentLineCount", 0);
        // テスト実施
        Method method = AbstractFileLineWriter.class.getDeclaredMethod(
                "printList", new Class[] { List.class });
        method.setAccessible(true);
        method.invoke(fileLineWriter, new Object[] { stringList });
        // 判定(状態変化、メソッド)
        // writerをモック化するとテスト対象外の箇所で挙動が変わりテスト実施不可となる。
        // assertEquals(6, VMOUTUtil.getCallCount(Writer.class, "write"));
        // List writeArguments1 = VMOUTUtil.getArguments(Writer.class,
        // "write", 0);
        // assertEquals(1, writeArguments1.size());
        // assertEquals("testPrintList04_data1", writeArguments1.get(0));
        // List writeArguments2 = VMOUTUtil.getArguments(Writer.class,
        // "write", 1);
        // assertEquals(1, writeArguments2.size());
        // String systemLineSeparator = System.getProperty("line.separator");
        // assertEquals(systemLineSeparator, writeArguments2.get(0));
        // List writeArguments3 = VMOUTUtil.getArguments(Writer.class,
        // "write", 2);
        // assertEquals(1, writeArguments3.size());
        // assertEquals("testPrintList04_data2", writeArguments3.get(0));
        // List writeArguments4 = VMOUTUtil.getArguments(Writer.class,
        // "write", 3);
        // assertEquals(1, writeArguments4.size());
        // assertEquals(systemLineSeparator, writeArguments4.get(0));
        // List writeArguments5 = VMOUTUtil.getArguments(Writer.class,
        // "write", 4);
        // assertEquals(1, writeArguments5.size());
        // assertEquals("testPrintList04_data3", writeArguments5.get(0));
        // List writeArguments6 = VMOUTUtil.getArguments(Writer.class,
        // "write", 5);
        // assertEquals(1, writeArguments6.size());
        // assertEquals(systemLineSeparator, writeArguments6.get(0));
        // 判定(ファイル)
        writer = (Writer) ReflectionTestUtils.getField(fileLineWriter,
                "writer");
        writer.flush();
        postReader = new BufferedReader(new InputStreamReader(new FileInputStream(fileName), System
                .getProperty("file.encoding")));
        assertTrue(postReader.ready());
    } finally {
        if (writer != null) {
            writer.close();
        }
        if (postReader != null) {
            postReader.close();
        }
        Field field = AbstractFileLineWriter.class.getDeclaredField(
                "stringConverterCacheMap");
        field.setAccessible(true);
        field.set(AbstractFileLineWriter.class,
                new HashMap<Class, StringConverter>());
    }
}