package jp.hrtdotnet.java.util;

import jp.hrtdotnet.java.util.StringUtil;
import junit.framework.TestCase;

public class StringUtilTest extends TestCase {

    /* (非 Javadoc)
     * @see junit.framework.TestCase#setUp()
     */
    protected void setUp() throws Exception {
        super.setUp();
    }

    /* (非 Javadoc)
     * @see junit.framework.TestCase#tearDown()
     */
    protected void tearDown() throws Exception {
        super.tearDown();
    }

    
    /**
     * {@link jp.hrtdotnet.java.util.StringUtil#isAlphabet(char)} のためのテスト・メソッド。
     */
    public void testIsAlphabet_Char() {
        assertTrue(StringUtil.isAlphabet('a'));
        assertTrue(StringUtil.isAlphabet('b'));
        assertTrue(StringUtil.isAlphabet('c'));
        assertTrue(StringUtil.isAlphabet('d'));
        assertTrue(StringUtil.isAlphabet('e'));
        assertTrue(StringUtil.isAlphabet('f'));
        assertTrue(StringUtil.isAlphabet('g'));
        assertTrue(StringUtil.isAlphabet('h'));
        assertTrue(StringUtil.isAlphabet('i'));
        assertTrue(StringUtil.isAlphabet('j'));
        assertTrue(StringUtil.isAlphabet('k'));
        assertTrue(StringUtil.isAlphabet('l'));
        assertTrue(StringUtil.isAlphabet('m'));
        assertTrue(StringUtil.isAlphabet('n'));
        assertTrue(StringUtil.isAlphabet('o'));
        assertTrue(StringUtil.isAlphabet('p'));
        assertTrue(StringUtil.isAlphabet('q'));
        assertTrue(StringUtil.isAlphabet('r'));
        assertTrue(StringUtil.isAlphabet('s'));
        assertTrue(StringUtil.isAlphabet('t'));
        assertTrue(StringUtil.isAlphabet('u'));
        assertTrue(StringUtil.isAlphabet('w'));
        assertTrue(StringUtil.isAlphabet('x'));
        assertTrue(StringUtil.isAlphabet('y'));
        assertTrue(StringUtil.isAlphabet('z'));

        assertTrue(StringUtil.isAlphabet('A'));
        assertTrue(StringUtil.isAlphabet('B'));
        assertTrue(StringUtil.isAlphabet('C'));
        assertTrue(StringUtil.isAlphabet('D'));
        assertTrue(StringUtil.isAlphabet('E'));
        assertTrue(StringUtil.isAlphabet('F'));
        assertTrue(StringUtil.isAlphabet('G'));
        assertTrue(StringUtil.isAlphabet('H'));
        assertTrue(StringUtil.isAlphabet('I'));
        assertTrue(StringUtil.isAlphabet('J'));
        assertTrue(StringUtil.isAlphabet('K'));
        assertTrue(StringUtil.isAlphabet('L'));
        assertTrue(StringUtil.isAlphabet('M'));
        assertTrue(StringUtil.isAlphabet('N'));
        assertTrue(StringUtil.isAlphabet('O'));
        assertTrue(StringUtil.isAlphabet('P'));
        assertTrue(StringUtil.isAlphabet('Q'));
        assertTrue(StringUtil.isAlphabet('R'));
        assertTrue(StringUtil.isAlphabet('S'));
        assertTrue(StringUtil.isAlphabet('T'));
        assertTrue(StringUtil.isAlphabet('U'));
        assertTrue(StringUtil.isAlphabet('W'));
        assertTrue(StringUtil.isAlphabet('X'));
        assertTrue(StringUtil.isAlphabet('Y'));
        assertTrue(StringUtil.isAlphabet('Z'));

        assertTrue(StringUtil.isAlphabet('ａ'));
        assertTrue(StringUtil.isAlphabet('ｂ'));
        assertTrue(StringUtil.isAlphabet('ｃ'));
        assertTrue(StringUtil.isAlphabet('ｄ'));
        assertTrue(StringUtil.isAlphabet('ｅ'));
        assertTrue(StringUtil.isAlphabet('ｆ'));
        assertTrue(StringUtil.isAlphabet('ｇ'));
        assertTrue(StringUtil.isAlphabet('ｈ'));
        assertTrue(StringUtil.isAlphabet('ｉ'));
        assertTrue(StringUtil.isAlphabet('ｊ'));
        assertTrue(StringUtil.isAlphabet('ｋ'));
        assertTrue(StringUtil.isAlphabet('ｌ'));
        assertTrue(StringUtil.isAlphabet('ｍ'));
        assertTrue(StringUtil.isAlphabet('ｎ'));
        assertTrue(StringUtil.isAlphabet('ｏ'));
        assertTrue(StringUtil.isAlphabet('ｐ'));
        assertTrue(StringUtil.isAlphabet('ｑ'));
        assertTrue(StringUtil.isAlphabet('ｒ'));
        assertTrue(StringUtil.isAlphabet('ｓ'));
        assertTrue(StringUtil.isAlphabet('ｔ'));
        assertTrue(StringUtil.isAlphabet('ｕ'));
        assertTrue(StringUtil.isAlphabet('ｗ'));
        assertTrue(StringUtil.isAlphabet('ｘ'));
        assertTrue(StringUtil.isAlphabet('ｙ'));
        assertTrue(StringUtil.isAlphabet('ｚ'));

        assertTrue(StringUtil.isAlphabet('Ａ'));
        assertTrue(StringUtil.isAlphabet('Ｂ'));
        assertTrue(StringUtil.isAlphabet('Ｃ'));
        assertTrue(StringUtil.isAlphabet('Ｄ'));
        assertTrue(StringUtil.isAlphabet('Ｅ'));
        assertTrue(StringUtil.isAlphabet('Ｆ'));
        assertTrue(StringUtil.isAlphabet('Ｇ'));
        assertTrue(StringUtil.isAlphabet('Ｈ'));
        assertTrue(StringUtil.isAlphabet('Ｉ'));
        assertTrue(StringUtil.isAlphabet('Ｊ'));
        assertTrue(StringUtil.isAlphabet('Ｋ'));
        assertTrue(StringUtil.isAlphabet('Ｌ'));
        assertTrue(StringUtil.isAlphabet('Ｍ'));
        assertTrue(StringUtil.isAlphabet('Ｎ'));
        assertTrue(StringUtil.isAlphabet('Ｏ'));
        assertTrue(StringUtil.isAlphabet('Ｐ'));
        assertTrue(StringUtil.isAlphabet('Ｑ'));
        assertTrue(StringUtil.isAlphabet('Ｒ'));
        assertTrue(StringUtil.isAlphabet('Ｓ'));
        assertTrue(StringUtil.isAlphabet('Ｔ'));
        assertTrue(StringUtil.isAlphabet('Ｕ'));
        assertTrue(StringUtil.isAlphabet('Ｗ'));
        assertTrue(StringUtil.isAlphabet('Ｘ'));
        assertTrue(StringUtil.isAlphabet('Ｙ'));
        assertTrue(StringUtil.isAlphabet('Ｚ'));

        assertFalse(StringUtil.isAlphabet('1'));
    }    

