PsiMethod (@NotNull PsiClass clazz) { if (!JUnitUtil.isJUnit3TestClass(clazz)) return null; for (PsiMethod each : clazz.getMethods()) { if (each.getName().equals("setUp")) return each; } return null; }