boolean (@NotNull T t, ProcessingContext context) { ParentType current = getParent(t); for (Class<? extends ParentType> type : types) { if (current == null || !type.isInstance(current)) { return false; } current = getParent(current); } return true; }