    /**
     * {@link jp.hrtdotnet.java.util.StringUtil#isAlphabet(java.lang.String)} のためのテスト・メソッド。
     */
    public void testIsAlphabet_String() {
        assertTrue(StringUtil.isAlphabet("aAcdfjhaskl"));
        assertFalse(StringUtil.isAlphabet("asdasd1sdakjdlk"));
        assertFalse(StringUtil.isAlphabet(""));
        assertFalse(StringUtil.isAlphabet(null));
    }


    /**
     * {@link jp.hrtdotnet.java.util.StringUtil#includeChar(java.lang.String, char)} のためのテスト・メソッド。
     */
    public void testIncludeChar_StringChar() {
        assertTrue(StringUtil.includeChar("abcdef", 'd'));
        assertFalse(StringUtil.includeChar("abcdef", 'D'));        
        assertFalse(StringUtil.includeChar(null, 'D'));        
        assertFalse(StringUtil.includeChar("", 'D'));        
    }
    
    /**
     * {@link jp.hrtdotnet.java.util.StringUtil#includeChar(java.lang.String, char, boolean)} のためのテスト・メソッド。
     */
    public void testIncludeChar_StringCharBoolean() {
        assertTrue(StringUtil.includeChar("abcdef", 'd', true));
        assertFalse(StringUtil.includeChar("abcdef", 'D', true));                
        assertTrue(StringUtil.includeChar("abcdef", 'd', false));
        assertTrue(StringUtil.includeChar("abcdef", 'D', false));                
        assertFalse(StringUtil.includeChar("abcdef", 'l',  true));                
        assertFalse(StringUtil.includeChar("", 'l',  true));                
        assertFalse(StringUtil.includeChar(null, 'l',  true));                
    }

