scala> def g[T] = 1.asInstanceOf[T]java.lang.ClassCastException: java.lang.Integercannot be cast to java.lang.Stringres0: Int = 1scala>def f = 1.asInstanceOf[String]
f: Str
as TestObject}Caught: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannotcast object '[1, 2, 3, 4, s]' with class 'java.util.ArrayList' to class 'in.ksharma.Test$TestObject', java.lang.Integer, java.lang.I