String (PsiClass classFromCommon) { VirtualFile virtualFile = PsiUtilCore.getVirtualFile(classFromCommon); if (virtualFile != null) { ProjectFileIndex index = ProjectFileIndex.getInstance(classFromCommon.getProject()); VirtualFile root = index.getClassRootForFile(virtualFile); if (root != null) { VirtualFileSystem fileSystem = root.getFileSystem(); if (fileSystem instanceof JarFileSystem jarFs) { VirtualFile localFile = jarFs.getLocalByEntry(root); if (localFile != null) { String name = localFile.getNameWithoutExtension(); if (name.startsWith("testng-")) { return StringUtil.trimStart(name, "testng-"); } } } } } return null; }