PsiVariable (PsiStatement statement) { Set<PsiVariable> variables = new HashSet<>(1); if (!findAutoCloseableVariables(statement, variables)) return null; if (variables.isEmpty()) { return null; } else { return ContainerUtil.getFirstItem(variables); } }