boolean (@Nullable RatedResolveResult input) { if (input == null) { return false; } if (myFilter == null) { return true; // No need to check } final PyElement pyElement = PyUtil.as(input.getElement(), PyElement.class); if (pyElement == null) { return false; } return myFilter.process(pyElement); }