boolean (final ObjectReference objRef) { try { Type type = objRef.type(); return type instanceof ClassType && ((ClassType)type).isEnum(); } catch (ObjectCollectedException ignored) { } return false; }