    /**
     * {@link jp.hrtdotnet.java.util.StringUtil#checkFrontSpace(java.lang.String)} のためのテスト・メソッド。
     */
    public void testCheckFrontSpace_String() {
        assertTrue(StringUtil.checkFrontSpace(" aaaa"));
        assertFalse(StringUtil.checkFrontSpace("　aaaa"));
    }

    /**
     * {@link jp.hrtdotnet.java.util.StringUtil#checkFrontSpace(java.lang.String, boolean)} のためのテスト・メソッド。
     */
    public void testCheckFrontSpace_StringBoolean() {
        assertTrue(StringUtil.checkFrontSpace(" aaaa", true));
        assertTrue(StringUtil.checkFrontSpace("　aaaa", true));
        assertFalse(StringUtil.checkFrontSpace("abcdef", true));                
        assertTrue(StringUtil.checkFrontSpace(" aaaa", false));
        assertFalse(StringUtil.checkFrontSpace("　aaaa", false));
        assertFalse(StringUtil.checkFrontSpace("abcdef", false));                
        assertFalse(StringUtil.checkFrontSpace(null, true));
    }

    /**
     * {@link jp.hrtdotnet.java.util.StringUtil#checkRearSpace(java.lang.String)} のためのテスト・メソッド。
     */
    public void testCheckRearSpace_String() {
        assertTrue(StringUtil.checkRearSpace("aaaa "));
        assertFalse(StringUtil.checkRearSpace("aaaa　"));
    }

    /**
     * {@link jp.hrtdotnet.java.util.StringUtil#checkRearSpace(java.lang.String, boolean)} のためのテスト・メソッド。
     */
    public void testCheckRearSpace_StringBoolean() {
        assertTrue(StringUtil.checkRearSpace("aaaa ", true));
        assertTrue(StringUtil.checkRearSpace("aaaa　", true));
        assertFalse(StringUtil.checkRearSpace("abcdef", true));                
        assertTrue(StringUtil.checkRearSpace("aaaa ", false));
        assertFalse(StringUtil.checkRearSpace("aaaa　", false));
        assertFalse(StringUtil.checkRearSpace("abcdef", false));                
        assertFalse(StringUtil.checkRearSpace(null, true));
    }

