PrepopulatedCollectionModel (PsiExpression listDefinition) { listDefinition = PsiUtil.skipParenthesizedExprDown(listDefinition); if(listDefinition instanceof PsiMethodCallExpression call) { if (ARRAYS_AS_LIST.test(call)) { return new PrepopulatedCollectionModel(Arrays.asList(call.getArgumentList().getExpressions()), Collections.emptyList(), "List"); } return fromCollect(call, "List", COLLECTORS_TO_LIST); } if(listDefinition instanceof PsiNewExpression newExpression) { return fromNewExpression(newExpression, "List", JAVA_UTIL_ARRAY_LIST); } if (listDefinition instanceof PsiReferenceExpression ref) { return fromVariable(ref, "List", JAVA_UTIL_ARRAY_LIST, COLLECTION_ADD); } return null; }