Object (@NotNull String dataId, @NotNull AbstractTestProxy testProxy, @NotNull TestFrameworkRunningModel model) { Project project = model.getProperties().getProject(); if (CommonDataKeys.PSI_ELEMENT.is(dataId)) { Location<?> location = testProxy.getLocation(project, model.getProperties().getScope()); PsiElement psiElement = location != null ? location.getPsiElement() : null; return psiElement == null || !psiElement.isValid() ? null : psiElement; } else if (Location.DATA_KEY.is(dataId)) { return testProxy.getLocation(project, model.getProperties().getScope()); } else if (Location.DATA_KEYS.is(dataId)) { AbstractTestProxy[] proxies = AbstractTestProxy.DATA_KEYS.getData(this); return proxies == null ? null : Arrays.stream(proxies) .map(p -> p.getLocation(project, model.getProperties().getScope())) .filter(Objects::nonNull) .toArray(Location[]::new); } else if (PlatformCoreDataKeys.PSI_ELEMENT_ARRAY.is(dataId)) { AbstractTestProxy[] proxies = AbstractTestProxy.DATA_KEYS.getData(this); return proxies == null ? null : Arrays.stream(proxies) .map(p -> p.getLocation(project, model.getProperties().getScope())) .filter(Objects::nonNull).map(l -> l.getPsiElement()) .toArray(PsiElement[]::new); } return null; }