private static List<VariablePosition> findReferences(VarExprent varExp, RootStatement root) {
    List<VariablePosition> list = new ArrayList<>();
    findReferencesRec(varExp, root, root, list);
    return list;
  }
Searches for where a variable is referenced and returns the context
src/org/jetbrains/java/decompiler/modules/decompiler/IntersectionCastProcessor.java