List<TestDataFile> (PsiMethod method) { String testName = getTestName(method); if (testName == null) return Collections.emptyList(); PsiClass psiClass = method.getContainingClass(); if (psiClass == null) return Collections.emptyList(); String testDataBasePath = TestDataLineMarkerProvider.getTestDataBasePath(psiClass); int count = 5; PsiMethod prev = PsiTreeUtil.getPrevSiblingOfType(method, PsiMethod.class); while (prev != null && count-- > 0) { List<TestDataFile> testData = guessTestDataBySiblingTest(prev, testDataBasePath, testName); if (!testData.isEmpty()) return testData; prev = PsiTreeUtil.getPrevSiblingOfType(prev, PsiMethod.class); } count = 5; PsiMethod next = PsiTreeUtil.getNextSiblingOfType(method, PsiMethod.class); while (next != null && count-- > 0) { List<TestDataFile> testData = guessTestDataBySiblingTest(next, testDataBasePath, testName); if (!testData.isEmpty()) return testData; next = PsiTreeUtil.getNextSiblingOfType(next, PsiMethod.class); } return Collections.emptyList(); }