void (@Nullable String returnType, final String @Nullable [] parameters, final String @Nullable [] exceptions, boolean delegate) { GenParams genParams = parameters == null ? new SimpleParameterGen() : method -> { ParameterInfoImpl[] parameterInfos = new ParameterInfoImpl[parameters.length]; for (int i = 0; i < parameters.length; i++) { PsiType type = myFactory.createTypeFromText(parameters[i], method); parameterInfos[i] = ParameterInfoImpl.createNew().withName("p" + (i + 1)).withType(type); } return parameterInfos; }; GenExceptions genExceptions = exceptions == null ? new SimpleExceptionsGen() : method -> { ThrownExceptionInfo[] exceptionInfos = new ThrownExceptionInfo[exceptions.length]; for (int i = 0; i < exceptions.length; i++) { PsiType type = myFactory.createTypeFromText(exceptions[i], method); exceptionInfos[i] = new JavaThrownExceptionInfo(-1, (PsiClassType)type); } return exceptionInfos; }; doTest(null, null, returnType, genParams, genExceptions, delegate); }