### Question:
JavaAliasConverter { public static String toJavaType(String alias) { JavaAliasType result = map.get(alias); if (result != null) { return result.getDefaultJavaType().getName(); } throw new IllegalArgumentException("Can not find java type for alias: " + alias); }  static String toAlias(String javaType); static String toJavaType(String alias); static Map<String, JavaAliasType> map; }### Answer:
@Test public void shouldConvertAliasToJavaType() { Assert.assertEquals(toJavaType(BOOLEAN), Boolean.class.getName()); Assert.assertEquals(toJavaType(STRING), String.class.getName()); Assert.assertEquals(toJavaType(BYTE), Byte.class.getName()); Assert.assertEquals(toJavaType(SHORT), Short.class.getName()); Assert.assertEquals(toJavaType(INTEGER), Integer.class.getName()); Assert.assertEquals(toJavaType(LONG), Long.class.getName()); Assert.assertEquals(toJavaType(BIG_INTEGER), BigInteger.class.getName()); Assert.assertEquals(toJavaType(FLOAT), Float.class.getName()); Assert.assertEquals(toJavaType(DOUBLE), Double.class.getName()); Assert.assertEquals(toJavaType(BIG_DECIMAL), BigDecimal.class.getName()); Assert.assertEquals(toJavaType(DATE), java.util.Date.class.getName()); Assert.assertEquals(toJavaType(TIME), Time.class.getName()); Assert.assertEquals(toJavaType(TIMESTAMP), Timestamp.class.getName()); }
@Test(expected = IllegalArgumentException.class) public void shouldThrowExceptionForInvalidAlias() { toJavaType("invalidType"); }