VirtualFile (@NotNull VirtualFile root, @NotNull String relPath, String @NotNull [] extensions) { VirtualFile file = null; for (String extension : extensions) { file = root.findChild(relPath + '.' + extension); if (file != null) break; } return file; }