private static boolean alwaysReturnsConstant(@NotNull PsiCodeBlock body) {
    final PsiStatement statement = ControlFlowUtils.getOnlyStatementInBlock(body);
    if (!(statement instanceof PsiReturnStatement returnStatement)) {
      return false;
    }
    final PsiExpression value = returnStatement.getReturnValue();
    return value != null && PsiUtil.isConstantExpression(value);
  }
private static boolean alwaysReturnsConstant(@NotNull PsiCodeBlock body)