### Question:
StringConverter implements TypeConverter<String> { public String convert(Integer target) { return target.toString(); } StringConverter(); String convert(Integer target); String convert(Long target); String convert(BigInteger target); String convert(Float target); String convert(Double target); String convert(BigDecimal target); String convert(Date target); String convert(java.sql.Date target); String convert(Timestamp target);  }### Answer:
@Test public void Integerからのconvertテスト() { assertThat(new StringConverter().convert(Integer.valueOf(10)), is("10")); }
@Test public void Longからのconvertテスト() { assertThat(new StringConverter().convert(Long.valueOf(10)), is("10")); }
@Test public void BigIntegerからのconvertテスト() { assertThat(new StringConverter().convert(BigInteger.valueOf(10)), is("10")); }
@Test public void Floatからのconvertテスト() { assertThat(new StringConverter().convert(Float.valueOf(10.9F)), is("10.9")); }
@Test public void Doubleからのconvertテスト() { assertThat(new StringConverter().convert(Double.valueOf(10.9D)), is("10.9")); }
@Test public void BigDecimalからのconvertテスト() { assertThat(new StringConverter().convert(BigDecimal.valueOf(10.9D)), is("10.9")); }
@Test public void Dateからのconvertテスト() throws Exception { SimpleDateFormat sdf = new SimpleDateFormat(); sdf.applyPattern("yyyy/MM/dd HH:mm:ss.SSS"); String ymdhmss = "2011/11/11 13:45:56.789"; assertEquals("2011/11/11", new StringConverter().convert(sdf.parse(ymdhmss))); }
@Test public void SqlDateからのconvertテスト() throws Exception { SimpleDateFormat sdf = new SimpleDateFormat(); sdf.applyPattern("yyyy/MM/dd HH:mm:ss.SSS"); String ymdhmss = "2011/11/11 13:45:56.789"; Date d = sdf.parse(ymdhmss); java.sql.Date sd = new java.sql.Date(d.getTime()); assertEquals("2011/11/11", new StringConverter().convert(sd)); }
@Test public void Timestampからのconvertテスト() throws Exception { SimpleDateFormat sdf = new SimpleDateFormat(); sdf.applyPattern("yyyy/MM/dd HH:mm:ss.SSS"); String ymdhmss = "2011/11/11 13:45:56.789"; Date d = sdf.parse(ymdhmss); Timestamp ts = new Timestamp(d.getTime()); assertEquals("2011/11/11 13:45:56", new StringConverter().convert(ts)); }