I’m working with Robolectric, and in the Robolectric class there is a static method:
public static <P, R> P shadowOf_(R instance) {
return (P) ShadowWrangler.getInstance().shadowOf(instance);
}
I’ve come from a long time C# Generics background so I could be thinking of this incorrectly. My first instinct was to utilize this as such:
Robolectric.shadowOf_<MyShadow>(myInstance).foo();
However, this does not compile (plus, to me and my C# generics background, it doesnt look right).
How can I use this method?
I believe you need:
where
Xis whatever the type ofmyInstanceis.