code: final Optional<Expression> getTypeAssertion(Expression value, Generator codeGenerator) {
      return predicate.maybeCheck(value, codeGenerator);
    }
docs: Returns a code chunk that generates a 'test' for whether or not the given value has this type,
  or {@link Optional#absent()} if no test is necessary.