private static boolean containsReference(@Nullable PsiExpression expression) {
    final Predicate<PsiReferenceExpression> referenceToConstant =
      r -> r.resolve() instanceof PsiVariable v && v.hasModifierProperty(PsiModifier.FINAL) && v.hasInitializer();
    return hasMatchingOffspring(expression, PsiReferenceExpression.class, referenceToConstant);
  }
private static boolean containsReference(@Nullable PsiExpression expression)