private static void findReferences(VarExprent varExp, InvocationExprent inv, List<VariablePosition> list) {
    List<Exprent> lstParameters = inv.getLstParameters();
    for (int i = 0; i < lstParameters.size(); i++) {
      Exprent parameter = lstParameters.get(i);
      if (parameter instanceof VarExprent otherVar && varExp.getVarVersionPair().equals(otherVar.getVarVersionPair())) {
        list.add(new VariablePosition(VariablePositionEnum.METHOD_PARAMETER, inv, i));
      }
    }
  }
Searches for where a variable is referenced and returns the context
src/org/jetbrains/java/decompiler/modules/decompiler/IntersectionCastProcessor.java