``` class GenericClass<T> where T : Interfac...
# getting-started
p
Copy code
class GenericClass<T> where T : Interface, T : Interface2 {

    fun doSomethingWithT(t: T) {
        t.interfaceMethod()
        t.interface2Method()
    }

    companion object {

        private val instance: GenericClass<*> = ???

        fun <T> getAnInstance(): GenericClass<T> where T : Interface, T : Interface2 {
            return instance as GenericClass<T>
        }

    }

}