@Test
public void castToInt() {

    assertEquals(10, TypeUtils.castToInt(Short.valueOf("10")));
    assertEquals(10, TypeUtils.castToInt(Integer.valueOf("10")));
    assertEquals(10, TypeUtils.castToInt("10"));
    assertEquals(10, TypeUtils.castToInt("10", 10));
    assertEquals(10, TypeUtils.castToInt(null, 10));
}