    /**
     * {@link jp.hrtdotnet.java.util.StringUtil#toSingleByteChar(char)} のためのテスト・メソッド。
     */
    public void testToSingleByteChar() {
        assertEquals(StringUtil.toSingleByteChar('Ａ'), 'A');
        assertEquals(StringUtil.toSingleByteChar('Ｂ'), 'B');
        assertEquals(StringUtil.toSingleByteChar('Ｃ'), 'C');
        assertEquals(StringUtil.toSingleByteChar('Ｄ'), 'D');
        assertEquals(StringUtil.toSingleByteChar('Ｅ'), 'E');
        assertEquals(StringUtil.toSingleByteChar('Ｆ'), 'F');
        assertEquals(StringUtil.toSingleByteChar('Ｇ'), 'G');
        assertEquals(StringUtil.toSingleByteChar('Ｈ'), 'H');
        assertEquals(StringUtil.toSingleByteChar('Ｉ'), 'I');
        assertEquals(StringUtil.toSingleByteChar('Ｊ'), 'J');
        assertEquals(StringUtil.toSingleByteChar('Ｋ'), 'K');
        assertEquals(StringUtil.toSingleByteChar('Ｌ'), 'L');
        assertEquals(StringUtil.toSingleByteChar('Ｍ'), 'M');
        assertEquals(StringUtil.toSingleByteChar('Ｎ'), 'N');
        assertEquals(StringUtil.toSingleByteChar('Ｏ'), 'O');
        assertEquals(StringUtil.toSingleByteChar('Ｐ'), 'P');
        assertEquals(StringUtil.toSingleByteChar('Ｑ'), 'Q');
        assertEquals(StringUtil.toSingleByteChar('Ｒ'), 'R');
        assertEquals(StringUtil.toSingleByteChar('Ｓ'), 'S');
        assertEquals(StringUtil.toSingleByteChar('Ｔ'), 'T');
        assertEquals(StringUtil.toSingleByteChar('Ｕ'), 'U');
        assertEquals(StringUtil.toSingleByteChar('Ｖ'), 'V');
        assertEquals(StringUtil.toSingleByteChar('Ｗ'), 'W');
        assertEquals(StringUtil.toSingleByteChar('Ｘ'), 'X');
        assertEquals(StringUtil.toSingleByteChar('Ｙ'), 'Y');
        assertEquals(StringUtil.toSingleByteChar('Ｚ'), 'Z');

        assertEquals(StringUtil.toSingleByteChar('ａ'), 'a');
        assertEquals(StringUtil.toSingleByteChar('ｂ'), 'b');
        assertEquals(StringUtil.toSingleByteChar('ｃ'), 'c');
        assertEquals(StringUtil.toSingleByteChar('ｄ'), 'd');
        assertEquals(StringUtil.toSingleByteChar('ｅ'), 'e');
        assertEquals(StringUtil.toSingleByteChar('ｆ'), 'f');
        assertEquals(StringUtil.toSingleByteChar('ｇ'), 'g');
        assertEquals(StringUtil.toSingleByteChar('ｈ'), 'h');
        assertEquals(StringUtil.toSingleByteChar('ｉ'), 'i');
        assertEquals(StringUtil.toSingleByteChar('ｊ'), 'j');
        assertEquals(StringUtil.toSingleByteChar('ｋ'), 'k');
        assertEquals(StringUtil.toSingleByteChar('ｌ'), 'l');
        assertEquals(StringUtil.toSingleByteChar('ｍ'), 'm');
        assertEquals(StringUtil.toSingleByteChar('ｎ'), 'n');
        assertEquals(StringUtil.toSingleByteChar('ｏ'), 'o');
        assertEquals(StringUtil.toSingleByteChar('ｐ'), 'p');
        assertEquals(StringUtil.toSingleByteChar('ｑ'), 'q');
        assertEquals(StringUtil.toSingleByteChar('ｒ'), 'r');
        assertEquals(StringUtil.toSingleByteChar('ｓ'), 's');
        assertEquals(StringUtil.toSingleByteChar('ｔ'), 't');
        assertEquals(StringUtil.toSingleByteChar('ｕ'), 'u');
        assertEquals(StringUtil.toSingleByteChar('ｖ'), 'v');
        assertEquals(StringUtil.toSingleByteChar('ｗ'), 'w');
        assertEquals(StringUtil.toSingleByteChar('ｘ'), 'x');
        assertEquals(StringUtil.toSingleByteChar('ｙ'), 'y');
        assertEquals(StringUtil.toSingleByteChar('ｚ'), 'z');

        assertEquals(StringUtil.toSingleByteChar('０'), '0');
        assertEquals(StringUtil.toSingleByteChar('１'), '1');
        assertEquals(StringUtil.toSingleByteChar('２'), '2');
        assertEquals(StringUtil.toSingleByteChar('３'), '3');
        assertEquals(StringUtil.toSingleByteChar('４'), '4');
        assertEquals(StringUtil.toSingleByteChar('５'), '5');
        assertEquals(StringUtil.toSingleByteChar('６'), '6');
        assertEquals(StringUtil.toSingleByteChar('７'), '7');
        assertEquals(StringUtil.toSingleByteChar('８'), '8');
        assertEquals(StringUtil.toSingleByteChar('９'), '9');

        assertEquals(StringUtil.toSingleByteChar('−'), '-');

        try {
            StringUtil.toSingleByteChar('：');
            fail();
        } catch (IllegalArgumentException e) {
        }
    }

    /**
     * {@link jp.hrtdotnet.java.util.StringUtil#toSingleByteString(java.lang.String)} のためのテスト・メソッド。
     */
    public void testToSingleByteString() {
        assertEquals(StringUtil.toSingleByteString("ＡＢCＤ"), "ABCD");
        try {
            StringUtil.toSingleByteString("ＡＡ漢字");
            fail();
        } catch (IllegalArgumentException e) {
        }
        try {
            StringUtil.toSingleByteString("");
            fail();
        } catch (IllegalArgumentException e) {
        }
        try {
            StringUtil.toSingleByteString(null);
            fail();
        } catch (NullPointerException e) {
        }
    }

