private static @NotNull Bag getParentStatementFeatures(@NotNull PsiElement usage, @NotNull PsiElement context) {
    final PsiElement parentControlStatement =
      PsiTreeUtil.findFirstParent(context, true,
                                  element -> element instanceof PsiConditionalLoopStatement || element instanceof PsiIfStatement);
    if (parentControlStatement instanceof PsiConditionalLoopStatement) {
      final PsiExpression conditionExpression = ((PsiConditionalLoopStatement)parentControlStatement).getCondition();
      if (conditionExpression != null) {
        return new JavaSimilarityFeaturesExtractor(usage ,conditionExpression).getFeatures();
      }
    }
    if (parentControlStatement instanceof PsiIfStatement) {
      final PsiExpression conditionExpression = ((PsiIfStatement)parentControlStatement).getCondition();
      if (conditionExpression != null) {
        return new JavaSimilarityFeaturesExtractor(usage, conditionExpression).getFeatures();
      }
    }
    return Bag.EMPTY_BAG;
  }
private static @NotNull Bag getParentStatementFeatures(@NotNull PsiElement usage, @NotNull PsiElement context)