I realized that Class<>#isasignablefrom does not work in cases like this:
public interface Foo {}
public interface Bar extends Foo {}
public class Baz extends Bar {}
var baz = new Baz()
baz::class.isassignablefrom(Foo::class) // Returns false even having Foo as an inheritance
If the class to be verified implements bar and I check with FOO, it will not be true, even if technically is
In my case, I'm doing it in Kotlin
val buz = if (type.isAssignableFrom(IModBusEvent::class.java)) modBus else FORGE_BUS
Always returns the FORGE_BUS, because verification is always false, the classes verified implement interfaces that extend IModBusvEnt instead of implementing it directly, but does not work in this case
Is there any way to make this work?