    private String sourceFolder() {
        ArrayList<String> underscoredWords = new ArrayList<>();
        for (String word : moduleName.split("\\.")) {
            underscoredWords.add(underscore(word));
        }
        return ("lib/" + join("/", underscoredWords)).replace('/', File.separatorChar);
    }

    private String sourceFolder() {
        ArrayList<String> underscoredWords = new ArrayList<String>();
        for (String word : moduleName.split("\\.")) {
            underscoredWords.add(underscore(word));
        }
        return ("lib/" + join("/", underscoredWords)).replace('/', File.separatorChar);
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method private sourceFolder() : String from class org.openapitools.codegen.languages.ElixirClientCodegen


    public AbstractTypeScriptClientCodegen() {
        super();

        // clear import mapping (from default generator) as TS does not use it
        // at the moment
        importMapping.clear();

        supportsInheritance = true;

        // to support multiple inheritance e.g. export interface ModelC extends ModelA, ModelB
        //supportsMultipleInheritance = true;

        // NOTE: TypeScript uses camel cased reserved words, while models are title cased. We don't want lowercase comparisons.
        reservedWords.addAll(Arrays.asList(
                // local variable names used in API methods (endpoints)
                "varLocalPath", "queryParameters", "headerParams", "formParams", "useFormData", "varLocalDeferred",
                "requestOptions",
                // Typescript reserved words
                "abstract", "await", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue", "debugger", "default", "delete", "do", "double", "else", "enum", "export", "extends", "false", "final", "finally", "float", "for", "function", "goto", "if", "implements", "import", "in", "instanceof", "int", "interface", "let", "long", "native", "new", "null", "package", "private", "protected", "public", "return", "short", "static", "super", "switch", "synchronized", "this", "throw", "transient", "true", "try", "typeof", "var", "void", "volatile", "while", "with", "yield"));

        languageSpecificPrimitives = new HashSet<>(Arrays.asList(
                "string",
                "String",
                "boolean",
                "Boolean",
                "Double",
                "Integer",
                "Long",
                "Float",
                "Object",
                "Array",
                "Date",
                "number",
                "any",
                "File",
                "Error",
                "Map",
                "object"
        ));

        languageGenericTypes = new HashSet<>(Arrays.asList(
                "Array"
        ));

        instantiationTypes.put("array", "Array");

        typeMapping = new HashMap<String, String>();
        typeMapping.put("Array", "Array");
        typeMapping.put("array", "Array");
        typeMapping.put("List", "Array");
        typeMapping.put("boolean", "boolean");
        typeMapping.put("string", "string");
        typeMapping.put("int", "number");
        typeMapping.put("float", "number");
        typeMapping.put("number", "number");
        typeMapping.put("long", "number");
        typeMapping.put("short", "number");
        typeMapping.put("char", "string");
        typeMapping.put("double", "number");
        typeMapping.put("object", "object");
        typeMapping.put("integer", "number");
        typeMapping.put("Map", "any");
        typeMapping.put("map", "any");
        typeMapping.put("date", "string");
        typeMapping.put("DateTime", "Date");
        typeMapping.put("binary", "any");
        typeMapping.put("File", "any");
        typeMapping.put("ByteArray", "string");
        typeMapping.put("UUID", "string");
        typeMapping.put("Error", "Error");

        cliOptions.add(new CliOption(CodegenConstants.MODEL_PROPERTY_NAMING, CodegenConstants.MODEL_PROPERTY_NAMING_DESC).defaultValue("camelCase"));
        cliOptions.add(new CliOption(CodegenConstants.SUPPORTS_ES6, CodegenConstants.SUPPORTS_ES6_DESC).defaultValue("false"));

    }

    public AbstractTypeScriptClientCodegen() {
        super();

        // clear import mapping (from default generator) as TS does not use it
        // at the moment
        importMapping.clear();

        supportsInheritance = true;

        // to support multiple inheritance e.g. export interface ModelC extends ModelA, ModelB
        //supportsMultipleInheritance = true;

        // NOTE: TypeScript uses camel cased reserved words, while models are title cased. We don't want lowercase comparisons.
        reservedWords.addAll(Arrays.asList(
                // local variable names used in API methods (endpoints)
                "varLocalPath", "queryParameters", "headerParams", "formParams", "useFormData", "varLocalDeferred",
                "requestOptions",
                // Typescript reserved words
                "abstract", "await", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue", "debugger", "default", "delete", "do", "double", "else", "enum", "export", "extends", "false", "final", "finally", "float", "for", "function", "goto", "if", "implements", "import", "in", "instanceof", "int", "interface", "let", "long", "native", "new", "null", "package", "private", "protected", "public", "return", "short", "static", "super", "switch", "synchronized", "this", "throw", "transient", "true", "try", "typeof", "var", "void", "volatile", "while", "with", "yield"));

        languageSpecificPrimitives = new HashSet<>(Arrays.asList(
                "string",
                "String",
                "boolean",
                "Boolean",
                "Double",
                "Integer",
                "Long",
                "Float",
                "Object",
                "Array",
                "Date",
                "number",
                "any",
                "File",
                "Error",
                "Map",
                "object"
        ));

        languageGenericTypes = new HashSet<String>(Arrays.asList(
                "Array"
        ));

        instantiationTypes.put("array", "Array");

        typeMapping = new HashMap<String, String>();
        typeMapping.put("Array", "Array");
        typeMapping.put("array", "Array");
        typeMapping.put("List", "Array");
        typeMapping.put("boolean", "boolean");
        typeMapping.put("string", "string");
        typeMapping.put("int", "number");
        typeMapping.put("float", "number");
        typeMapping.put("number", "number");
        typeMapping.put("long", "number");
        typeMapping.put("short", "number");
        typeMapping.put("char", "string");
        typeMapping.put("double", "number");
        typeMapping.put("object", "object");
        typeMapping.put("integer", "number");
        typeMapping.put("Map", "any");
        typeMapping.put("map", "any");
        typeMapping.put("date", "string");
        typeMapping.put("DateTime", "Date");
        typeMapping.put("binary", "any");
        typeMapping.put("File", "any");
        typeMapping.put("ByteArray", "string");
        typeMapping.put("UUID", "string");
        typeMapping.put("Error", "Error");

        cliOptions.add(new CliOption(CodegenConstants.MODEL_PROPERTY_NAMING, CodegenConstants.MODEL_PROPERTY_NAMING_DESC).defaultValue("camelCase"));
        cliOptions.add(new CliOption(CodegenConstants.SUPPORTS_ES6, CodegenConstants.SUPPORTS_ES6_DESC).defaultValue("false"));

    }

Replace Generic With Diamond HashSet<String> with HashSet<> in method public AbstractTypeScriptClientCodegen() from class org.openapitools.codegen.languages.AbstractTypeScriptClientCodegen


    @SuppressWarnings("unchecked")
    @Override
    public Map<String, Object> postProcessOperationsWithModels(Map<String, Object> objs, List<Object> allModels) {
        // Generate and store argument list string of each operation into
        // vendor-extension: x-codegen-argList.
        Map<String, Object> operations = (Map<String, Object>) objs.get("operations");
        if (operations != null) {
            List<CodegenOperation> ops = (List<CodegenOperation>) operations.get("operation");
            for (CodegenOperation operation : ops) {
                List<String> argList = new ArrayList<>();
                boolean hasOptionalParams = false;
                for (CodegenParameter p : operation.allParams) {
                    if (p.required) {
                        argList.add(p.paramName);
                    } else {
                        hasOptionalParams = true;
                    }
                }

                if (operation.servers != null && !operation.servers.isEmpty()) {
                    // add optional parameter for servers (e.g. index)
                    hasOptionalParams = true;
                }

                if (hasOptionalParams) {
                    argList.add("opts");
                }

                if (!usePromises) {
                    argList.add("callback");
                }
                operation.vendorExtensions.put("x-codegen-argList", StringUtils.join(argList, ", "));
                operation.vendorExtensions.put("x-codegen-hasOptionalParams", hasOptionalParams);

                // Store JSDoc type specification into vendor-extension: x-jsdoc-type.
                for (CodegenParameter cp : operation.allParams) {
                    String jsdocType = getJSDocType(cp);
                    cp.vendorExtensions.put("x-jsdoc-type", jsdocType);
                }
                String jsdocType = getJSDocType(operation);
                operation.vendorExtensions.put("x-jsdoc-type", jsdocType);

                // Format the return type correctly
                if (operation.returnType != null) {
                    operation.vendorExtensions.put("x-return-type", normalizeType(operation.returnType));
                }
            }
        }
        return objs;
    }

    @SuppressWarnings("unchecked")
    @Override
    public Map<String, Object> postProcessOperationsWithModels(Map<String, Object> objs, List<Object> allModels) {
        // Generate and store argument list string of each operation into
        // vendor-extension: x-codegen-argList.
        Map<String, Object> operations = (Map<String, Object>) objs.get("operations");
        if (operations != null) {
            List<CodegenOperation> ops = (List<CodegenOperation>) operations.get("operation");
            for (CodegenOperation operation : ops) {
                List<String> argList = new ArrayList<String>();
                boolean hasOptionalParams = false;
                for (CodegenParameter p : operation.allParams) {
                    if (p.required) {
                        argList.add(p.paramName);
                    } else {
                        hasOptionalParams = true;
                    }
                }

                if (operation.servers != null && !operation.servers.isEmpty()) {
                    // add optional parameter for servers (e.g. index)
                    hasOptionalParams = true;
                }

                if (hasOptionalParams) {
                    argList.add("opts");
                }

                if (!usePromises) {
                    argList.add("callback");
                }
                operation.vendorExtensions.put("x-codegen-argList", StringUtils.join(argList, ", "));
                operation.vendorExtensions.put("x-codegen-hasOptionalParams", hasOptionalParams);

                // Store JSDoc type specification into vendor-extension: x-jsdoc-type.
                for (CodegenParameter cp : operation.allParams) {
                    String jsdocType = getJSDocType(cp);
                    cp.vendorExtensions.put("x-jsdoc-type", jsdocType);
                }
                String jsdocType = getJSDocType(operation);
                operation.vendorExtensions.put("x-jsdoc-type", jsdocType);

                // Format the return type correctly
                if (operation.returnType != null) {
                    operation.vendorExtensions.put("x-return-type", normalizeType(operation.returnType));
                }
            }
        }
        return objs;
    }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public postProcessOperationsWithModels(objs Map<String,Object>, allModels List<Object>) : Map<String,Object> from class org.openapitools.codegen.languages.JavascriptClientCodegen


    @SuppressWarnings("unchecked")
    @Override
    public Map<String, Object> postProcessModels(Map<String, Object> objs) {
        objs = super.postProcessModelsEnum(objs);
        List<Object> models = (List<Object>) objs.get("models");
        for (Object _mo : models) {
            Map<String, Object> mo = (Map<String, Object>) _mo;
            CodegenModel cm = (CodegenModel) mo.get("model");

            // Collect each model's required property names in *document order*.
            // NOTE: can't use 'mandatory' as it is built from ModelImpl.getRequired(), which sorts names
            // alphabetically and in any case the document order of 'required' and 'properties' can differ.
            List<CodegenProperty> required = new ArrayList<>();
            List<CodegenProperty> allRequired = supportsInheritance || supportsMixins ? new ArrayList<>() : required;
            cm.vendorExtensions.put("x-required", required);
            cm.vendorExtensions.put("x-all-required", allRequired);

            for (CodegenProperty var : cm.vars) {
                // Add JSDoc @type value for this property.
                String jsDocType = getJSDocType(cm, var);
                var.vendorExtensions.put("x-jsdoc-type", jsDocType);

                if (Boolean.TRUE.equals(var.required)) {
                    required.add(var);
                }
            }

            for (CodegenProperty var : cm.allVars) {
                // Add JSDoc @type value for this property.
                String jsDocType = getJSDocType(cm, var);
                var.vendorExtensions.put("x-jsdoc-type", jsDocType);

                if (Boolean.TRUE.equals(var.required)) {
                    required.add(var);
                }
            }

            if (supportsInheritance || supportsMixins) {
                for (CodegenProperty var : cm.allVars) {
                    if (Boolean.TRUE.equals(var.required)) {
                        allRequired.add(var);
                    }
                }
            }

            // set vendor-extension: x-codegen-hasMoreRequired
            CodegenProperty lastRequired = null;
            for (CodegenProperty var : cm.vars) {
                if (var.required) {
                    lastRequired = var;
                }
            }
            for (CodegenProperty var : cm.vars) {
                Optional.ofNullable(lastRequired).ifPresent(_lastRequired -> {
                    if (var == _lastRequired) {
                        var.vendorExtensions.put("x-codegen-hasMoreRequired", false);
                    } else if (var.required) {
                        var.vendorExtensions.put("x-codegen-hasMoreRequired", true);
                    }
                });
            }
        }
        return objs;
    }

    @SuppressWarnings("unchecked")
    @Override
    public Map<String, Object> postProcessModels(Map<String, Object> objs) {
        objs = super.postProcessModelsEnum(objs);
        List<Object> models = (List<Object>) objs.get("models");
        for (Object _mo : models) {
            Map<String, Object> mo = (Map<String, Object>) _mo;
            CodegenModel cm = (CodegenModel) mo.get("model");

            // Collect each model's required property names in *document order*.
            // NOTE: can't use 'mandatory' as it is built from ModelImpl.getRequired(), which sorts names
            // alphabetically and in any case the document order of 'required' and 'properties' can differ.
            List<CodegenProperty> required = new ArrayList<>();
            List<CodegenProperty> allRequired = supportsInheritance || supportsMixins ? new ArrayList<CodegenProperty>() : required;
            cm.vendorExtensions.put("x-required", required);
            cm.vendorExtensions.put("x-all-required", allRequired);

            for (CodegenProperty var : cm.vars) {
                // Add JSDoc @type value for this property.
                String jsDocType = getJSDocType(cm, var);
                var.vendorExtensions.put("x-jsdoc-type", jsDocType);

                if (Boolean.TRUE.equals(var.required)) {
                    required.add(var);
                }
            }

            for (CodegenProperty var : cm.allVars) {
                // Add JSDoc @type value for this property.
                String jsDocType = getJSDocType(cm, var);
                var.vendorExtensions.put("x-jsdoc-type", jsDocType);

                if (Boolean.TRUE.equals(var.required)) {
                    required.add(var);
                }
            }

            if (supportsInheritance || supportsMixins) {
                for (CodegenProperty var : cm.allVars) {
                    if (Boolean.TRUE.equals(var.required)) {
                        allRequired.add(var);
                    }
                }
            }

            // set vendor-extension: x-codegen-hasMoreRequired
            CodegenProperty lastRequired = null;
            for (CodegenProperty var : cm.vars) {
                if (var.required) {
                    lastRequired = var;
                }
            }
            for (CodegenProperty var : cm.vars) {
                Optional.ofNullable(lastRequired).ifPresent(_lastRequired -> {
                    if (var == _lastRequired) {
                        var.vendorExtensions.put("x-codegen-hasMoreRequired", false);
                    } else if (var.required) {
                        var.vendorExtensions.put("x-codegen-hasMoreRequired", true);
                    }
                });
            }
        }
        return objs;
    }

Replace Generic With Diamond ArrayList<CodegenProperty> with ArrayList<> in method public postProcessModels(objs Map<String,Object>) : Map<String,Object> from class org.openapitools.codegen.languages.JavascriptClientCodegen


  public Pet addTagsItem(Tag tagsItem) {
    if (tags == null) {
      tags = new ArrayList<>();
    }
    tags.add(tagsItem);
    return this;
  }

  public Pet addTagsItem(Tag tagsItem) {
    if (tags == null) {
      tags = new ArrayList<Tag>();
    }
    tags.add(tagsItem);
    return this;
  }

Replace Generic With Diamond ArrayList<Tag> with ArrayList<> in method public addTagsItem(tagsItem Tag) : Pet from class apimodels.Pet


  public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List<BigDecimal> arrayArrayNumberItem) {
    if (arrayArrayNumber == null) {
      arrayArrayNumber = new ArrayList<>();
    }
    arrayArrayNumber.add(arrayArrayNumberItem);
    return this;
  }

  public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List<BigDecimal> arrayArrayNumberItem) {
    if (arrayArrayNumber == null) {
      arrayArrayNumber = new ArrayList<List<BigDecimal>>();
    }
    arrayArrayNumber.add(arrayArrayNumberItem);
    return this;
  }

Replace Generic With Diamond ArrayList<List<BigDecimal>> with ArrayList<> in method public addArrayArrayNumberItem(arrayArrayNumberItem List<BigDecimal>) : ArrayOfArrayOfNumberOnly from class apimodels.ArrayOfArrayOfNumberOnly


  public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) {
    if (arrayNumber == null) {
      arrayNumber = new ArrayList<>();
    }
    arrayNumber.add(arrayNumberItem);
    return this;
  }

  public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) {
    if (arrayNumber == null) {
      arrayNumber = new ArrayList<BigDecimal>();
    }
    arrayNumber.add(arrayNumberItem);
    return this;
  }

Replace Generic With Diamond ArrayList<BigDecimal> with ArrayList<> in method public addArrayNumberItem(arrayNumberItem BigDecimal) : ArrayOfNumberOnly from class apimodels.ArrayOfNumberOnly


  public ArrayTest addArrayOfStringItem(String arrayOfStringItem) {
    if (arrayOfString == null) {
      arrayOfString = new ArrayList<>();
    }
    arrayOfString.add(arrayOfStringItem);
    return this;
  }

  public ArrayTest addArrayOfStringItem(String arrayOfStringItem) {
    if (arrayOfString == null) {
      arrayOfString = new ArrayList<String>();
    }
    arrayOfString.add(arrayOfStringItem);
    return this;
  }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public addArrayOfStringItem(arrayOfStringItem String) : ArrayTest from class apimodels.ArrayTest


  public ArrayTest addArrayArrayOfIntegerItem(List<Long> arrayArrayOfIntegerItem) {
    if (arrayArrayOfInteger == null) {
      arrayArrayOfInteger = new ArrayList<>();
    }
    arrayArrayOfInteger.add(arrayArrayOfIntegerItem);
    return this;
  }

  public ArrayTest addArrayArrayOfIntegerItem(List<Long> arrayArrayOfIntegerItem) {
    if (arrayArrayOfInteger == null) {
      arrayArrayOfInteger = new ArrayList<List<Long>>();
    }
    arrayArrayOfInteger.add(arrayArrayOfIntegerItem);
    return this;
  }

Replace Generic With Diamond ArrayList<List<Long>> with ArrayList<> in method public addArrayArrayOfIntegerItem(arrayArrayOfIntegerItem List<Long>) : ArrayTest from class apimodels.ArrayTest


  public ArrayTest addArrayArrayOfModelItem(List<ReadOnlyFirst> arrayArrayOfModelItem) {
    if (arrayArrayOfModel == null) {
      arrayArrayOfModel = new ArrayList<>();
    }
    arrayArrayOfModel.add(arrayArrayOfModelItem);
    return this;
  }

  public ArrayTest addArrayArrayOfModelItem(List<ReadOnlyFirst> arrayArrayOfModelItem) {
    if (arrayArrayOfModel == null) {
      arrayArrayOfModel = new ArrayList<List<ReadOnlyFirst>>();
    }
    arrayArrayOfModel.add(arrayArrayOfModelItem);
    return this;
  }

Replace Generic With Diamond ArrayList<List<ReadOnlyFirst>> with ArrayList<> in method public addArrayArrayOfModelItem(arrayArrayOfModelItem List<ReadOnlyFirst>) : ArrayTest from class apimodels.ArrayTest


  public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) {
    if (arrayEnum == null) {
      arrayEnum = new ArrayList<>();
    }
    arrayEnum.add(arrayEnumItem);
    return this;
  }

  public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) {
    if (arrayEnum == null) {
      arrayEnum = new ArrayList<ArrayEnumEnum>();
    }
    arrayEnum.add(arrayEnumItem);
    return this;
  }

