The correct syntax would be:
Enum.class.isAssignableFrom(test.MyEnum.class)
but for enums, here is a more convenient method:
if (someObject.getClass().isEnum()))
Update: for enum items with a body (e. g. that override methods), this won’t actually work.
In that case, use
if (someObject instanceof Enum<?>)
Reference:
Class.isEnum()