@Test
public void testConvert() {

    // przykladowa data
    Date d = d("27-04-2012");
    Date d2 = dlong("27-04-2012 16:45:55");
    // przypadki testowe: [argument (Object)][oczekiwana wartosc holdera (Date)]
    Object[][] testCases = {
        {d("27-04-2012"), d},
        {dlong("27-04-2012 16:45:55"), d2},
        {new Timestamp(d.getTime()), d},
        {new java.sql.Date(d.getTime()), d},
        {new GregorianCalendar(2012, 4-1, 27), d},
        {"2012/04/27", d},
        {"27.04.2012", d},
        {"  ", null},
        {null, null}
    };
    // wykonanie testow
    for (Object[] testCase : testCases) {
        Object obj = testCase[0];
        Date expectedValue = (Date) testCase[1];
        assertEquals(expectedValue, type.convert(obj).getDate());
    }
}