toObject

Converts a UNO object (struct, exception, sequence, enum or interface) or
an Any containing these types into an UNO object of a specified destination
type.

For interfaces, the argument object is queried for the interface
specified by the type argument. That query (UnoRuntime.queryInterface)
might return null, if the interface is not implemented or a null-ref or a
VOID any is given.