private static @Nullable DfaValue collectionFactory(DfaCallArguments args,
                                                      DfaMemoryState memState, DfaValueFactory factory,
                                                      PsiMethod method) {
    PsiType type = method.getReturnType();
    if (!(type instanceof PsiClassType)) return null;
    int factor = PsiTypesUtil.classNameEquals(type, JAVA_UTIL_MAP) ? 2 : 1;
    DfaValue size;
    if (method.isVarArgs()) {
      size = ARRAY_LENGTH.createValue(factory, args.myArguments[0]);
    }
    else {
      size = factory.fromDfType(intValue(args.myArguments.length / factor));
    }
    boolean asList = method.getName().equals("asList");
    Mutability mutability = asList ? Mutability.MUTABLE : Mutability.UNMODIFIABLE;
    DfType result = typedObject(type, Nullability.NOT_NULL).meet(mutability.asDfType());
    if (asList) {
      result = result.meet(LOCAL_OBJECT);
    }
    return factory.getWrapperFactory().createWrapper(result, COLLECTION_SIZE, size);
  }
private static @Nullable DfaValue collectionFactory(DfaCallArguments args,
                                                      DfaMemoryState memState, DfaValueFactory factory,
                                                      PsiMethod method)