Replace Generic With Diamond ArrayList<ArrayEnumEnum> with ArrayList<> in method public addArrayEnumItem(arrayEnumItem ArrayEnumEnum) : EnumArrays from class apimodels.EnumArrays


    public AbstractTypeScriptClientCodegen() {
        super();

        // clear import mapping (from default generator) as TS does not use it
        // at the moment
        importMapping.clear();

        supportsInheritance = true;
        setReservedWordsLowerCase(Arrays.asList(
                // local variable names used in API methods (endpoints)
                "varLocalPath", "queryParameters", "headerParams", "formParams", "useFormData", "varLocalDeferred",
                "requestOptions",
                // Typescript reserved words
                "abstract", "await", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue", "debugger", "default", "delete", "do", "double", "else", "enum", "export", "extends", "false", "final", "finally", "float", "for", "function", "goto", "if", "implements", "import", "in", "instanceof", "int", "interface", "let", "long", "native", "new", "null", "package", "private", "protected", "public", "return", "short", "static", "super", "switch", "synchronized", "this", "throw", "transient", "true", "try", "typeof", "var", "void", "volatile", "while", "with", "yield"));

        languageSpecificPrimitives = new HashSet<>(Arrays.asList(
				"string",
				"String",
				"boolean",
				"Boolean",
				"Double",
				"Integer",
				"Long",
				"Float",
				"Object",
				"Array",
				"Date",
				"number",
				"any",
				"File",
				"Error",
				"Map"
				));
        instantiationTypes.put("array", "Array");

        typeMapping = new HashMap<String, String>();
        typeMapping.put("Array", "Array");
        typeMapping.put("array", "Array");
        typeMapping.put("List", "Array");
        typeMapping.put("boolean", "boolean");
        typeMapping.put("string", "string");
        typeMapping.put("int", "number");
        typeMapping.put("float", "number");
        typeMapping.put("number", "number");
        typeMapping.put("long", "number");
        typeMapping.put("short", "number");
        typeMapping.put("char", "string");
        typeMapping.put("double", "number");
        typeMapping.put("object", "any");
        typeMapping.put("integer", "number");
        typeMapping.put("Map", "any");
        typeMapping.put("DateTime", "Date");
        //TODO binary should be mapped to byte array
        // mapped to String as a workaround
        typeMapping.put("binary", "string");
        typeMapping.put("ByteArray", "string");
        typeMapping.put("UUID", "string");
        typeMapping.put("File", "any");
        typeMapping.put("Error", "Error");

        cliOptions.add(new CliOption(CodegenConstants.MODEL_PROPERTY_NAMING, CodegenConstants.MODEL_PROPERTY_NAMING_DESC).defaultValue("camelCase"));
        cliOptions.add(new CliOption(CodegenConstants.SUPPORTS_ES6, CodegenConstants.SUPPORTS_ES6_DESC).defaultValue("false"));

    }

    public AbstractTypeScriptClientCodegen() {
        super();

        // clear import mapping (from default generator) as TS does not use it
        // at the moment
        importMapping.clear();

        supportsInheritance = true;
        setReservedWordsLowerCase(Arrays.asList(
                // local variable names used in API methods (endpoints)
                "varLocalPath", "queryParameters", "headerParams", "formParams", "useFormData", "varLocalDeferred",
                "requestOptions",
                // Typescript reserved words
                "abstract", "await", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue", "debugger", "default", "delete", "do", "double", "else", "enum", "export", "extends", "false", "final", "finally", "float", "for", "function", "goto", "if", "implements", "import", "in", "instanceof", "int", "interface", "let", "long", "native", "new", "null", "package", "private", "protected", "public", "return", "short", "static", "super", "switch", "synchronized", "this", "throw", "transient", "true", "try", "typeof", "var", "void", "volatile", "while", "with", "yield"));

        languageSpecificPrimitives = new HashSet<String>(Arrays.asList(
                "string",
                "String",
                "boolean",
                "Boolean",
                "Double",
                "Integer",
                "Long",
                "Float",
                "Object",
                "Array",
                "Date",
                "number",
                "any",
                "File"
        ));
        instantiationTypes.put("array", "Array");

        typeMapping = new HashMap<String, String>();
        typeMapping.put("Array", "Array");
        typeMapping.put("array", "Array");
        typeMapping.put("List", "Array");
        typeMapping.put("boolean", "boolean");
        typeMapping.put("string", "string");
        typeMapping.put("int", "number");
        typeMapping.put("float", "number");
        typeMapping.put("number", "number");
        typeMapping.put("long", "number");
        typeMapping.put("short", "number");
        typeMapping.put("char", "string");
        typeMapping.put("double", "number");
        typeMapping.put("object", "any");
        typeMapping.put("integer", "number");
        typeMapping.put("Map", "any");
        typeMapping.put("DateTime", "Date");
        //TODO binary should be mapped to byte array
        // mapped to String as a workaround
        typeMapping.put("binary", "string");
        typeMapping.put("ByteArray", "string");
        typeMapping.put("UUID", "string");
        typeMapping.put("File", "any");

        cliOptions.add(new CliOption(CodegenConstants.MODEL_PROPERTY_NAMING, CodegenConstants.MODEL_PROPERTY_NAMING_DESC).defaultValue("camelCase"));
        cliOptions.add(new CliOption(CodegenConstants.SUPPORTS_ES6, CodegenConstants.SUPPORTS_ES6_DESC).defaultValue("false"));

    }

Replace Generic With Diamond HashSet<String> with HashSet<> in method public AbstractTypeScriptClientCodegen() from class io.swagger.codegen.languages.AbstractTypeScriptClientCodegen


    @SuppressWarnings("unchecked")
    public static <T> T newInstance(CodegenModelType type) {
        Class<?> classType = typeMapping.get(type);
        try {
            return (T) (classType != null ? classType : type.getDefaultImplementation()).newInstance();
        } catch (IllegalAccessException | InstantiationException e) {
            throw new RuntimeException(e);
        }
    }

    @SuppressWarnings("unchecked")
    public static <T> T newInstance(CodegenModelType type) {
        Class<?> classType = typeMapping.get(type);
        try {
            return (T) (classType != null ? classType : type.getDefaultImplementation()).newInstance();
        } catch (InstantiationException e) {
            throw new RuntimeException(e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }

Merge Catch [catch(InstantiationException e), catch(IllegalAccessException e)] to catch(IllegalAccessException|InstantiationException e) in method public newInstance(type CodegenModelType) : T from class io.swagger.codegen.CodegenModelFactory


    public static void main(String[] args) {

        final int PORT = 9998;
        final int NUMBER_OF_THREADS = 64;

        Server server = new Server(PORT, NUMBER_OF_THREADS);

        // добавление хендлеров (обработчиков)
        server.addHandler("GET", "/messages", (request, responseStream) -> {
            // TODO: handlers code
            System.out.println("Hello GET");
            System.out.println(request.getQueryParams());

            System.out.println("Значение \"value\" = "
                    + request.getQueryParam("value"));

        });
        server.addHandler("POST", "/messages", (request, responseStream) -> {
            // TODO: handlers code
            System.out.println("Hello POST");
        });

        server.addHandler("GET", "/favicon.ico", (request, responseStream) -> {
            try {
                final var path = "/favicon.ico";
                final var filePath = Path.of(".", "public", path);
                final var mimeType = Files.probeContentType(filePath);
                final var length = Files.size(filePath);
                responseStream.write((
                        "HTTP/1.1 200 OK\r\n" +
                                "Content-Type: " + mimeType + "\r\n" +
                                "Content-Length: " + length + "\r\n" +
                                "Connection: close\r\n" +
                                "\r\n"
                ).getBytes());
                Files.copy(filePath, responseStream);
                System.out.println("favicon.ico sent");
                responseStream.flush();

            } catch (Exception e) {
                System.out.println(e.getMessage());
            }

        });

        server.start();
    }

    public static void main(String[] args) {

        final int PORT = 9999;
        final int NUMBER_OF_THREADS = 64;

        Server server = new Server(PORT, NUMBER_OF_THREADS);

        // добавление хендлеров (обработчиков)
        server.addHandler("GET", "/messages", new Handler() {
            public void handle(Request request, BufferedOutputStream responseStream) {
                // TODO: handlers code
                System.out.println("Hello GET");
            }
        });
        server.addHandler("POST", "/messages", new Handler() {
            public void handle(Request request, BufferedOutputStream responseStream) {
                // TODO: handlers code
                System.out.println("Hello POST");
            }
        });

        server.addHandler("GET", "/favicon.ico", new Handler() {
            public void handle(Request request, BufferedOutputStream responseStream) {
                try {
                    final var path = "/favicon.ico";
                    final var filePath = Path.of(".", "public", path);
                    final var mimeType = Files.probeContentType(filePath);
                    final var length = Files.size(filePath);
                    responseStream.write((
                            "HTTP/1.1 200 OK\r\n" +
                                    "Content-Type: " + mimeType + "\r\n" +
                                    "Content-Length: " + length + "\r\n" +
                                    "Connection: close\r\n" +
                                    "\r\n"
                    ).getBytes());
                    Files.copy(filePath, responseStream);
                    System.out.println("favicon.ico sent");
                    responseStream.flush();

                } catch (Exception e) {
                    System.out.println(e.getMessage());
                }

            }
        });

        server.start();
    }

Replace Anonymous With Lambda ru.netology.Main.main.addHandler.new Handler with (request, responseStream) -> {tryfinal var path="/favicon.ico"; in method public main(args String[]) : void from class ru.netology.Main


	public ExpressionParserErrorListener() {
		errors = new ArrayList<>();
	}

	public ExpressionParserErrorListener() {
		this.errors = new ArrayList<String>();
	}

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public ExpressionParserErrorListener() from class com.ivankatalenic.evaluator.parser.ExpressionParserErrorListener


    Iterator<Command> toCommandIterator(final Deserializer deserializer, final PersistentConfiguration configuration) {
        if (this.walList.isEmpty()) {
            return Iterators.empty();
        }

        return new Iterator<>() {
            private int walCursor = 0;
            private Iterator<Command> currentIterator = walList.get(0).toCommandIterator(deserializer, configuration);

            @Override
            public boolean hasNext() {
                if (currentIterator == null) {
                    return false;
                }

                if (currentIterator.hasNext()) {
                    return true;
                }

                this.walCursor++;
                this.currentIterator = null;

                if (this.walCursor >= walList.size()) {
                    return false;
                } else {
                    currentIterator = walList.get(walCursor).toCommandIterator(deserializer, configuration);
                }

                return hasNext();
            }

            @Override
            public Command next() {
                if (currentIterator == null) {
                    return null;
                }

                return currentIterator.next();
            }
        };
    }

    Iterator<Command> toCommandIterator(final Deserializer deserializer) {
        if (this.walList.isEmpty()) {
            return Iterators.empty();
        }

        return new Iterator<Command>() {
            private int walCursor = 0;
            private Iterator<Command> currentIterator = walList.get(0).toCommandIterator(deserializer);

            @Override
            public boolean hasNext() {
                if (currentIterator == null) {
                    return false;
                }

                if (currentIterator.hasNext()) {
                    return true;
                }

                this.walCursor++;
                this.currentIterator = null;

                if (this.walCursor >= walList.size()) {
                    return false;
                } else {
                    currentIterator = walList.get(walCursor).toCommandIterator(deserializer);
                }

                return hasNext();
            }

            @Override
            public Command next() {
                if (currentIterator == null) {
                    return null;
                }

                return currentIterator.next();
            }
        };
    }

Replace Generic With Diamond Iterator<Command> with Iterator<> in method package toCommandIterator(deserializer Deserializer, configuration PersistentConfiguration) : Iterator<Command> from class com.fuyouj.sword.database.wal.WALs


    @Override
    public boolean process(final Set<? extends TypeElement> annotations, final RoundEnvironment roundEnv) {
        final Set<? extends Element> dataObjectElements = roundEnv.getElementsAnnotatedWith(DataObject.class);

        if (roundEnv.processingOver()) {
            try {
                final JavaFileObject sourceFile = filer.createSourceFile(
                        "com.thingworks.jarvis.persistent.object.AnnotationProcessedDataObjectMapperProvider");

                try (Writer writer = sourceFile.openWriter()) {
                    writer.write("package com.thingworks.jarvis.persistent.object;\n");
                    writer.write('\n');
                    writer.write("import net.thingworks.jarvis.utils.type.ClassUtils;\n");
                    writer.write("import java.util.HashMap;\n");
                    writer.write("import java.util.Map;\n");
                    writer.write("import com.thingworks.jarvis.persistent.object.DataObjectMapperProvider;\n");
                    writer.write('\n');
                    writer.write("public class AnnotationProcessedDataObjectMapperProvider "
                            + "implements DataObjectMapperProvider {\n");
                    writer.write("  private static final Map<String, Class<?>> mapper;\n");
                    writer.write("  static {\n");

                    writer.write("    mapper = new HashMap<>();\n");
                    for (Map.Entry<String, String> entry : collectionNameAndClassMapper.entrySet()) {
                        writer.write(String.format(
                                "    mapper.put(\"%s\", ClassUtils.getClass(\"%s\"));\n", entry.getKey(), entry.getValue())
                        );
                    }
                    writer.write("  }\n");

                    writer.write('\n');

                    writer.write("  @Override\n");
                    writer.write("  public Map<String, Class<?>> getCollectionMapper() {\n");
                    writer.write("    return mapper;\n");
                    writer.write("  }\n");
                    writer.write("}");
                    writer.flush();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
            messager.printMessage(Diagnostic.Kind.WARNING, Objects2.asJsonString(collectionNameAndClassMapper));
            messager.printMessage(Diagnostic.Kind.WARNING, "processing over");
            return false;
        }

        for (Element dataObjectElement : dataObjectElements) {
            this.basicAnnotationTargetCheck(dataObjectElement);

            final Name qualifiedName = ((TypeElement) dataObjectElement).getQualifiedName();
            final String collectionName = dataObjectElement.getAnnotation(DataObject.class).collection();

            this.duplicateAnnotationCheck(collectionNameAndClassMapper, collectionName, qualifiedName);

            collectionNameAndClassMapper.put(collectionName, qualifiedName.toString());
        }

        return false;
    }

    @Override
    public boolean process(final Set<? extends TypeElement> annotations, final RoundEnvironment roundEnv) {
        final Set<? extends Element> dataObjectElements = roundEnv.getElementsAnnotatedWith(DataObject.class);

        if (roundEnv.processingOver()) {
            try {
                final JavaFileObject sourceFile = filer.createSourceFile(
                        "com.thingworks.jarvis.persistent.object.AnnotationProcessedDataObjectMapperProvider");

                final Writer writer = sourceFile.openWriter();

                writer.write("package com.thingworks.jarvis.persistent.object;\n");
                writer.write('\n');
                writer.write("import net.thingworks.jarvis.utils.type.ClassUtils;\n");
                writer.write("import java.util.HashMap;\n");
                writer.write("import java.util.Map;\n");
                writer.write("import com.thingworks.jarvis.persistent.object.DataObjectMapperProvider;\n");
                writer.write('\n');
                writer.write("public class AnnotationProcessedDataObjectMapperProvider "
                        + "implements DataObjectMapperProvider {\n");
                writer.write("  private static final Map<String, Class<?>> mapper;\n");
                writer.write("  static {\n");

                writer.write("    mapper = new HashMap<>();\n");
                for (Map.Entry<String, String> entry : collectionNameAndClassMapper.entrySet()) {
                    writer.write(String.format(
                            "    mapper.put(\"%s\", ClassUtils.getClass(\"%s\"));\n", entry.getKey(), entry.getValue())
                    );
                }
                writer.write("  }\n");

                writer.write('\n');

                writer.write("  @Override\n");
                writer.write("  public Map<String, Class<?>> getCollectionMapper() {\n");
                writer.write("    return mapper;\n");
                writer.write("  }\n");
                writer.write("}");
                writer.flush();
                writer.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
            messager.printMessage(Diagnostic.Kind.WARNING, Objects2.asJsonString(collectionNameAndClassMapper));
            messager.printMessage(Diagnostic.Kind.WARNING, "processing over");
            return false;
        }

        for (Element dataObjectElement : dataObjectElements) {
            this.basicAnnotationTargetCheck(dataObjectElement);

            final Name qualifiedName = ((TypeElement) dataObjectElement).getQualifiedName();
            final String collectionName = dataObjectElement.getAnnotation(DataObject.class).collection();

            this.duplicateAnnotationCheck(collectionNameAndClassMapper, collectionName, qualifiedName);

            collectionNameAndClassMapper.put(collectionName, qualifiedName.toString());
        }

        return false;
    }

Try With Resources try(Writer writer=sourceFile.openWriter()) in method public process(annotations Set<? extends TypeElement>, roundEnv RoundEnvironment) : boolean from class com.fuyouj.sword.database.processor.DataObjectProcessor


    public void showProgress(final String file){
        SwingUtilities.invokeLater(() -> model.addElement(file));
    }

    public void showProgress(final String file){
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                model.addElement(file);
            }
        });
    }

Replace Anonymous With Lambda org.bric.gui.inputOutput.ProgressBarFrame.showProgress.invokeLater.new Runnable with () -> model.addElement(file) in method public showProgress(file String) : void from class org.bric.gui.inputOutput.ProgressBarFrame


    public void importImages(){
        imagesList = readImages();

        if(imagesList == Collections.EMPTY_LIST){
            return;
        }

        Thread a  = new Thread(() -> {
            final ProgressBarFrame importer = new ProgressBarFrame();
            importer.setImagesCount(imagesList.size());
            importer.setVisible(true);

            int processors;
            if(Utils.prefs.getInt("importNumThreads", 0) == 0){
                processors = Runtime.getRuntime().availableProcessors();
            } else {
                processors = Utils.prefs.getInt("importNumThreads", 1);
            }
            final int step = (int) Math.ceil((double) imagesList.size() / processors);

            for (int j = 0; j < imagesList.size(); j += step) {
                importImageThread(importer, j, step);
            }
        });
        a.start();
    }

    public void importImages(){
        imagesList = readImages();

        if(imagesList == Collections.EMPTY_LIST){
            return;
        }

        Thread a  = new Thread(new Runnable() {

            @Override
            public void run() {
                final ProgressBarFrame importer = new ProgressBarFrame();
                importer.setImagesCount(imagesList.size());
                importer.setVisible(true);

                int processors;
                if(Utils.prefs.getInt("importNumThreads", 0) == 0){
                    processors = Runtime.getRuntime().availableProcessors();
                } else {
                    processors = Utils.prefs.getInt("importNumThreads", 1);
                }
                final int step = (int) Math.ceil((double) imagesList.size() / processors);

                for (int j = 0; j < imagesList.size(); j += step) {
                    importImageThread(importer, j, step);
                }
            }
        });
        a.start();
    }

Replace Anonymous With Lambda org.bric.gui.BricUI.importImages.a.new Thread.new Runnable with () -> {final ProgressBarFrame importer=new ProgressBarFrame(); in method public importImages() : void from class org.bric.gui.BricUI


    private void importImageThread(final ProgressBarFrame importer, final int from, final int step) {
        new Thread(() -> {
            for (int i = from; i < from + step; i++) {
                if (!importer.isVisible()) {
                    return;
                }
                if (i < imagesList.size()) {

                    if (hash.contains(imagesList.get(i))) {
                        duplicatePane(imagesList.get(i));
                    }

                    if (duplicateAction == Utils.REPLACE || duplicateAction == Utils.REPLACE_ALL || !hash.contains(imagesList.get(i))) {
                        ImportedImage im = new ImportedImage( imagesList.get(i) );
                        if(!im.isCorrupted()){
                            addToModel(im);
                            importer.updateValue(true);
                        }else{
                            importer.updateValue(false);
                        }
                    } else {
                        importer.updateValue(true);
                    }

                    importer.showProgress(imagesList.get(i));
                } else {
                    break;
                }
            }

        }).start();
    }

    private void importImageThread(final ProgressBarFrame importer, final int from, final int step) {
        new Thread(new Runnable() {

            @Override
            public void run() {
                for (int i = from; i < from + step; i++) {
                    if (!importer.isVisible()) {
                        return;
                    }
                    if (i < imagesList.size()) {

                        if (hash.contains(imagesList.get(i))) {
                            duplicatePane(imagesList.get(i));
                        }

                        if (duplicateAction == Utils.REPLACE || duplicateAction == Utils.REPLACE_ALL || !hash.contains(imagesList.get(i))) {
                            ImportedImage im = new ImportedImage( imagesList.get(i) );
                            if(!im.isCorrupted()){
                                addToModel(im);
                                importer.updateValue(true);
                            }else{
                                importer.updateValue(false);
                            }
                        } else {
                            importer.updateValue(true);
                        }

                        importer.showProgress(imagesList.get(i));
                    } else {
                        break;
                    }
                }

            }
        }).start();
    }

Replace Anonymous With Lambda org.bric.gui.BricUI.importImageThread.start.new Thread.new Runnable with () -> {for(int i=from; i < from + step; i++){if(!importer.isVisible()){return; in method private importImageThread(importer ProgressBarFrame, from int, step int) : void from class org.bric.gui.BricUI


    public synchronized void addToModel(final ImportedImage im) {
        SwingUtilities.invokeLater(() -> {
            if(hash.contains(im.getPath())){
                model.removeElement(im);
            } else {
                hash.add(im.getPath());
            }
            model.addElement(im);
            updateItemsLabel();
        });
    }

    public synchronized void addToModel(final ImportedImage im) {
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                if(hash.contains(im.getPath())){
                    model.removeElement(im);
                } else {
                    hash.add(im.getPath());
                }
                model.addElement(im);
                updateItemsLabel();
            }
        });
    }

Replace Anonymous With Lambda org.bric.gui.BricUI.addToModel.invokeLater.new Runnable with () -> {if(hash.contains(im.getPath())){model.removeElement(im); in method public addToModel(im ImportedImage) : void from class org.bric.gui.BricUI


    public void startProcess(final boolean preview){
        new Thread(() -> {
            OutputParameters outputParameters = outputTab.getImageEditParameters();
            ResizeParameters resizeParameters = null;
            RotateParameters rotateParameters = null;
            WatermarkParameters watermarkParameters = null;

            for (int i = 0; i < editPane.getComponentCount(); i++) {
                TabParameters tabParameters = ((ImageEditTab) editPane.getComponentAt(i)).getImageEditParameters();
                if (tabParameters instanceof ResizeParameters) {
                    resizeParameters = (ResizeParameters) tabParameters;
                } else if (tabParameters instanceof RotateParameters) {
                    rotateParameters = (RotateParameters) tabParameters;
                } else if (tabParameters instanceof WatermarkParameters) {
                    watermarkParameters = (WatermarkParameters) tabParameters;
                }
            }

            ImageProcessHandler mainProcess;
            if(preview){
                ImportedImage imageToPreview = model.get(inputList.getSelectedIndex());
                mainProcess = ImageProcessHandler.createPreviewProcess(outputParameters, imageToPreview);
            } else {
                mainProcess = new ImageProcessHandler(outputParameters, model);
            }
            mainProcess.setResizeParameters(resizeParameters);
            mainProcess.setRotateParameters(rotateParameters);
            mainProcess.setWatermarkParameters(watermarkParameters);

            mainProcess.start();

        }).start();
    }

    public void startProcess(final boolean preview){
        new Thread(new Runnable() {

            @Override
            public void run() {
                OutputParameters outputParameters = null;
                ResizeParameters resizeParameters = null;
                RotateParameters rotateParameters = null;
                WatermarkParameters watermarkParameters = null;

                for (int i = 0; i < editPane.getComponentCount(); i++) {
                    TabParameters tabParameters = ((ImageEditTab) editPane.getComponentAt(i)).getImageEditParameters();
                    if (tabParameters instanceof OutputParameters) {
                        outputParameters = (OutputParameters) tabParameters;
                    } else if (tabParameters instanceof ResizeParameters) {
                        resizeParameters = (ResizeParameters) tabParameters;
                    } else if (tabParameters instanceof RotateParameters) {
                        rotateParameters = (RotateParameters) tabParameters;
                    } else if (tabParameters instanceof WatermarkParameters) {
                        watermarkParameters = (WatermarkParameters) tabParameters;
                    }
                }

                ImageProcessHandler mainProcess;
                if(preview){
                    ImportedImage imageToPreview = (ImportedImage) model.get(inputList.getSelectedIndex());
                    mainProcess = ImageProcessHandler.createPreviewProcess(outputParameters, imageToPreview);
                } else {
                    mainProcess = new ImageProcessHandler(outputParameters, model);
                }
                mainProcess.setResizeParameters(resizeParameters);
                mainProcess.setRotateParameters(rotateParameters);
                mainProcess.setWatermarkParameters(watermarkParameters);

                mainProcess.start();

            }
        }).start();
    }

Replace Anonymous With Lambda org.bric.gui.BricUI.startProcess.start.new Thread.new Runnable with () -> {OutputParameters outputParameters=outputTab.getImageEditParameters(); in method public startProcess(preview boolean) : void from class org.bric.gui.BricUI


    private void initComponents() {

        outputPathText = new javax.swing.JTextField();
        browseButton = new javax.swing.JButton();
        formatLabel = new javax.swing.JLabel();
        fileTypeCombo = new javax.swing.JComboBox<>(OutputType.values());
        numberingLabel = new javax.swing.JLabel();
        startIndexSpinner = new javax.swing.JSpinner();
        qualityLabel = new javax.swing.JLabel();
        qualitySlider = new javax.swing.JSlider();
        fileNameMasksScrollPane = new javax.swing.JScrollPane();
        fileNameMasksPane = new javax.swing.JTextPane();
        dpiLabel = new javax.swing.JLabel();
        jSpinner2 = new javax.swing.JSpinner();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jSpinner3 = new javax.swing.JSpinner();

        outputPathText.setText(System.getProperty("user.home"));

        java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("lang/gui/tabs/OutputJPanel"); // NOI18N
        browseButton.setText(bundle.getString("OutputJPanel.browseButton.text")); // NOI18N
        browseButton.setToolTipText(bundle.getString("OutputJPanel.browseButton.toolTipText")); // NOI18N
        browseButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                browseButtonActionPerformed(evt);
            }
        });

        formatLabel.setText(bundle.getString("OutputJPanel.formatLabel.text")); // NOI18N

        fileTypeCombo.addItemListener(evt -> fileTypeComboItemStateChanged());

        numberingLabel.setText(bundle.getString("OutputJPanel.numberingLabel.text")); // NOI18N

        qualityLabel.setText(bundle.getString("OutputJPanel.qualityLabel.text") + "100%");

        qualitySlider.setMajorTickSpacing(10);
        qualitySlider.setMinorTickSpacing(5);
        qualitySlider.setPaintLabels(true);
        qualitySlider.setPaintTicks(true);
        qualitySlider.setValue(100);
        qualitySlider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                qualitySliderStateChanged(evt);
            }
        });

        fileNameMasksPane.setEditable(false);
        fileNameMasksPane.setContentType("text/html"); // NOI18N
        fileNameMasksPane.setText(bundle.getString("OutputJpanel.fileNameMasks.text")); // NOI18N
        fileNameMasksScrollPane.setViewportView(fileNameMasksPane);

        dpiLabel.setText(bundle.getString("OutputJPanel.dpiLabel.text")); // NOI18N

        jLabel7.setText(bundle.getString("OutputJPanel.jLabel7.text")); // NOI18N

        jLabel8.setText(bundle.getString("OutputJPanel.jLabel8.text")); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(outputPathText)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(browseButton, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(formatLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 191, Short.MAX_VALUE)
                        .addComponent(fileTypeCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(numberingLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(startIndexSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(qualityLabel)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(qualitySlider, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(fileNameMasksScrollPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 366, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(dpiLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel7)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jSpinner2, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(jLabel8)
                        .addGap(18, 18, 18)
                        .addComponent(jSpinner3, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(outputPathText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(browseButton))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(formatLabel)
                    .addComponent(fileTypeCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(numberingLabel)
                    .addComponent(startIndexSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jSpinner2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel7)
                    .addComponent(dpiLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jSpinner3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel8))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 83, Short.MAX_VALUE)
                .addComponent(qualityLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(qualitySlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(fileNameMasksScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
    }

    private void initComponents() {

        outputPathText = new javax.swing.JTextField();
        browseButton = new javax.swing.JButton();
        formatLabel = new javax.swing.JLabel();
        fileTypeCombo = new javax.swing.JComboBox<>(OutputType.values());
        numberingLabel = new javax.swing.JLabel();
        startIndexSpinner = new javax.swing.JSpinner();
        qualityLabel = new javax.swing.JLabel();
        qualitySlider = new javax.swing.JSlider();
        fileNameMasksScrollPane = new javax.swing.JScrollPane();
        fileNameMasksPane = new javax.swing.JTextPane();
        dpiLabel = new javax.swing.JLabel();
        jSpinner2 = new javax.swing.JSpinner();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jSpinner3 = new javax.swing.JSpinner();

        outputPathText.setText(System.getProperty("user.home"));

        java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("lang/gui/tabs/OutputJPanel"); // NOI18N
        browseButton.setText(bundle.getString("OutputJPanel.browseButton.text")); // NOI18N
        browseButton.setToolTipText(bundle.getString("OutputJPanel.browseButton.toolTipText")); // NOI18N
        browseButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                browseButtonActionPerformed(evt);
            }
        });

        formatLabel.setText(bundle.getString("OutputJPanel.formatLabel.text")); // NOI18N

        fileTypeCombo.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                fileTypeComboItemStateChanged(evt);
            }
        });

        numberingLabel.setText(bundle.getString("OutputJPanel.numberingLabel.text")); // NOI18N

        qualityLabel.setText(bundle.getString("OutputJPanel.qualityLabel.text") + "100%");

        qualitySlider.setMajorTickSpacing(10);
        qualitySlider.setMinorTickSpacing(5);
        qualitySlider.setPaintLabels(true);
        qualitySlider.setPaintTicks(true);
        qualitySlider.setValue(100);
        qualitySlider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                qualitySliderStateChanged(evt);
            }
        });

        fileNameMasksPane.setEditable(false);
        fileNameMasksPane.setContentType("text/html"); // NOI18N
        fileNameMasksPane.setText(bundle.getString("OutputJpanel.fileNameMasks.text")); // NOI18N
        fileNameMasksScrollPane.setViewportView(fileNameMasksPane);

        dpiLabel.setText(bundle.getString("OutputJPanel.dpiLabel.text")); // NOI18N

        jLabel7.setText(bundle.getString("OutputJPanel.jLabel7.text")); // NOI18N

        jLabel8.setText(bundle.getString("OutputJPanel.jLabel8.text")); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(outputPathText)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(browseButton, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(formatLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 191, Short.MAX_VALUE)
                        .addComponent(fileTypeCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(numberingLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(startIndexSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(qualityLabel)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(qualitySlider, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(fileNameMasksScrollPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 366, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(dpiLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel7)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jSpinner2, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(jLabel8)
                        .addGap(18, 18, 18)
                        .addComponent(jSpinner3, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(outputPathText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(browseButton))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(formatLabel)
                    .addComponent(fileTypeCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(numberingLabel)
                    .addComponent(startIndexSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jSpinner2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel7)
                    .addComponent(dpiLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jSpinner3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel8))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 83, Short.MAX_VALUE)
                .addComponent(qualityLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(qualitySlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(fileNameMasksScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
    }

Replace Anonymous With Lambda org.bric.gui.output.OutputTab.initComponents.addItemListener.new java.awt.event.ItemListener with evt -> fileTypeComboItemStateChanged() in method private initComponents() : void from class org.bric.gui.output.OutputTab


    public void startNewThread(final ProgressBarFrame progressBar, final int from, final int step) {
        new Thread(() -> {
            ResizeProcessor resizer = new ResizeProcessor(resizeParameters);
            RotateProcessor rotator = new RotateProcessor(rotateParameters);
            WatermarkProcessor watermarker = new WatermarkProcessor(watermarkParameters);

            for (int i = from; i < from + step; i++) {
                if (!progressBar.isVisible() || i >= modelSize) {
                    return;
                }
                String inputExtension = model.get(i).getImageType();

                if (inputExtension.equalsIgnoreCase("pdf")) {
                    if(outputExtension.equalsIgnoreCase("same as first")){
                        generateSeparatePDF(i);
                    } else {
                        pdfProcess(resizer, rotator, watermarker, i, true);
                    }
                } else {
                    bufferedImageProcess(resizer, rotator, watermarker, i, null, false);
                }

                progressBar.showProgress(model.get(i).getPath());
                progressBar.updateValue(true);
            }
        }).start();
    }

    public void startNewThread(final ProgressBarFrame progressBar, final int from, final int step) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                ResizeProcessor resizer = new ResizeProcessor(resizeParameters);
                RotateProcessor rotator = new RotateProcessor(rotateParameters);
                WatermarkProcessor watermarker = new WatermarkProcessor(watermarkParameters);

                for (int i = from; i < from + step; i++) {
                    if (!progressBar.isVisible() || i >= modelSize) {
                        return;
                    }
                    String inputExtension = model.get(i).getImageType();

                    if (inputExtension.equalsIgnoreCase("pdf")) {
                        if(outputExtension.equalsIgnoreCase("same as first")){
                            generateSeparatePDF(i);
                        } else {
                            pdfProcess(resizer, rotator, watermarker, i, true);
                        }
                    } else {
                        bufferedImageProcess(resizer, rotator, watermarker, i, null, false);
                    }

                    progressBar.showProgress(model.get(i).getPath());
                    progressBar.updateValue(true);
                }
            }
        }).start();
    }

Replace Anonymous With Lambda org.bric.processor.ImageProcessHandler.startNewThread.start.new Thread.new Runnable with () -> {ResizeProcessor resizer=new ResizeProcessor(resizeParameters); in method public startNewThread(progressBar ProgressBarFrame, from int, step int) : void from class org.bric.processor.ImageProcessHandler


    public void openDocument(String filepath) {
        try {
            document = new Document();
            PdfWriter.getInstance(document, new FileOutputStream(new File(filepath)));
            document.open();
        } catch (FileNotFoundException | DocumentException ex) {
            Logger.getLogger(ImageProcessHandler.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    public void openDocument(String filepath) {
        try {
            document = new Document();
            PdfWriter.getInstance(document, new FileOutputStream(new File(filepath)));
            document.open();
        } catch (FileNotFoundException ex) {
            Logger.getLogger(ImageProcessHandler.class.getName()).log(Level.SEVERE, null, ex);
        } catch (DocumentException ex) {
            Logger.getLogger(ImageProcessHandler.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

Merge Catch [catch(FileNotFoundException ex), catch(DocumentException ex)] to catch(FileNotFoundException|DocumentException ex) in method public openDocument(filepath String) : void from class org.bric.processor.ImageProcessHandler


    public void addImageToPDF(BufferedImage image) {
        try {
            Rectangle pageSize = new Rectangle(image.getWidth(), image.getHeight());
            document.setPageSize(pageSize);
            document.newPage();
            Image iTextImage = Image.getInstance(image, null);
            Image pdfImage = Image.getInstance(iTextImage);
            pdfImage.setAbsolutePosition(0, 0);
            document.add(pdfImage);
        } catch (DocumentException | IOException ex) {
            Logger.getLogger(ImageProcessor.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    public void addImageToPDF(BufferedImage image) {
        try {
            Rectangle pageSize = new Rectangle(image.getWidth(), image.getHeight());
            document.setPageSize(pageSize);
            document.newPage();
            Image iTextImage = Image.getInstance(image, null);
            Image pdfImage = Image.getInstance(iTextImage);
            pdfImage.setAbsolutePosition(0, 0);
            document.add(pdfImage);
        } catch (DocumentException ex) {
            Logger.getLogger(ImageProcessor.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(ImageProcessor.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

Merge Catch [catch(DocumentException ex), catch(IOException ex)] to catch(DocumentException|IOException ex) in method public addImageToPDF(image BufferedImage) : void from class org.bric.processor.ImageProcessHandler


    public static int getBestMove(Board currentBoard, Player player) {
        ArrayList<AIMove> possible = new ArrayList<>(Board.SIZE);
        getBestMove(currentBoard, player, possible);

        possible.sort((a, b) -> Integer.compare(b.score, a.score));

        int max = possible.get(0).score;
        int count = 1;
        for (int i = 1; i < possible.size(); i++, count++) {
            if (possible.get(i).score < max) {
                break;
            }
        }

        return possible.get(new Random().nextInt(count)).index;
    }

    public static int getBestMove(Board currentBoard, Player player) {
        ArrayList<AIMove> possible = new ArrayList<AIMove>(Board.SIZE);
        getBestMove(currentBoard, player, possible);

        possible.sort((a, b) -> Integer.compare(b.score, a.score));

        int max = possible.get(0).score;
        int count = 1;
        for (int i = 1; i < possible.size(); i++, count++) {
            if (possible.get(i).score < max) {
                break;
            }
        }

        return possible.get(new Random().nextInt(count)).index;
    }

Replace Generic With Diamond ArrayList<AIMove> with ArrayList<> in method public getBestMove(currentBoard Board, player Player) : int from class daxtery.logic.AI


  private static void generateSwaps() {
    swaps = new ArrayList<>();
    for (int i = 0; i < data.length; ++i) {
      for (int j = i + 1; j < data.length; ++j) {
        if (data[i] > data[j]) {
          swaps.add(new Swap(i, j));
          int tmp = data[i];
          data[i] = data[j];
          data[j] = tmp;
        }
      }
    }
  }

  private static void generateSwaps() {
    swaps = new ArrayList<Swap>();
    for (int i = 0; i < data.length; ++i) {
      for (int j = i + 1; j < data.length; ++j) {
        if (data[i] > data[j]) {
          swaps.add(new Swap(i, j));
          int tmp = data[i];
          data[i] = data[j];
          data[j] = tmp;
        }
      }
    }
  }

Replace Generic With Diamond ArrayList<Swap> with ArrayList<> in method private generateSwaps() : void from class br.com.eventhorizon.edx.ucsandiego.algs201x.pa2.ConvertArrayIntoHeap


  public Traverser<T> traverser(Traverser.Type type) {
    return new Traverser<>(root, type);
  }

  public Traverser<T> traverser(Traverser.Type type) {
    return new Traverser<T>(root, type);
  }

Replace Generic With Diamond Traverser<T> with Traverser<> in method public traverser(type Traverser.Type) : Traverser<T> from class br.com.eventhorizon.common.datastructures.BinarySearchTree


    private byte[] getSVG(String iconPath, AntuIconStyle style) {

        String folder = style.getFolder();
        // String iconPath = iconPath.replace("__", "/");
        String resourcePath = "/org/teamapps/icon/antu/" + folder + "/" + iconPath + ".svg";

        try(InputStream inputStream = getClass().getResourceAsStream(resourcePath)) {
            if (inputStream == null) {
                return null;
            }
            return inputStream.readAllBytes();
            // String svg = IOUtils.toString(inputStream, StandardCharsets.UTF_8);
            // return svg.getBytes(StandardCharsets.UTF_8);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }

    private byte[] getSVG(String iconPath, AntuIconStyle style) {

        String folder = style.getFolder();
        // String iconPath = iconPath.replace("__", "/");
        String resourcePath = "/org/teamapps/icon/antu/" + folder + "/" + iconPath + ".svg";
        InputStream inputStream = getClass().getResourceAsStream(resourcePath);
        if (inputStream == null) {
            return null;
        }

        try {
            return inputStream.readAllBytes();
            // String svg = IOUtils.toString(inputStream, StandardCharsets.UTF_8);
            // return svg.getBytes(StandardCharsets.UTF_8);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }

Try With Resources try(InputStream inputStream=getClass().getResourceAsStream(resourcePath)) in method private getSVG(iconPath String, style AntuIconStyle) : byte[] from class org.teamapps.icon.antu.AntuIconLoader


	public static List<ExTpDocPublicacao> obterListaTiposMaterias(Long idMod) {
		List<ExTpDocPublicacao> lista = ExDao.getInstance().listarExTiposDocPublicacao();
		List<ExTpDocPublicacao> listaFinal = new ArrayList<>();

		for (ExTpDocPublicacao docPubl : lista) {
			if (docPubl.getCarater() != null) {
				if ((idMod == MODELO_FORMULARIO_PUBLICACAO_DJF2R_VARAS_JEFS_TR && docPubl
						.getCarater().equals("J"))
						|| (idMod == MODELO_FORMULARIO_PUBLICACAO_DJF2R_LICITACAO_CONTRATOS && docPubl
								.getCarater().equals("A"))
						|| idMod == MODELO_FORMULARIO_PUBLICACAO_DJF2R)
					listaFinal.add(docPubl);
			} else {
				if (idMod == MODELO_FORMULARIO_PUBLICACAO_DJF2R)
					listaFinal.add(docPubl);
			}
		}

		return listaFinal;
	}

	public static List<ExTpDocPublicacao> obterListaTiposMaterias(Long idMod) {
		List<ExTpDocPublicacao> lista = ExDao.getInstance().listarExTiposDocPublicacao();
		List<ExTpDocPublicacao> listaFinal = new ArrayList<ExTpDocPublicacao>();

		for (ExTpDocPublicacao docPubl : lista) {
			if (docPubl.getCarater() != null) {
				if ((idMod == MODELO_FORMULARIO_PUBLICACAO_DJF2R_VARAS_JEFS_TR && docPubl
						.getCarater().equals("J"))
						|| (idMod == MODELO_FORMULARIO_PUBLICACAO_DJF2R_LICITACAO_CONTRATOS && docPubl
								.getCarater().equals("A"))
						|| idMod == MODELO_FORMULARIO_PUBLICACAO_DJF2R)
					listaFinal.add(docPubl);
			} else {
				if (idMod == MODELO_FORMULARIO_PUBLICACAO_DJF2R)
					listaFinal.add(docPubl);
			}
		}

		return listaFinal;
	}

Replace Generic With Diamond ArrayList<ExTpDocPublicacao> with ArrayList<> in method public obterListaTiposMaterias(idMod Long) : List<ExTpDocPublicacao> from class br.gov.jfrj.siga.ex.util.PublicacaoDJEBL


    /**
     * Retorna as {@link ExMovimentacao Movimentações} de
     * Assinaturas Com Token} válidas.
     *
     * @return Movimentações de Assinaturas Com Token
     */
    public Set<ExMovimentacao> getAssinaturasComToken() {
        if (getMobilGeral() == null)
            return new TreeSet<>();
        return getMobilGeral()
                .getMovsNaoCanceladas(
                        ExTipoDeMovimentacao.ASSINATURA_DIGITAL_DOCUMENTO);
    }

    /**
     * Retorna as {@link ExMovimentacao Movimentações} de
     * Assinaturas Com Token} válidas.
     *
     * @return Movimentações de Assinaturas Com Token
     */
    public Set<ExMovimentacao> getAssinaturasComToken() {
        if (getMobilGeral() == null)
            return new TreeSet<ExMovimentacao>();
        return getMobilGeral()
                .getMovsNaoCanceladas(
                        ExTipoDeMovimentacao.ASSINATURA_DIGITAL_DOCUMENTO);
    }

Replace Generic With Diamond TreeSet<ExMovimentacao> with TreeSet<> in method public getAssinaturasComToken() : Set<ExMovimentacao> from class br.gov.jfrj.siga.ex.ExDocumento


    @Get("app/expediente/gadget")
    public void execute(final String idTpMarcadorExcluir, boolean apenasQuadro)
            throws Exception {

        List listEstados = dao().consultarPaginaInicial(getTitular(), getLotaTitular());

        if (listEstados.size() > 0) {

            String idTpMarcadorIgnoradosQuadroQuantitativo = "7,8,9,10,11,12,13,16,18,20,21,22,26,32,50,51,62,63,64";
            String idTpMarcadorExcluidos = (StringUtils.isNotBlank(idTpMarcadorExcluir) ? idTpMarcadorExcluir + "," : "") + idTpMarcadorIgnoradosQuadroQuantitativo;

            final String[] as = idTpMarcadorExcluidos.split(",");
            final Set<Long> excluir = new HashSet<>();

            for (final String s : as) {
                excluir.add(Long.valueOf(s));
            }

            final List listEstadosReduzida = new ArrayList<Object[]>();

            for (Object o : listEstados) {
                if (!excluir.contains(((Object[]) o)[0])
                ) {
                    listEstadosReduzida.add(o);
                }
            }

            listEstados = listEstadosReduzida;
        }

        if (super.getTitular() == null) {
            throw new AplicacaoException("Titular nulo, verificar se usuário está ativo no RH");
        }

        super.getRequest().setAttribute("_cadastrante", super.getTitular().getSigla() + "@"
                + super.getLotaTitular().getOrgaoUsuario().getSiglaOrgaoUsu() + super.getLotaTitular().getSigla());

        List<Integer> listIdTpFormaDoc = new ArrayList<Integer>() {{
            add(1);
            add(2);
        }};

        result.include("listEstados", listEstados);
        result.include("titular", this.getTitular());
        result.include("lotaTitular", this.getLotaTitular());
        result.include("listIdTpFormaDoc", listIdTpFormaDoc);
        result.include("documentoVia", new ExMobilSelecao());
        result.include("apenasQuadro", apenasQuadro);
    }

    @Get("app/expediente/gadget")
    public void execute(final String idTpMarcadorExcluir, boolean apenasQuadro)
            throws Exception {

        List listEstados = dao().consultarPaginaInicial(getTitular(), getLotaTitular());

        if (listEstados.size() > 0) {

            String idTpMarcadorIgnoradosQuadroQuantitativo = "7,8,9,10,11,12,13,16,18,20,21,22,26,32,50,51,62,63,64";
            String idTpMarcadorExcluidos = (StringUtils.isNotBlank(idTpMarcadorExcluir) ? idTpMarcadorExcluir + "," : "") + idTpMarcadorIgnoradosQuadroQuantitativo;

            final String[] as = idTpMarcadorExcluidos.split(",");
            final Set<Long> excluir = new HashSet<Long>();

            for (final String s : as) {
                excluir.add(Long.valueOf(s));
            }

            final List listEstadosReduzida = new ArrayList<Object[]>();

            for (Object o : listEstados) {
                if (!excluir.contains(((Object[]) o)[0])
                ) {
                    listEstadosReduzida.add(o);
                }
            }

            listEstados = listEstadosReduzida;
        }

        if (super.getTitular() == null) {
            throw new AplicacaoException("Titular nulo, verificar se usuário está ativo no RH");
        }

        super.getRequest().setAttribute("_cadastrante", super.getTitular().getSigla() + "@"
                + super.getLotaTitular().getOrgaoUsuario().getSiglaOrgaoUsu() + super.getLotaTitular().getSigla());

        List<Integer> listIdTpFormaDoc = new ArrayList<Integer>() {{
            add(1);
            add(2);
        }};

        result.include("listEstados", listEstados);
        result.include("titular", this.getTitular());
        result.include("lotaTitular", this.getLotaTitular());
        result.include("listIdTpFormaDoc", listIdTpFormaDoc);
        result.include("documentoVia", new ExMobilSelecao());
        result.include("apenasQuadro", apenasQuadro);
    }

Replace Generic With Diamond HashSet<Long> with HashSet<> in method public execute(idTpMarcadorExcluir String, apenasQuadro boolean) : void from class br.gov.jfrj.siga.vraptor.ExGadgetController


    @Get("/app/expediente/mov/receber_lote")
    public void aReceberLote() {
        final List<ExMobil> provItens = dao().consultarParaReceberEmLote(
                getLotaTitular());

        final List<ExMobil> itens = new ArrayList<>();

        for (ExMobil m : provItens) {
            if (!m.isApensado()
                    && Ex.getInstance()
                    .getComp()
                    .pode(ExPodeAcessarDocumento.class, getTitular(),
                            getLotaTitular(), m)) {
                itens.add(m);
            }
        }

        result.include("itens", itens);
    }

    @Get("/app/expediente/mov/receber_lote")
    public void aReceberLote() {
        final List<ExMobil> provItens = dao().consultarParaReceberEmLote(
                getLotaTitular());

        final List<ExMobil> itens = new ArrayList<ExMobil>();

        for (ExMobil m : provItens) {
            if (!m.isApensado()
                    && Ex.getInstance()
                    .getComp()
                    .pode(ExPodeAcessarDocumento.class, getTitular(),
                            getLotaTitular(), m)) {
                itens.add(m);
            }
        }

        result.include("itens", itens);
    }

Replace Generic With Diamond ArrayList<ExMobil> with ArrayList<> in method public aReceberLote() : void from class br.gov.jfrj.siga.vraptor.ExMovimentacaoController


    @Get("/app/expediente/mov/arquivar_corrente_lote")
    public void aArquivarCorrenteLote() {
        final List<ExMobil> provItens = dao()
                .consultarParaArquivarCorrenteEmLote(getLotaTitular());

        List<ExMobil> itens = new ArrayList<>();

        for (ExMobil m : provItens) {
            if (!m.isApensado()
                    && Ex.getInstance()
                    .getComp()
                    .pode(ExPodeAcessarDocumento.class, getTitular(),
                            getLotaTitular(), m)) {
                itens.add(m.isVolume() ? m.doc().getMobilGeral() : m);
            }
        }

        result.include("itens", itens);
    }

    @Get("/app/expediente/mov/arquivar_corrente_lote")
    public void aArquivarCorrenteLote() {
        final List<ExMobil> provItens = dao()
                .consultarParaArquivarCorrenteEmLote(getLotaTitular());

        List<ExMobil> itens = new ArrayList<ExMobil>();

        for (ExMobil m : provItens) {
            if (!m.isApensado()
                    && Ex.getInstance()
                    .getComp()
                    .pode(ExPodeAcessarDocumento.class, getTitular(),
                            getLotaTitular(), m)) {
                itens.add(m.isVolume() ? m.doc().getMobilGeral() : m);
            }
        }

        result.include("itens", itens);
    }

Replace Generic With Diamond ArrayList<ExMobil> with ArrayList<> in method public aArquivarCorrenteLote() : void from class br.gov.jfrj.siga.vraptor.ExMovimentacaoController


    @Get("/app/expediente/mov/anotar_lote")
    public void aAnotarLote() {
        final List<ExMobil> provItens = dao().consultarParaAnotarEmLote(
                getLotaTitular());

        final List<ExMobil> itens = new ArrayList<>();

        for (ExMobil m : provItens) {
            if (!m.isApensado()
                    && Ex.getInstance()
                    .getComp()
                    .pode(ExPodeAcessarDocumento.class, getTitular(),
                            getLotaTitular(), m)) {
                itens.add(m);
            }
        }
        result.include("itens", itens);
        result.include("subscritorSel", new DpPessoaSelecao());
        result.include("titularSel", new DpPessoaSelecao());
    }

    @Get("/app/expediente/mov/anotar_lote")
    public void aAnotarLote() {
        final List<ExMobil> provItens = dao().consultarParaAnotarEmLote(
                getLotaTitular());

        final List<ExMobil> itens = new ArrayList<ExMobil>();

        for (ExMobil m : provItens) {
            if (!m.isApensado()
                    && Ex.getInstance()
                    .getComp()
                    .pode(ExPodeAcessarDocumento.class, getTitular(),
                            getLotaTitular(), m)) {
                itens.add(m);
            }
        }
        result.include("itens", itens);
        result.include("subscritorSel", new DpPessoaSelecao());
        result.include("titularSel", new DpPessoaSelecao());
    }

Replace Generic With Diamond ArrayList<ExMobil> with ArrayList<> in method public aAnotarLote() : void from class br.gov.jfrj.siga.vraptor.ExMovimentacaoController


    private Set<CpMarcador> getListaMarcadoresAtivos(ExMobil mob) {
        Set<CpMarcador> set = new HashSet<>();
        for (ExMovimentacao mov : mob.getExMovimentacaoSet()) {
            if (mov.getExTipoMovimentacao() == ExTipoDeMovimentacao.MARCACAO && !mov.isCancelada()) {
                set.add(mov.getMarcador());
            }
        }
        return set;
    }

    private Set<CpMarcador> getListaMarcadoresAtivos(ExMobil mob) {
        Set<CpMarcador> set = new HashSet<CpMarcador>();
        for (ExMovimentacao mov : mob.getExMovimentacaoSet()) {
            if (mov.getExTipoMovimentacao() == ExTipoDeMovimentacao.MARCACAO && !mov.isCancelada()) {
                set.add(mov.getMarcador());
            }
        }
        return set;
    }

Replace Generic With Diamond HashSet<CpMarcador> with HashSet<> in method private getListaMarcadoresAtivos(mob ExMobil) : Set<CpMarcador> from class br.gov.jfrj.siga.vraptor.ExMovimentacaoController


    private ListaLotPubl getListaLotacaoPublicacao(ExDocumento doc)
            throws Exception {
        validarExisteLotacao(doc);

        Set<DpLotacao> lotacoes = new HashSet<>();
        DpLotacao lotSubscritor, lotCadastrante, lotTitular, lotFiltro;
        String siglaSubscritor, siglaCadastrante, siglaTitular;
        Long idOrgaoUsuario = doc.getOrgaoUsuario().getId();
        Long idOrgaoUsuarioCadastrante = getCadastrante().getOrgaoUsuario()
                .getId();
        Long idLotDefault = null;

        siglaSubscritor = PublicacaoDJEBL.obterUnidadeDocumento(doc);
        siglaCadastrante = getCadastrante().getLotacao().getSigla();
        siglaTitular = getLotaTitular().getSigla();
        lotFiltro = new DpLotacao();

        lotFiltro.setOrgaoUsuario(doc.getOrgaoUsuario());
        lotFiltro.setSigla(siglaSubscritor);
        if (lotFiltro.getSigla().startsWith("-"))
            lotFiltro.setSigla(lotFiltro.getSigla().substring(1));
        lotSubscritor = dao().consultarPorSigla(lotFiltro);

        if (lotSubscritor != null) {
            lotacoes.add(lotSubscritor);
            idLotDefault = lotSubscritor.getId();
        }

        if (!siglaSubscritor.equals(siglaCadastrante)
                && idOrgaoUsuarioCadastrante.equals(idOrgaoUsuario)) {
            lotFiltro.setSigla(siglaCadastrante);
            lotCadastrante = dao().consultarPorSigla(lotFiltro);
            if (lotCadastrante != null) {
                lotacoes.add(lotCadastrante);
                if (idLotDefault == null)
                    idLotDefault = lotCadastrante.getId();
            }
        }

        if (!siglaSubscritor.equals(siglaTitular)
                && !siglaCadastrante.equals(siglaTitular)
                && ((getTitular().getOrgaoUsuario().getId()
                .equals(idOrgaoUsuario)) || getLotaTitular()
                .getOrgaoUsuario().getId().equals(idOrgaoUsuario))) {
            lotFiltro.setSigla(siglaTitular);
            lotTitular = dao().consultarPorSigla(lotFiltro);
            if (lotTitular != null) {
                lotacoes.add(lotTitular);
                if (idLotDefault == null)
                    idLotDefault = lotTitular.getId();
            }
        }

        return new ListaLotPubl(lotacoes, idLotDefault);
    }

    private ListaLotPubl getListaLotacaoPublicacao(ExDocumento doc)
            throws Exception {
        validarExisteLotacao(doc);

        Set<DpLotacao> lotacoes = new HashSet<DpLotacao>();
        DpLotacao lotSubscritor, lotCadastrante, lotTitular, lotFiltro;
        String siglaSubscritor, siglaCadastrante, siglaTitular;
        Long idOrgaoUsuario = doc.getOrgaoUsuario().getId();
        Long idOrgaoUsuarioCadastrante = getCadastrante().getOrgaoUsuario()
                .getId();
        Long idLotDefault = null;

        siglaSubscritor = PublicacaoDJEBL.obterUnidadeDocumento(doc);
        siglaCadastrante = getCadastrante().getLotacao().getSigla();
        siglaTitular = getLotaTitular().getSigla();
        lotFiltro = new DpLotacao();

        lotFiltro.setOrgaoUsuario(doc.getOrgaoUsuario());
        lotFiltro.setSigla(siglaSubscritor);
        if (lotFiltro.getSigla().startsWith("-"))
            lotFiltro.setSigla(lotFiltro.getSigla().substring(1));
        lotSubscritor = dao().consultarPorSigla(lotFiltro);

        if (lotSubscritor != null) {
            lotacoes.add(lotSubscritor);
            idLotDefault = lotSubscritor.getId();
        }

        if (!siglaSubscritor.equals(siglaCadastrante)
                && idOrgaoUsuarioCadastrante.equals(idOrgaoUsuario)) {
            lotFiltro.setSigla(siglaCadastrante);
            lotCadastrante = dao().consultarPorSigla(lotFiltro);
            if (lotCadastrante != null) {
                lotacoes.add(lotCadastrante);
                if (idLotDefault == null)
                    idLotDefault = lotCadastrante.getId();
            }
        }

        if (!siglaSubscritor.equals(siglaTitular)
                && !siglaCadastrante.equals(siglaTitular)
                && ((getTitular().getOrgaoUsuario().getId()
                .equals(idOrgaoUsuario)) || getLotaTitular()
                .getOrgaoUsuario().getId().equals(idOrgaoUsuario))) {
            lotFiltro.setSigla(siglaTitular);
            lotTitular = dao().consultarPorSigla(lotFiltro);
            if (lotTitular != null) {
                lotacoes.add(lotTitular);
                if (idLotDefault == null)
                    idLotDefault = lotTitular.getId();
            }
        }

        return new ListaLotPubl(lotacoes, idLotDefault);
    }

Replace Generic With Diamond HashSet<DpLotacao> with HashSet<> in method private getListaLotacaoPublicacao(doc ExDocumento) : ListaLotPubl from class br.gov.jfrj.siga.vraptor.ExMovimentacaoController


    protected Map<Integer, String> getListaTipoResp() {
        final Map<Integer, String> map = new TreeMap<>();
        map.put(1, SigaMessages.getMessage("usuario.lotacao"));
        map.put(2, SigaMessages.getMessage("usuario.matricula"));
        map.put(3, SigaMessages.getMessage("responsavel.externo"));
        return map;
    }

    protected Map<Integer, String> getListaTipoResp() {
        final Map<Integer, String> map = new TreeMap<Integer, String>();
        map.put(1, SigaMessages.getMessage("usuario.lotacao"));
        map.put(2, SigaMessages.getMessage("usuario.matricula"));
        map.put(3, SigaMessages.getMessage("responsavel.externo"));
        return map;
    }

Replace Generic With Diamond TreeMap<Integer,String> with TreeMap<> in method protected getListaTipoResp() : Map<Integer,String> from class br.gov.jfrj.siga.vraptor.ExMovimentacaoController


    private Map<Integer, String> getListaTipoRespParaNotificar() {
        final Map<Integer, String> map = new TreeMap<>();
        map.put(1, SigaMessages.getMessage("usuario.lotacao"));
        map.put(2, SigaMessages.getMessage("usuario.matricula"));
        map.put(3, "Grupo de Distribuição");
        return map;
    }

    private Map<Integer, String> getListaTipoRespParaNotificar() {
        final Map<Integer, String> map = new TreeMap<Integer, String>();
        map.put(1, SigaMessages.getMessage("usuario.lotacao"));
        map.put(2, SigaMessages.getMessage("usuario.matricula"));
        map.put(3, "Grupo de Distribuição");
        return map;
    }

Replace Generic With Diamond TreeMap<Integer,String> with TreeMap<> in method private getListaTipoRespParaNotificar() : Map<Integer,String> from class br.gov.jfrj.siga.vraptor.ExMovimentacaoController