    /**
     * {@link jp.hrtdotnet.java.util.StringUtil#toUnicodeHexMultiByte(java.lang.String)} のためのテスト・メソッド。
     */
    public void testToUnicodeHexMultiByte() {
        assertEquals(StringUtil.toUnicodeHexMultiByte("ＡＡAA"), "\\uff21\\uff21AA");
        assertEquals(StringUtil.toUnicodeHexMultiByte("ＡＡＡＡ"), "\\uff21\\uff21\\uff21\\uff21");
        assertEquals(StringUtil.toUnicodeHexMultiByte("AAAA"), "AAAA");
        assertEquals(StringUtil.toUnicodeHexMultiByte(""), "");
        assertNull(StringUtil.toUnicodeHexMultiByte(null));                
    }

    /**
     * {@link jp.hrtdotnet.java.util.StringUtil#toUnicodeHex(java.lang.String)} のためのテスト・メソッド。
     */
    public void testToUnicodeHex() {
        assertEquals(StringUtil.toUnicodeHex("ＡＡAA"), "\\uff21\\uff21\\u0041\\u0041");
    }

    /**
     * {@link jp.hrtdotnet.java.util.StringUtil#toUnicodeString(java.lang.String)} のためのテスト・メソッド。
     */
    public void testToUnicodeString() {
        assertEquals(StringUtil.toUnicodeString("\\uff21\\uff21\\u0041\\u0041"), "ＡＡAA");
        assertEquals(StringUtil.toUnicodeString("\\uff21\\uff21\\u0041\\u004"), "ＡＡA\\u004");
        assertEquals(StringUtil.toUnicodeString("\\uff21\\uff21\\u004\\u0041"), "ＡＡ\\u004A");
        assertEquals(StringUtil.toUnicodeString("\\uff21\\uff21\\uuuuuuuuu0041\\u0041"), "ＡＡAA");
        assertEquals(StringUtil.toUnicodeString(""), "");        
        assertNull(StringUtil.toUnicodeString(null));        
    }

    /**
     * {@link jp.hrtdotnet.java.util.StringUtil#csvSplit(java.lang.String, java.lang.String)} のためのテスト・メソッド。
     */
    public void testCsvSplit_StringString() {
        String[] array = StringUtil.csvSplit("123,456,789", ",");
        String[] array2 = new String[] { "123", "456", "789" };
        for (int i = 0; i < array.length; i++) {
            assertEquals(array[i], array2[i]);
        }

        array = StringUtil.csvSplit("", ",");
        array2 = new String[] { "" };
        for (int i = 0; i < array.length; i++) {
            assertEquals(array[i], array2[i]);
        }
        
        array = StringUtil.csvSplit("\"123,456\",789", ",");
        array2 = new String[] { "123,456", "789" };
        for (int i = 0; i < array.length; i++) {
            assertEquals(array[i], array2[i]);
        }
    
        array = StringUtil.csvSplit("\"12\"\"3\"\",456\",789", ",");
        array2 = new String[]{"12\"3\",456","789"};
        for (int i = 0; i < array.length; i++) {
            assertEquals(array[i], array2[i]);
        }
        
        array = StringUtil.csvSplit("\"\",", ",");
        array2 = new String[] { "\"", "" };
        for (int i = 0; i < array.length; i++) {
            assertEquals(array[i], array2[i]);
        }

        array = StringUtil.csvSplit(null, ",");
        assertNull(array);
        
        array = StringUtil.csvSplit("\"\"", ",");
        array2 = new String[] { "\"" };
        for (int i = 0; i < array.length; i++) {
            assertEquals(array[i], array2[i]);
        }

        array = StringUtil.csvSplit("\"123,456,789", ",");
        array2 = new String[] { "123,456,789" };
        for (int i = 0; i < array.length; i++) {
            assertEquals(array[i], array2[i]);
        }
        
        array = StringUtil.csvSplit("123,\"456,789\"", ",");
        array2 = new String[] { "123","456,789" };
        for (int i = 0; i < array.length; i++) {
            assertEquals(array[i], array2[i]);
        }

        array = StringUtil.csvSplit("123,\"456,789", ",");
        array2 = new String[] { "123","456,789" };
        for (int i = 0; i < array.length; i++) {
            assertEquals(array[i], array2[i]);
        }

    }

