void () { doMultiFileAutoImportTest("Import", fix -> { List<ImportCandidateHolder> candidates = fix.getCandidates(); ImportCandidateHolder importNumpyAsNpVariant = ContainerUtil.find(candidates, c -> { PsiDirectory dir = as(c.getImportable(), PsiDirectory.class); return dir != null && dir.getName().equals("numpy") && "np".equals(c.getAsName()); }); assertNotNull(importNumpyAsNpVariant); List<String> candidateText = ContainerUtil.map(fix.getCandidates(), c -> c.getPresentableText()); assertContainsInRelativeOrder(candidateText, "numpy as np", "pandas.np"); return true; }); }