PrepopulatedCollectionModel (PsiExpression[] args, String type) { if (args.length == 1) { PsiExpression arg = PsiUtil.skipParenthesizedExprDown(args[0]); PsiMethodCallExpression call = tryCast(arg, PsiMethodCallExpression.class); if (ARRAYS_AS_LIST.test(call)) { return new PrepopulatedCollectionModel(Arrays.asList(call.getArgumentList().getExpressions()), Collections.emptyList(), type); } if(arg != null && PsiUtil.isLanguageLevel10OrHigher(arg) && InheritanceUtil.isInheritor(arg.getType(), JAVA_UTIL_COLLECTION)) { return new PrepopulatedCollectionModel(Collections.singletonList(arg), Collections.emptyList(), type, true); } } return null; }