    /**
     * {@link jp.hrtdotnet.java.util.StringUtil#csvSplit(java.lang.String, java.lang.String, char)} のためのテスト・メソッド。
     */
    public void testCsvSplit_StringStringChar() {
        String[] array = StringUtil.csvSplit("123,456,789", ",", '\'');
        String[] array2 = new String[] { "123", "456", "789" };
        for (int i = 0; i < array.length; i++) {
            assertEquals(array[i], array2[i]);
        }

        array = StringUtil.csvSplit("", ",", '\'');
        array2 = new String[] { "" };
        for (int i = 0; i < array.length; i++) {
            assertEquals(array[i], array2[i]);
        }
        
        array = StringUtil.csvSplit("\'123,456\',789", ",", '\'');
        array2 = new String[] { "123,456", "789" };
        for (int i = 0; i < array.length; i++) {
            assertEquals(array[i], array2[i]);
        }
    
        array = StringUtil.csvSplit("\'12\'\'3\'\',456\',789", ",", '\'');
        array2 = new String[]{"12\'3\',456","789"};
        for (int i = 0; i < array.length; i++) {
            assertEquals(array[i], array2[i]);
        }
        
        array = StringUtil.csvSplit("\'\',", ",", '\'');
        array2 = new String[] { "\'", "" };
        for (int i = 0; i < array.length; i++) {
            assertEquals(array[i], array2[i]);
        }

        array = StringUtil.csvSplit(null, ",", '\'');
        assertNull(array);
        
        array = StringUtil.csvSplit("\'\'", ",", '\'');
        array2 = new String[] { "\'" };
        for (int i = 0; i < array.length; i++) {
            assertEquals(array[i], array2[i]);
        }

        array = StringUtil.csvSplit("\'123,456,789", ",", '\'');
        array2 = new String[] { "123,456,789" };
        for (int i = 0; i < array.length; i++) {
            assertEquals(array[i], array2[i]);
        }
        
        array = StringUtil.csvSplit("123,\'456,789\'", ",", '\'');
        array2 = new String[] { "123","456,789" };
        for (int i = 0; i < array.length; i++) {
            assertEquals(array[i], array2[i]);
        }

        array = StringUtil.csvSplit("123,\'456,789", ",", '\'');
        array2 = new String[] { "123","456,789" };
        for (int i = 0; i < array.length; i++) {
            assertEquals(array[i], array2[i]);
        }
    }

    /**
     * {@link jp.hrtdotnet.java.util.StringUtil#split(java.lang.String, java.lang.String)} のためのテスト・メソッド。
     */
    public void testSplit() {

        String[] array = StringUtil.split("12*34*56", "*");
        String[] array2 = new String[] { "12","34","56" };
        for (int i = 0; i < array.length; i++) {
            assertEquals(array[i], array2[i]);
        }

        array = StringUtil.split("12**34**56", "**");
        array2 = new String[] { "12","34","56" };
        for (int i = 0; i < array.length; i++) {
            assertEquals(array[i], array2[i]);
        }

        array = StringUtil.split("", "delim");
        array2 = new String[] { "" };
        for (int i = 0; i < array.length; i++) {
            assertEquals(array[i], array2[i]);
        }

        array = StringUtil.split("delim", "delim");
        array2 = new String[] { "" };
        for (int i = 0; i < array.length; i++) {
            assertEquals(array[i], array2[i]);
        }

        try {
            StringUtil.split(null, "delim");
            fail();
        } catch (NullPointerException e) {
        }

        try {
            StringUtil.split("moji", null);
            fail();
        } catch (NullPointerException e) {
        }
    }

    /**
     * {@link jp.hrtdotnet.java.util.StringUtil#toBinaryString(int)} のためのテスト・メソッド。
     */
    public void testToBinaryString() {
        assertEquals("00000000000000000000000000001010", StringUtil.toBinaryString(10));
        assertEquals("00000000000000000000000000001011", StringUtil.toBinaryString(11));
        assertEquals("11111111111111111111111111111111", StringUtil.toBinaryString(-1));
    }
    
    /**
     * {@link jp.hrtdotnet.java.util.StringUtil#completeZero(int, int)} のためのテスト・メソッド。
     */
    public void testCompleteZero() {
        assertEquals("00012345", StringUtil.completeZero(12345, 8));

        try {
            StringUtil.completeZero(12345, -8);
            fail();
        } catch (IllegalArgumentException e) {            
        }
    }

}
