    public static ArrayList<Class<?>> getClassesForPackage(String pkgname) {
        ArrayList<Class<?>> classes = new ArrayList<>();

        String relPath = pkgname.replace('.', '/');

        // Get a File object for the package
        URL resource = ClassLoader.getSystemClassLoader().getResource(relPath);
        if (resource == null) {
            resource = Thread.currentThread().getContextClassLoader().getResource(relPath);
            if (resource == null) {
                throw new RuntimeException("Unexpected problem: No resource for " + relPath);
            }
        }
        log("Package: '" + pkgname + "' becomes Resource: '" + resource.toString() + "'");
        try {
            String path = URLDecoder.decode(resource.getPath(), "UTF-8");
            if (resource.toString().startsWith("jar:")) {
                processJarfile(resource, pkgname, classes);
            } else {
                processDirectory(new File(path), pkgname, classes);
            }
        } catch (UnsupportedEncodingException ex) {
            throw new RuntimeException(ex);
        }
        return classes;
    }

    public static ArrayList<Class<?>> getClassesForPackage(String pkgname) {
        ArrayList<Class<?>> classes = new ArrayList<Class<?>>();

        String relPath = pkgname.replace('.', '/');

        // Get a File object for the package
        URL resource = ClassLoader.getSystemClassLoader().getResource(relPath);
        if (resource == null) {
            resource = Thread.currentThread().getContextClassLoader().getResource(relPath);
            if (resource == null) {
                throw new RuntimeException("Unexpected problem: No resource for " + relPath);
            }
        }
        log("Package: '" + pkgname + "' becomes Resource: '" + resource.toString() + "'");
        try {
            String path = URLDecoder.decode(resource.getPath(), "UTF-8");
            if (resource.toString().startsWith("jar:")) {
                processJarfile(resource, pkgname, classes);
            } else {
                processDirectory(new File(path), pkgname, classes);
            }
        } catch (UnsupportedEncodingException ex) {
            throw new RuntimeException(ex);
        }
        return classes;
    }

Replace Generic With Diamond ArrayList<Class<?>> with ArrayList<> in method public getClassesForPackage(pkgname String) : ArrayList<Class<?>> from class com.xpert.maker.ClassEnumerator


    public void searchClasses() {
        try {
            ArrayList<Class<?>> allClasses = ClassEnumerator.getClassesForPackage(textPackageName.getText());
            classes = new ArrayList<>();
            for (Class entity : allClasses) {
                if (!entity.isEnum() && !entity.isInterface()) {
                    classes.add(entity);
                }
            }
            listClasses.setListData(classes.toArray(new Class[classes.size()]));
        } catch (Exception ex) {
            logger.log(Level.SEVERE, null, ex);
            JOptionPane.showMessageDialog(this, "Message: " + ex.getMessage() + ". See java log for details", "Error", JOptionPane.WARNING_MESSAGE);
        }
    }

    public void searchClasses() {
        try {
            ArrayList<Class<?>> allClasses = ClassEnumerator.getClassesForPackage(textPackageName.getText());
            classes = new ArrayList<Class<?>>();
            for (Class entity : allClasses) {
                if (!entity.isEnum() && !entity.isInterface()) {
                    classes.add(entity);
                }
            }
            listClasses.setListData(classes.toArray(new Class[classes.size()]));
        } catch (Exception ex) {
            logger.log(Level.SEVERE, null, ex);
            JOptionPane.showMessageDialog(this, "Message: " + ex.getMessage() + ". See java log for details", "Error", JOptionPane.WARNING_MESSAGE);
        }
    }

Replace Generic With Diamond ArrayList<Class<?>> with ArrayList<> in method public searchClasses() : void from class com.xpert.maker.MakerSwingFrame


    public void generate() {

        Object[] selectedClasses = listClasses.getSelectedValues();

        if (selectedClasses == null || selectedClasses.length == 0) {
            JOptionPane.showMessageDialog(this, "No Classes Selected", "Error", JOptionPane.ERROR_MESSAGE);
            return;
        }

        List<Class> classesList = new ArrayList<>();
        for (Object object : selectedClasses) {
            classesList.add((Class) object);
        }

        beanConfiguration = new BeanConfiguration();
        beanConfiguration.setPrimeFacesVersion((PrimeFacesVersion) comboPrimeFacesVersion.getSelectedItem());
        if (comboBootstrapVersion.getSelectedItem() != null && comboBootstrapVersion.getSelectedItem() instanceof BootstrapVersion) {
            beanConfiguration.setBootstrapVersion((BootstrapVersion) comboBootstrapVersion.getSelectedItem());
        }
        beanConfiguration.setTemplate(textTemplatePath.getText());
        beanConfiguration.setAuthor(textAuthor.getText());
        beanConfiguration.setBaseDAO(textBaseDAOImpl.getText());
        beanConfiguration.setBusinessObject(textPackageBO.getText());
        beanConfiguration.setManagedBean(textPackageMB.getText());
        beanConfiguration.setDao(textPackageDAO.getText());
        beanConfiguration.setDaoImpl(textPackageDAOImpl.getText());
        beanConfiguration.setResourceBundle(textResourceBundle.getText());
        //location
        beanConfiguration.setManagedBeanLocation(textManagedBean.getText());
        beanConfiguration.setBusinessObjectLocation(textBusinessObject.getText());
        beanConfiguration.setDaoLocation(textDAO.getText());
        beanConfiguration.setDaoImplLocation(textDAOImpl.getText());
        beanConfiguration.setViewLocation(textView.getText());
        //suffix/preffix
        beanConfiguration.setManagedBeanSuffix(textManagedBeanSuffix.getText());
        beanConfiguration.setBusinessObjectSuffix(textBusinessObjectSuffix.getText());
        beanConfiguration.setUseCDIBeans(checkUseCDIBeans.isSelected());
        beanConfiguration.setGeneratesSecurityArea(checkGeneratesSecurityArea.isSelected());
        beanConfiguration.setMaskCalendar(checkMaskCalendar.isSelected());
        beanConfiguration.setDatePattern(textDatePattern.getText());
        beanConfiguration.setTimePattern(textTimePattern.getText());
        beanConfiguration.setHideIdInRequest(checkHideIdInRequest.isSelected());
        //class MB
        beanConfiguration.setClassManagedBeanLocation(textClassMB.getText());
        beanConfiguration.setResourceBundleLocation(textResourceBundleLocation.getText());
        try {
            PersistenceMappedBean persistenceMappedBean = new PersistenceMappedBean(null);
            List<MappedBean> mappedBeans = persistenceMappedBean.getMappedBeans(classesList, beanConfiguration);
            textAreaSecurityGeneration.setText(SecurityCRUDGenerator.create(classesList, getViewForSecurity(beanConfiguration)));
            StringBuilder logBuilder = new StringBuilder();
            BeanCreator.writeBean(mappedBeans, beanConfiguration, logBuilder);
            //classMB
            if (checkBoxUpdateClassMB.isSelected()) {
                BeanCreator.writeClassManagedBean(classesList, beanConfiguration);
            }
            //message bundles
            if (checkBoxUpdateMessageBundle.isSelected()) {
                BeanCreator.writeResourceBundle(mappedBeans, beanConfiguration);
            }
            if (beanConfiguration.isClassManagedBeanGenerated()) {
                textAreaClassBean.setEnabled(false);
                textAreaClassBean.setText("File " + beanConfiguration.getClassManagedBeanLocation() + " updated!");
            } else {
                textAreaClassBean.setEnabled(true);
                textAreaClassBean.setText(BeanCreator.getClassBean(classesList, beanConfiguration));
            }
            if (beanConfiguration.isResourceBundleGenerated()) {
                textAreaI18n.setEnabled(false);
                textAreaI18n.setText("File " + beanConfiguration.getResourceBundleLocation() + " updated!");
            } else {
                textAreaI18n.setEnabled(true);
                textAreaI18n.setText(BeanCreator.getI18N(mappedBeans));
            }
            textAreaLog.setText(logBuilder.toString());
        } catch (Exception ex) {
            logger.log(Level.SEVERE, null, ex);
            JOptionPane.showMessageDialog(this, "Message: " + ex.getMessage() + ". See java log for details", "Error", JOptionPane.ERROR_MESSAGE);
        }
    }

    public void generate() {

        Object[] selectedClasses = listClasses.getSelectedValues();

        if (selectedClasses == null || selectedClasses.length == 0) {
            JOptionPane.showMessageDialog(this, "No Classes Selected", "Error", JOptionPane.ERROR_MESSAGE);
            return;
        }

        List<Class> classesList = new ArrayList<Class>();
        for (Object object : selectedClasses) {
            classesList.add((Class) object);
        }

        beanConfiguration = new BeanConfiguration();
        beanConfiguration.setPrimeFacesVersion((PrimeFacesVersion) comboPrimeFacesVersion.getSelectedItem());
        if (comboBootstrapVersion.getSelectedItem() != null && comboBootstrapVersion.getSelectedItem() instanceof BootstrapVersion) {
            beanConfiguration.setBootstrapVersion((BootstrapVersion) comboBootstrapVersion.getSelectedItem());
        }
        beanConfiguration.setTemplate(textTemplatePath.getText());
        beanConfiguration.setAuthor(textAuthor.getText());
        beanConfiguration.setBaseDAO(textBaseDAOImpl.getText());
        beanConfiguration.setBusinessObject(textPackageBO.getText());
        beanConfiguration.setManagedBean(textPackageMB.getText());
        beanConfiguration.setDao(textPackageDAO.getText());
        beanConfiguration.setDaoImpl(textPackageDAOImpl.getText());
        beanConfiguration.setResourceBundle(textResourceBundle.getText());
        //location
        beanConfiguration.setManagedBeanLocation(textManagedBean.getText());
        beanConfiguration.setBusinessObjectLocation(textBusinessObject.getText());
        beanConfiguration.setDaoLocation(textDAO.getText());
        beanConfiguration.setDaoImplLocation(textDAOImpl.getText());
        beanConfiguration.setViewLocation(textView.getText());
        //suffix/preffix
        beanConfiguration.setManagedBeanSuffix(textManagedBeanSuffix.getText());
        beanConfiguration.setBusinessObjectSuffix(textBusinessObjectSuffix.getText());
        beanConfiguration.setUseCDIBeans(checkUseCDIBeans.isSelected());
        beanConfiguration.setGeneratesSecurityArea(checkGeneratesSecurityArea.isSelected());
        beanConfiguration.setMaskCalendar(checkMaskCalendar.isSelected());
        beanConfiguration.setDatePattern(textDatePattern.getText());
        beanConfiguration.setTimePattern(textTimePattern.getText());
        beanConfiguration.setHideIdInRequest(checkHideIdInRequest.isSelected());
        //class MB
        beanConfiguration.setClassManagedBeanLocation(textClassMB.getText());
        beanConfiguration.setResourceBundleLocation(textResourceBundleLocation.getText());
        try {
            PersistenceMappedBean persistenceMappedBean = new PersistenceMappedBean(null);
            List<MappedBean> mappedBeans = persistenceMappedBean.getMappedBeans(classesList, beanConfiguration);
            textAreaSecurityGeneration.setText(SecurityCRUDGenerator.create(classesList, getViewForSecurity(beanConfiguration)));
            StringBuilder logBuilder = new StringBuilder();
            BeanCreator.writeBean(mappedBeans, beanConfiguration, logBuilder);
            //classMB
            if (checkBoxUpdateClassMB.isSelected()) {
                BeanCreator.writeClassManagedBean(classesList, beanConfiguration);
            }
            //message bundles
            if (checkBoxUpdateMessageBundle.isSelected()) {
                BeanCreator.writeResourceBundle(mappedBeans, beanConfiguration);
            }
            if (beanConfiguration.isClassManagedBeanGenerated()) {
                textAreaClassBean.setEnabled(false);
                textAreaClassBean.setText("File " + beanConfiguration.getClassManagedBeanLocation() + " updated!");
            } else {
                textAreaClassBean.setEnabled(true);
                textAreaClassBean.setText(BeanCreator.getClassBean(classesList, beanConfiguration));
            }
            if (beanConfiguration.isResourceBundleGenerated()) {
                textAreaI18n.setEnabled(false);
                textAreaI18n.setText("File " + beanConfiguration.getResourceBundleLocation() + " updated!");
            } else {
                textAreaI18n.setEnabled(true);
                textAreaI18n.setText(BeanCreator.getI18N(mappedBeans));
            }
            textAreaLog.setText(logBuilder.toString());
        } catch (Exception ex) {
            logger.log(Level.SEVERE, null, ex);
            JOptionPane.showMessageDialog(this, "Message: " + ex.getMessage() + ". See java log for details", "Error", JOptionPane.ERROR_MESSAGE);
        }
    }

Replace Generic With Diamond ArrayList<Class> with ArrayList<> in method public generate() : void from class com.xpert.maker.MakerSwingFrame


    public List<MappedBean> getMappedBeans(List<Class> classes, BeanConfiguration beanConfiguration) {
        List<MappedBean> mappedBeans = new ArrayList<>();
        if (beanConfiguration != null) {
            if (beanConfiguration.getManagedBeanSuffix() == null || beanConfiguration.getManagedBeanSuffix().isEmpty()) {
                beanConfiguration.setManagedBeanSuffix(BeanCreator.SUFFIX_MANAGED_BEAN);
            }
            if (beanConfiguration.getBusinessObjectSuffix() == null || beanConfiguration.getBusinessObjectSuffix().isEmpty()) {
                beanConfiguration.setBusinessObjectSuffix(BeanCreator.SUFFIX_BUSINESS_OBJECT);
            }
            if (beanConfiguration.getDatePattern() == null || beanConfiguration.getDatePattern().isEmpty()) {
                beanConfiguration.setDatePattern(BeanCreator.DEFAULT_DATE_PATTERN);
            }
            if (beanConfiguration.getTimePattern() == null || beanConfiguration.getTimePattern().isEmpty()) {
                beanConfiguration.setTimePattern(BeanCreator.DEFAULT_TIME_PATTERN);
            }
        }
        for (Class clazz : classes) {
            //ignore Embeddable
            if (!clazz.isAnnotationPresent(Embeddable.class)) {
                try {
                    MappedBean mappedBean = new MappedBean(clazz);
                    mappedBean.setI18n(BeanCreator.getI18N(clazz));
                    mappedBean.setManagedBean(BeanCreator.createBean(new Bean(clazz, BeanType.MANAGED_BEAN), beanConfiguration));
                    mappedBean.setBusinnesObject(BeanCreator.createBean(new Bean(clazz, BeanType.BUSINESS_OBJECT), beanConfiguration));
                    mappedBean.setDao(BeanCreator.createBean(new Bean(clazz, BeanType.DAO), beanConfiguration));
                    mappedBean.setDaoImpl(BeanCreator.createBean(new Bean(clazz, BeanType.DAO_IMPL), beanConfiguration));
                    mappedBean.setFormCreateView(BeanCreator.createBean(new Bean(clazz, BeanType.VIEW_FORM_CREATE), beanConfiguration));
                    mappedBean.setCreateView(BeanCreator.createBean(new Bean(clazz, BeanType.VIEW_CREATE), beanConfiguration));
                    mappedBean.setListView(BeanCreator.createBean(new Bean(clazz, BeanType.VIEW_LIST), beanConfiguration));
                    mappedBean.setMenu(BeanCreator.createBean(new Bean(clazz, BeanType.VIEW_MENU), beanConfiguration));
                    mappedBean.setDetail(BeanCreator.createBean(new Bean(clazz, BeanType.VIEW_DETAIL), beanConfiguration));
                    mappedBeans.add(mappedBean);
                } catch (IOException ex) {
                    logger.log(Level.SEVERE, null, ex);
                } catch (TemplateException ex) {
                    logger.log(Level.SEVERE, null, ex);
                }
            }
        }
        sortMappedBean(mappedBeans);
        return mappedBeans;
    }

    public List<MappedBean> getMappedBeans(List<Class> classes, BeanConfiguration beanConfiguration) {
        List<MappedBean> mappedBeans = new ArrayList<MappedBean>();
        if (beanConfiguration != null) {
            if (beanConfiguration.getManagedBeanSuffix() == null || beanConfiguration.getManagedBeanSuffix().isEmpty()) {
                beanConfiguration.setManagedBeanSuffix(BeanCreator.SUFFIX_MANAGED_BEAN);
            }
            if (beanConfiguration.getBusinessObjectSuffix() == null || beanConfiguration.getBusinessObjectSuffix().isEmpty()) {
                beanConfiguration.setBusinessObjectSuffix(BeanCreator.SUFFIX_BUSINESS_OBJECT);
            }
            if (beanConfiguration.getDatePattern() == null || beanConfiguration.getDatePattern().isEmpty()) {
                beanConfiguration.setDatePattern(BeanCreator.DEFAULT_DATE_PATTERN);
            }
            if (beanConfiguration.getTimePattern() == null || beanConfiguration.getTimePattern().isEmpty()) {
                beanConfiguration.setTimePattern(BeanCreator.DEFAULT_TIME_PATTERN);
            }
        }
        for (Class clazz : classes) {
            //ignore Embeddable
            if (!clazz.isAnnotationPresent(Embeddable.class)) {
                try {
                    MappedBean mappedBean = new MappedBean(clazz);
                    mappedBean.setI18n(BeanCreator.getI18N(clazz));
                    mappedBean.setManagedBean(BeanCreator.createBean(new Bean(clazz, BeanType.MANAGED_BEAN), beanConfiguration));
                    mappedBean.setBusinnesObject(BeanCreator.createBean(new Bean(clazz, BeanType.BUSINESS_OBJECT), beanConfiguration));
                    mappedBean.setDao(BeanCreator.createBean(new Bean(clazz, BeanType.DAO), beanConfiguration));
                    mappedBean.setDaoImpl(BeanCreator.createBean(new Bean(clazz, BeanType.DAO_IMPL), beanConfiguration));
                    mappedBean.setFormCreateView(BeanCreator.createBean(new Bean(clazz, BeanType.VIEW_FORM_CREATE), beanConfiguration));
                    mappedBean.setCreateView(BeanCreator.createBean(new Bean(clazz, BeanType.VIEW_CREATE), beanConfiguration));
                    mappedBean.setListView(BeanCreator.createBean(new Bean(clazz, BeanType.VIEW_LIST), beanConfiguration));
                    mappedBean.setMenu(BeanCreator.createBean(new Bean(clazz, BeanType.VIEW_MENU), beanConfiguration));
                    mappedBean.setDetail(BeanCreator.createBean(new Bean(clazz, BeanType.VIEW_DETAIL), beanConfiguration));
                    mappedBeans.add(mappedBean);
                } catch (IOException ex) {
                    logger.log(Level.SEVERE, null, ex);
                } catch (TemplateException ex) {
                    logger.log(Level.SEVERE, null, ex);
                }
            }
        }
        sortMappedBean(mappedBeans);
        return mappedBeans;
    }

Replace Generic With Diamond ArrayList<MappedBean> with ArrayList<> in method public getMappedBeans(classes List<Class>, beanConfiguration BeanConfiguration) : List<MappedBean> from class com.xpert.maker.PersistenceMappedBean


    public List<Class> getMappedClasses(boolean includeEnum) {
        List<Class> mappedEntities = EntityUtils.getMappedEntities(entityManager);
        List<Class> classes = new ArrayList<>();
        for (Class entity : mappedEntities) {
            //do not include Audit classes
            if (!extendsAuditClasses(entity)) {
                classes.add(entity);
            }
            //add enum
            if (includeEnum) {
                for (Field field : entity.getDeclaredFields()) {
                    if (field.getType().isEnum() && !classes.contains(field.getType())) {
                        classes.add(field.getType());
                    }
                }
            }
        }
        sortClass(classes);
        return classes;
    }

    public List<Class> getMappedClasses(boolean includeEnum) {
        List<Class> mappedEntities = EntityUtils.getMappedEntities(entityManager);
        List<Class> classes = new ArrayList<Class>();
        for (Class entity : mappedEntities) {
            //do not include Audit classes
            if (!extendsAuditClasses(entity)) {
                classes.add(entity);
            }
            //add enum
            if (includeEnum) {
                for (Field field : entity.getDeclaredFields()) {
                    if (field.getType().isEnum() && !classes.contains(field.getType())) {
                        classes.add(field.getType());
                    }
                }
            }
        }
        sortClass(classes);
        return classes;
    }

Replace Generic With Diamond ArrayList<Class> with ArrayList<> in method public getMappedClasses(includeEnum boolean) : List<Class> from class com.xpert.maker.PersistenceMappedBean


    private List<Restriction> getRestrictionsFromMap(Map<String, Object> args) {
        List<Restriction> restrictions = new ArrayList<>();
        for (Entry e : args.entrySet()) {
            restrictions.add(new Restriction(e.getKey().toString(), e.getValue()));
        }
        return restrictions;
    }

    private List<Restriction> getRestrictionsFromMap(Map<String, Object> args) {
        List<Restriction> restrictions = new ArrayList<Restriction>();
        for (Entry e : args.entrySet()) {
            restrictions.add(new Restriction(e.getKey().toString(), e.getValue()));
        }
        return restrictions;
    }

Replace Generic With Diamond ArrayList<Restriction> with ArrayList<> in method private getRestrictionsFromMap(args Map<String,Object>) : List<Restriction> from class com.xpert.persistence.dao.BaseDAOImpl


    private List<Restriction> getRestrictions(Restriction restriction) {
        List<Restriction> restrictions = null;
        if (restriction != null) {
            restrictions = new ArrayList<>();
            restrictions.add(restriction);
        }
        return restrictions;
    }

    private List<Restriction> getRestrictions(Restriction restriction) {
        List<Restriction> restrictions = null;
        if (restriction != null) {
            restrictions = new ArrayList<Restriction>();
            restrictions.add(restriction);
        }
        return restrictions;
    }

Replace Generic With Diamond ArrayList<Restriction> with ArrayList<> in method private getRestrictions(restriction Restriction) : List<Restriction> from class com.xpert.persistence.dao.BaseDAOImpl


    public List<QueryParameter> getQueryParameters() {
        int position = 1;
        List<QueryParameter> parameters = new ArrayList<>();
        for (Restriction re : normalizedRestrictions) {
            //add custom parameters
            if (re.getParameters() != null) {
                parameters.addAll(re.getParameters());
            }
            if (re.getRestrictionType().isIgnoreParameter()) {
                continue;
            }
            if (re.getValue() != null) {
                QueryParameter parameter = null;
                if (re.getRestrictionType().equals(RestrictionType.LIKE)) {
                    if (re.getLikeType() == null || re.getLikeType().equals(LikeType.BOTH)) {
                        parameter = new QueryParameter(position, "%" + re.getValue() + "%");
                    } else if (re.getLikeType().equals(LikeType.BEGIN)) {
                        parameter = new QueryParameter(position, re.getValue() + "%");
                    } else if (re.getLikeType().equals(LikeType.END)) {
                        parameter = new QueryParameter(position, "%" + re.getValue());
                    }
                } else {
                    if (re.getTemporalType() != null && (re.getValue() instanceof Date || re.getValue() instanceof Calendar)) {
                        parameter = new QueryParameter(position, re.getValue(), re.getTemporalType());
                    } else {
                        parameter = new QueryParameter(position, re.getValue());
                    }
                }
                parameters.add(parameter);
                position++;
            }
        }
        return parameters;
    }

    public List<QueryParameter> getQueryParameters() {
        int position = 1;
        List<QueryParameter> parameters = new ArrayList<QueryParameter>();
        for (Restriction re : normalizedRestrictions) {
            //add custom parameters
            if (re.getParameters() != null) {
                parameters.addAll(re.getParameters());
            }
            if (re.getRestrictionType().isIgnoreParameter()) {
                continue;
            }
            if (re.getValue() != null) {
                QueryParameter parameter = null;
                if (re.getRestrictionType().equals(RestrictionType.LIKE)) {
                    if (re.getLikeType() == null || re.getLikeType().equals(LikeType.BOTH)) {
                        parameter = new QueryParameter(position, "%" + re.getValue() + "%");
                    } else if (re.getLikeType().equals(LikeType.BEGIN)) {
                        parameter = new QueryParameter(position, re.getValue() + "%");
                    } else if (re.getLikeType().equals(LikeType.END)) {
                        parameter = new QueryParameter(position, "%" + re.getValue());
                    }
                } else {
                    if (re.getTemporalType() != null && (re.getValue() instanceof Date || re.getValue() instanceof Calendar)) {
                        parameter = new QueryParameter(position, re.getValue(), re.getTemporalType());
                    } else {
                        parameter = new QueryParameter(position, re.getValue());
                    }
                }
                parameters.add(parameter);
                position++;
            }
        }
        return parameters;
    }

Replace Generic With Diamond ArrayList<QueryParameter> with ArrayList<> in method public getQueryParameters() : List<QueryParameter> from class com.xpert.persistence.query.QueryBuilder


    /**
     * Add a RestrictionType.QUERY_STRING
     *
     * @param property
     * @param parameter
     * @return Current Restrictions with added restriction
     */
    public QueryBuilder addQueryString(String property, QueryParameter parameter) {
        Restriction restriction = new Restriction(property, RestrictionType.QUERY_STRING);
        List<QueryParameter> parameters = new ArrayList<>();
        parameters.add(parameter);
        restriction.setParameters(parameters);
        this.add(restriction);
        return this;
    }

    /**
     * Add a RestrictionType.QUERY_STRING
     *
     * @param property
     * @param parameter
     * @return Current Restrictions with added restriction
     */
    public QueryBuilder addQueryString(String property, QueryParameter parameter) {
        Restriction restriction = new Restriction(property, RestrictionType.QUERY_STRING);
        List<QueryParameter> parameters = new ArrayList<QueryParameter>();
        parameters.add(parameter);
        restriction.setParameters(parameters);
        this.add(restriction);
        return this;
    }

Replace Generic With Diamond ArrayList<QueryParameter> with ArrayList<> in method public addQueryString(property String, parameter QueryParameter) : QueryBuilder from class com.xpert.persistence.query.QueryBuilder


    /**
     * Add a RestrictionType.QUERY_STRING
     *
     * @param property
     * @param parameter
     * @return Current Restrictions with added restriction
     */
    public Restrictions addQueryString(String property, QueryParameter parameter) {
        Restriction restriction = new Restriction(property, RestrictionType.QUERY_STRING);
        List<QueryParameter> parameters = new ArrayList<>();
        parameters.add(parameter);
        restriction.setParameters(parameters);
        this.add(restriction);
        return this;
    }

    /**
     * Add a RestrictionType.QUERY_STRING
     *
     * @param property
     * @param parameter
     * @return Current Restrictions with added restriction
     */
    public Restrictions addQueryString(String property, QueryParameter parameter) {
        Restriction restriction = new Restriction(property, RestrictionType.QUERY_STRING);
        List<QueryParameter> parameters = new ArrayList<QueryParameter>();
        parameters.add(parameter);
        restriction.setParameters(parameters);
        this.add(restriction);
        return this;
    }

Replace Generic With Diamond ArrayList<QueryParameter> with ArrayList<> in method public addQueryString(property String, parameter QueryParameter) : Restrictions from class com.xpert.persistence.query.Restrictions


    /**
     * Return mapped entities in EntityManager. Classes are get from
     * ClassMetadata in SessionFactory
     *
     * @param entityManager
     * @return
     */
    public static List<Class> getMappedEntities(EntityManager entityManager) {
        EntityManagerFactory entityManagerFactory = entityManager.getEntityManagerFactory();
        Metamodel metamodel = entityManagerFactory.getMetamodel();
        List<Class> classes = new ArrayList<>();
        for (EntityType entityType : metamodel.getEntities()) {
            classes.add(entityType.getBindableJavaType());
        }
        return classes;
    }

     /**
     * Return mapped entities in EntityManager. Classes are get from
     * ClassMetadata in SessionFactory
     *
     * @param entityManager
     * @return
     */
    public static List<Class> getMappedEntities(EntityManager entityManager) {
        EntityManagerFactory entityManagerFactory = entityManager.getEntityManagerFactory();
        Metamodel metamodel = entityManagerFactory.getMetamodel();
        List<Class> classes = new ArrayList<Class>();
        for (EntityType entityType : metamodel.getEntities()) {
            classes.add(entityType.getBindableJavaType());
        }
        return classes;
    }

Replace Generic With Diamond ArrayList<Class> with ArrayList<> in method public getMappedEntities(entityManager EntityManager) : List<Class> from class com.xpert.persistence.utils.EntityUtils


    public void createSequences() {
        if (getEntityManager() == null) {
            throw new IllegalArgumentException("Provide a EntityManager to create sequences");
        }

        final List<Class> classes = EntityUtils.getMappedEntities(getEntityManager());
        try {
            if (getDataSource() != null) {
                try (Connection connection = getDataSource().getConnection()) {
                    SequenceGenerator sequenceGenerator = null;
                    for (Class clazz : classes) {
                        String schema = null;
                        sequenceGenerator = getSequenceGenerator(clazz);
                        if (sequenceGenerator != null) {
                            logger.log(Level.INFO, "Mapping sequence {0}", sequenceGenerator.sequenceName());
                            try {
                                createSequence(connection, schema, sequenceGenerator.sequenceName(), sequenceGenerator.initialValue(), sequenceGenerator.allocationSize());
                            } catch (Exception ex) {
                                logger.log(Level.SEVERE, "Erro in sequence " + sequenceGenerator.sequenceName(), ex);
                            }
                        }
                    }
                }
            } else {
                logger.log(Level.SEVERE, "Datasource is null");
            }
        } catch (SQLException ex) {
            throw new RuntimeException(ex);
        }

    }

    public void createSequences() {
        if (getEntityManager() == null) {
            throw new IllegalArgumentException("Provide a EntityManager to create sequences");
        }

        final List<Class> classes = EntityUtils.getMappedEntities(getEntityManager());
        Connection connection = null;
        try {
            if (getDataSource() != null) {
                connection = getDataSource().getConnection();
            }
            SequenceGenerator sequenceGenerator = null;
            for (Class clazz : classes) {
                String schema = null;
                sequenceGenerator = getSequenceGenerator(clazz);
                if (sequenceGenerator != null) {
                    logger.log(Level.INFO, "Mapping sequence {0}", sequenceGenerator.sequenceName());
                    try {
                        createSequence(connection, schema, sequenceGenerator.sequenceName(), sequenceGenerator.initialValue(), sequenceGenerator.allocationSize());
                    } catch (Exception ex) {
                        logger.log(Level.SEVERE, "Erro in sequence " + sequenceGenerator.sequenceName(), ex);
                    }
                }
            }
        } catch (SQLException ex) {
            throw new RuntimeException(ex);
        } finally {
            try {
                if (connection != null && !connection.isClosed()) {
                    connection.close();
                }
            } catch (SQLException ex) {
                throw new RuntimeException(ex);
            }
        }

    }

Try With Resources try(Connection connection=getDataSource().getConnection()) in method public createSequences() : void from class com.xpert.persistence.utils.SequenceUpdater


    /**
     * Update all entity sequences
     */
    public void updateSequences() {

        if (getEntityManager() == null) {
            throw new IllegalArgumentException("EntityManager must not null");
        }

        List<Class> classes = EntityUtils.getMappedEntities(getEntityManager());
        SequenceGenerator sequenceGenerator = null;
        try {
            if (getDataSource() != null) {
                try (Connection connection = getDataSource().getConnection()) {
                    for (Class clazz : classes) {
                        String schema = null;
                        Table table = (Table) clazz.getAnnotation(Table.class);
                        if (table != null) {
                            schema = table.schema();
                        }
                        sequenceGenerator = getSequenceGenerator(clazz);
                        if (sequenceGenerator != null) {
                            try {
                                logger.log(Level.INFO, "Mapping sequence {0}", sequenceGenerator.sequenceName());
                                Long maxId = getMaxId(sequenceGenerator.sequenceName(), clazz);
                                if (schema != null && !schema.isEmpty()) {
                                    changeCurrentValue(connection, schema + "." + sequenceGenerator.sequenceName(), maxId);
                                } else {
                                    changeCurrentValue(connection, sequenceGenerator.sequenceName(), maxId);
                                }
                            } catch (Exception ex) {
                                logger.log(Level.SEVERE, "Erro in sequence " + sequenceGenerator.sequenceName(), ex);
                            }
                        }
                    }
                }
            } else {
                logger.log(Level.SEVERE, "Datasource is null");
            }
        } catch (SQLException ex) {
            throw new RuntimeException("Erro updating sequence " + sequenceGenerator.sequenceName(), ex);
        }
    }

    /**
     * Update all entity sequences
     */
    public void updateSequences() {

        if (getEntityManager() == null) {
            throw new IllegalArgumentException("EntityManager must not null");
        }

        List<Class> classes = EntityUtils.getMappedEntities(getEntityManager());
        SequenceGenerator sequenceGenerator = null;
        Connection connection = null;
        try {
            if (getDataSource() != null) {
                connection = getDataSource().getConnection();
            }
            for (Class clazz : classes) {
                String schema = null;
                sequenceGenerator = getSequenceGenerator(clazz);
                if (sequenceGenerator != null) {
                    try {
                        logger.log(Level.INFO, "Mapping sequence {0}", sequenceGenerator.sequenceName());
                        Long maxId = getMaxId(sequenceGenerator.sequenceName(), clazz);
                        if (schema != null && !schema.isEmpty()) {
                            changeCurrentValue(connection, schema + "." + sequenceGenerator.sequenceName(), maxId);
                        } else {
                            changeCurrentValue(connection, sequenceGenerator.sequenceName(), maxId);
                        }
                    } catch (Exception ex) {
                        logger.log(Level.SEVERE, "Erro in sequence " + sequenceGenerator.sequenceName(), ex);
                    }
                }
            }
        } catch (SQLException ex) {
            throw new RuntimeException("Erro updating sequence " + sequenceGenerator.sequenceName(), ex);
        } finally {
            try {
                if (connection != null && !connection.isClosed()) {
                    connection.close();
                }
            } catch (SQLException ex) {
                throw new RuntimeException(ex);
            }
        }
    }

Try With Resources try(Connection connection=getDataSource().getConnection()) in method public updateSequences() : void from class com.xpert.persistence.utils.SequenceUpdater


    /**
     * retorna o dv de um numero
     * @param number
     * @return
     */
    public static String getDV(String number) {

        List<Integer> list = new ArrayList<>();
        for (int i = number.length() - 1, j = 2; i >= 0; i--) {
            list.add(j * Integer.parseInt(number.substring(i, i + 1)));
            if (j == 9) {
                j = 2;
            } else {
                j++;
            }
        }
        Integer somatorio = 0;
        for (Integer i : list) {
            somatorio += i;
        }
        Integer resto = somatorio % 11;
        Integer dv = 11 - resto;
        if (dv == 10 || dv == 11) {
            dv = 0;
        }

        return dv.toString();
    }

    /**
     * retorna o dv de um numero
     * @param number
     * @return
     */
    public static String getDV(String number) {

        List<Integer> list = new ArrayList<Integer>();
        for (int i = number.length() - 1, j = 2; i >= 0; i--) {
            list.add(j * Integer.parseInt(number.substring(i, i + 1)));
            if (j == 9) {
                j = 2;
            } else {
                j++;
            }
        }
        Integer somatorio = 0;
        for (Integer i : list) {
            somatorio += i;
        }
        Integer resto = somatorio % 11;
        Integer dv = 11 - resto;
        if (dv == 10 || dv == 11) {
            dv = 0;
        }

        return dv.toString();
    }

Replace Generic With Diamond ArrayList<Integer> with ArrayList<> in method public getDV(number String) : String from class com.xpert.utils.Mod11


    public static JoinAcceptMessage decodeJoinAccept(byte[] message, byte[] appKey) {
        try {
            byte[] srcmsg = message;
            int index = 0;
            byte MHDR = srcmsg[index];
            index++;

            SecretKeySpec key = new SecretKeySpec(appKey, "AES");
            Cipher cipher = Cipher.getInstance("AES/ECB/NoPadding");
            cipher.init(Cipher.ENCRYPT_MODE, key);
            byte[] buffer = cipher.update(srcmsg, 1, srcmsg.length - 1);
            srcmsg = new byte[17];
            srcmsg[0] = MHDR;
            System.arraycopy(buffer, 0, srcmsg, 1, buffer.length);

            byte[] msgToMic = new byte[srcmsg.length - 4];
            System.arraycopy(srcmsg, 0, msgToMic, 0, msgToMic.length);

            byte[] AppNonce = new byte[3];

            for (int i = 2; i >= 0; i--) {
                AppNonce[i] = srcmsg[index];
                index++;
            }
            byte[] NetID = new byte[3];
            for (int i = 2; i >= 0; i--) {
                NetID[i] = srcmsg[index];
                index++;
            }
            byte[] DevAddr = new byte[4];
            for (int i = 3; i >= 0; i--) {
                DevAddr[i] = srcmsg[index];
                index++;
            }
            byte DLSetting = srcmsg[index];
            index++;
            byte RxDelay = srcmsg[index];
            index++;
            byte[] CFList = new byte[srcmsg.length - (index + 4)];
            for (int i = CFList.length - 1; i >= 0; i--) {
                CFList[i] = srcmsg[index];
                index++;
            }

            byte[] mic = new byte[4];
            return new JoinAcceptMessage(MHDR, AppNonce, NetID, DevAddr, DLSetting, RxDelay, mic);

        } catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException ex) {
            Logger.getLogger(PayloadConstructor.class.getName()).log(Level.SEVERE, null, ex);
        }
        return null;
    }

    public static JoinAcceptMessage decodeJoinAccept(byte[] message, byte[] appKey) {
        try {
            byte[] srcmsg = message;
            int index = 0;
            byte MHDR = srcmsg[index];
            index++;

            SecretKeySpec key = new SecretKeySpec(appKey, "AES");
            Cipher cipher = Cipher.getInstance("AES/ECB/NoPadding");
            cipher.init(Cipher.ENCRYPT_MODE, key);
            byte[] buffer = cipher.update(srcmsg, 1, srcmsg.length - 1);
            srcmsg = new byte[17];
            srcmsg[0] = MHDR;
            System.arraycopy(buffer, 0, srcmsg, 1, buffer.length);

            byte[] msgToMic = new byte[srcmsg.length - 4];
            System.arraycopy(srcmsg, 0, msgToMic, 0, msgToMic.length);

            byte[] AppNonce = new byte[3];

            for (int i = 2; i >= 0; i--) {
                AppNonce[i] = srcmsg[index];
                index++;
            }
            byte[] NetID = new byte[3];
            for (int i = 2; i >= 0; i--) {
                NetID[i] = srcmsg[index];
                index++;
            }
            byte[] DevAddr = new byte[4];
            for (int i = 3; i >= 0; i--) {
                DevAddr[i] = srcmsg[index];
                index++;
            }
            byte DLSetting = srcmsg[index];
            index++;
            byte RxDelay = srcmsg[index];
            index++;
            byte[] CFList = new byte[srcmsg.length - (index + 4)];
            for (int i = CFList.length - 1; i >= 0; i--) {
                CFList[i] = srcmsg[index];
                index++;
            }

            byte[] mic = new byte[4];
            return new JoinAcceptMessage(MHDR, AppNonce, NetID, DevAddr, DLSetting, RxDelay, mic);

        } catch (NoSuchAlgorithmException ex) {
            Logger.getLogger(PayloadConstructor.class.getName()).log(Level.SEVERE, null, ex);
        } catch (NoSuchPaddingException ex) {
            Logger.getLogger(PayloadConstructor.class.getName()).log(Level.SEVERE, null, ex);
        } catch (InvalidKeyException ex) {
            Logger.getLogger(PayloadConstructor.class.getName()).log(Level.SEVERE, null, ex);
        }
        return null;
    }

Merge Catch [catch(NoSuchAlgorithmException ex), catch(NoSuchPaddingException ex), catch(InvalidKeyException ex)] to catch(NoSuchAlgorithmException|NoSuchPaddingException|InvalidKeyException ex) in method public decodeJoinAccept(message byte[], appKey byte[]) : JoinAcceptMessage from class com.silocom.lorawantest.PayloadConstructor


    @BeforeEach
    @SneakyThrows
    void setUp() {
        shell = mock(ExtendedShell.class);
        Parser parser = mock(Parser.class);
        sshHelper = mock(SshShellHelper.class);
        cmd = new ScriptCommand(parser, sshHelper, new SshShellProperties());
        ApplicationContext context = mock(ApplicationContext.class);
        cmd.setApplicationContext(context);
        when(context.getBeanProvider(Shell.class)).thenReturn(new ObjectProvider<>() {
            @Override
            public Shell getObject(Object... objects) throws BeansException {
                return null;
            }

            @Override
            public Shell getIfAvailable() throws BeansException {
                return null;
            }

            @Override
            public Shell getIfUnique() throws BeansException {
                return null;
            }

            @Override
            public Shell getObject() throws BeansException {
                return shell;
            }
        });
        cmd.afterPropertiesSet();
        output = new File("target/result-" + UUID.randomUUID() + ".txt");
    }

    @BeforeEach
    @SneakyThrows
    void setUp() {
        shell = mock(ExtendedShell.class);
        Parser parser = mock(Parser.class);
        sshHelper = mock(SshShellHelper.class);
        cmd = new ScriptCommand(parser, sshHelper, new SshShellProperties());
        ApplicationContext context = mock(ApplicationContext.class);
        cmd.setApplicationContext(context);
        when(context.getBeanProvider(Shell.class)).thenReturn(new ObjectProvider<Shell>() {
            @Override
            public Shell getObject(Object... objects) throws BeansException {
                return null;
            }

            @Override
            public Shell getIfAvailable() throws BeansException {
                return null;
            }

            @Override
            public Shell getIfUnique() throws BeansException {
                return null;
            }

            @Override
            public Shell getObject() throws BeansException {
                return shell;
            }
        });
        cmd.afterPropertiesSet();
        output = new File("target/result-" + UUID.randomUUID() + ".txt");
    }

Replace Generic With Diamond ObjectProvider<Shell> with ObjectProvider<> in method package setUp() : void from class com.github.fonimus.ssh.shell.commands.ScriptCommandTest


    @Bean
    public PostProcessor<String, String> quotePostProcessor() {
        return new PostProcessor<>() {

            @Override
            public String getName() {
                return "quote";
            }

            @Override
            public String getDescription() {
                return "Add quotes";
            }

            @Override
            public String process(String input, List<String> parameters) {
                return "'" + input + "'";
            }
        };
    }

    @Bean
    public PostProcessor<String, String> quotePostProcessor() {
        return new PostProcessor<String, String>() {

            @Override
            public String getName() {
                return "quote";
            }

            @Override
            public String getDescription() {
                return "Add quotes";
            }

            @Override
            public String process(String input, List<String> parameters) {
                return "'" + input + "'";
            }
        };
    }

Replace Generic With Diamond PostProcessor<String,String> with PostProcessor<> in method public quotePostProcessor() : PostProcessor<String,String> from class com.github.fonimus.ssh.shell.complete.CompleteConfiguration


    @Bean
    public PostProcessor<String, ZonedDateTime> datePostProcessor() {
        return new PostProcessor<>() {

            @Override
            public String getName() {
                return "date";
            }

            @Override
            public String getDescription() {
                return "Parse date";
            }

            @Override
            public ZonedDateTime process(String input, List<String> parameters) {
                return ZonedDateTime.parse(input);
            }
        };
    }

    @Bean
    public PostProcessor<String, ZonedDateTime> datePostProcessor() {
        return new PostProcessor<String, ZonedDateTime>() {

            @Override
            public String getName() {
                return "date";
            }

            @Override
            public String getDescription() {
                return "Parse date";
            }

            @Override
            public ZonedDateTime process(String input, List<String> parameters) {
                return ZonedDateTime.parse(input);
            }
        };
    }

Replace Generic With Diamond PostProcessor<String,ZonedDateTime> with PostProcessor<> in method public datePostProcessor() : PostProcessor<String,ZonedDateTime> from class com.github.fonimus.ssh.shell.complete.CompleteConfiguration


    @Bean
    public PostProcessor<ZonedDateTime, ZonedDateTime> uctPostProcessor() {
        return new PostProcessor<>() {

            @Override
            public String getName() {
                return "zoned";
            }

            @Override
            public String getDescription() {
                return "Zoned date";
            }

            @Override
            public ZonedDateTime process(ZonedDateTime input, List<String> parameters) {
                String zone = "UTC";
                if (!CollectionUtils.isEmpty(parameters)) {
                    zone = parameters.get(0);
                }
                return input.withZoneSameInstant(ZoneId.of(zone));
            }
        };
    }

    @Bean
    public PostProcessor<ZonedDateTime, ZonedDateTime> uctPostProcessor() {
        return new PostProcessor<ZonedDateTime, ZonedDateTime>() {

            @Override
            public String getName() {
                return "zoned";
            }

            @Override
            public String getDescription() {
                return "Zoned date";
            }

            @Override
            public ZonedDateTime process(ZonedDateTime input, List<String> parameters) {
                String zone = "UTC";
                if (!CollectionUtils.isEmpty(parameters)) {
                    zone = parameters.get(0);
                }
                return input.withZoneSameInstant(ZoneId.of(zone));
            }
        };
    }

Replace Generic With Diamond PostProcessor<ZonedDateTime,ZonedDateTime> with PostProcessor<> in method public uctPostProcessor() : PostProcessor<ZonedDateTime,ZonedDateTime> from class com.github.fonimus.ssh.shell.complete.CompleteConfiguration


    public static void call(String user, String pass, String host, int port, Executor executor) {
        try {
            JSch jsch = new JSch();
            Session session = jsch.getSession(user, host, port);
            session.setPassword(pass);
            Properties config = new Properties();
            config.put("StrictHostKeyChecking", "no");
            session.setConfig(config);
            session.connect();
            Channel channel = session.openChannel("shell");
            try (PipedInputStream pis = new PipedInputStream();
                 PipedOutputStream pos = new PipedOutputStream()) {
                channel.setInputStream(new PipedInputStream(pos));
                channel.setOutputStream(new PipedOutputStream(pis));
                channel.connect();
                executor.execute(pis, pos);
            } catch (Exception e) {
                fail(e.toString());
            } finally {
                channel.disconnect();
                session.disconnect();
            }
        } catch (JSchException ex) {
            fail(ex.toString());
        }
    }

    public static void call(String user, String pass, String host, int port, Executor executor) {
        try {
            JSch jsch = new JSch();
            Session session = jsch.getSession(user, host, port);
            session.setPassword(pass);
            Properties config = new Properties();
            config.put("StrictHostKeyChecking", "no");
            session.setConfig(config);
            session.connect();
            Channel channel = session.openChannel("shell");
            PipedInputStream pis = new PipedInputStream();
            PipedOutputStream pos = new PipedOutputStream();
            channel.setInputStream(new PipedInputStream(pos));
            channel.setOutputStream(new PipedOutputStream(pis));
            channel.connect();
            try {
                executor.execute(pis, pos);
            } catch (Exception e) {
                fail(e.toString());
            } finally {
                pis.close();
                pos.close();
                channel.disconnect();
                session.disconnect();
            }
        } catch (JSchException | IOException ex) {
            fail(ex.toString());
        }
    }

Try With Resources try(PipedInputStream pis=new PipedInputStream(); PipedOutputStream pos=new PipedOutputStream()) in method public call(user String, pass String, host String, port int, executor Executor) : void from class com.github.fonimus.ssh.shell.SshHelperTest


	static public void main(String[] args) throws Exception {
		/*
		 * URL url = new URL("https://www.w3.org/TR/PNG/iso_8859-1.txt"); URL url = new
		 * URL("https://youtu.be/4scs6J33B9E"); File f = new File("H:/test.txt");
		 * Getvideo video = new Getvideo(url, f);
		 */
// https://publish.dvlabs.com/democracynow/360/dn2020-0205.mp4
		options = getargs(args);
		String PropPath = System.getProperty("user.dir") + "/properties";
		isWindows = testOS();
		if (isWindows)
			PropPath += "/wardwindows.properties";
		else
			PropPath += "/wardlinux.properties";

		Properties prop = new Prop(PropPath).theProp;
//Test
		if (options != null) {

			String function = options.get(0);

			if (function.equals("youtube")) {
				URL url = new URL("https://youtu.be/4scs6J33B9E");
				File f = new File(PropPath + "videotest.txt");
				Getvideo video = new Getvideo(url, f);

			}
			if (function.equals("GetFiles")) {
				ProcessFiles process = new ProcessFiles();
				ArrayList<Book> map = new ArrayList<>();
				int count = process.getFiles(prop, options.get(1), map);
				System.out.println("Final Count" + Integer.toString(count));
				System.out.println("Map Size " + Integer.toString(map.size()));
				BookManager manager = new BookManager();
				manager.setup();
				Book thebook = null;
				for (Iterator<Book> i = map.iterator(); i.hasNext(); thebook = i.next()) {

					manager.create(thebook);
				}
				manager.exit();

			}
		}
	}

	static public void main(String[] args) throws Exception {
		/*
		 * URL url = new URL("https://www.w3.org/TR/PNG/iso_8859-1.txt"); URL url = new
		 * URL("https://youtu.be/4scs6J33B9E"); File f = new File("H:/test.txt");
		 * Getvideo video = new Getvideo(url, f);
		 */
// https://publish.dvlabs.com/democracynow/360/dn2020-0205.mp4
		options = getargs(args);
		String PropPath = System.getProperty("user.dir") + "/properties";
		isWindows = testOS();
		if (isWindows)
			PropPath += "/wardwindows.properties";
		else
			PropPath += "/wardlinux.properties";

		Properties prop = new Prop(PropPath).theProp;
//Test
		if (options != null) {

			String function = options.get(0);

			if (function.equals("youtube")) {
				URL url = new URL("https://youtu.be/4scs6J33B9E");
				File f = new File(PropPath + "videotest.txt");
				Getvideo video = new Getvideo(url, f);

			}
			if (function.equals("GetFiles")) {
				ProcessFiles process = new ProcessFiles();
				ArrayList<Book> map = new ArrayList<Book>();
				int count = process.getFiles(prop, options.get(1), map);
				System.out.println("Final Count" + Integer.toString(count));
				System.out.println("Map Size " + Integer.toString(map.size()));
				BookManager manager = new BookManager();
				manager.setup();
				Book thebook = null;
				for (Iterator<Book> i = map.iterator(); i.hasNext(); thebook = i.next()) {

					manager.create(thebook);
				}
				manager.exit();

			}
		}
	}

Replace Generic With Diamond ArrayList<Book> with ArrayList<> in method public main(args String[]) : void from class com.myexperiments.ward.Gutenberg


	static public ArrayList<String> getargs(String[] args) {
		final Map<String, List<String>> params = new HashMap<>();

		ArrayList<String> options = new ArrayList<>();

		for (int i = 0; i < args.length; i++) {
			final String a = args[i];

			if (a.charAt(0) == '-') {
				if (a.length() < 2) {
					System.err.println("Error at argument " + a);
					return null;
				}

				params.put(a.substring(1), options);
			} else if (options != null) {
				options.add(a);
			} else {
				System.err.println("Illegal parameter usage");
				return null;
			}
		}
		return options;
	}

	static public ArrayList<String> getargs(String[] args) {
		final Map<String, List<String>> params = new HashMap<>();

		ArrayList<String> options = new ArrayList<String>();

		for (int i = 0; i < args.length; i++) {
			final String a = args[i];

			if (a.charAt(0) == '-') {
				if (a.length() < 2) {
					System.err.println("Error at argument " + a);
					return null;
				}

				params.put(a.substring(1), options);
			} else if (options != null) {
				options.add(a);
			} else {
				System.err.println("Illegal parameter usage");
				return null;
			}
		}
		return options;
	}

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public getargs(args String[]) : ArrayList<String> from class com.myexperiments.ward.Gutenberg


	HashMap<String, String> GetBookMetadata(String text) {

		HashMap<String, String> items = new HashMap<>();
		int index;
		String split = System.getProperty("line.separator");
		String[] lines = text.split(split);
		int is;
		for (String line : lines) {
			if (line == null)
				break;
			if ((index = line.lastIndexOf("Title:")) != -1) {
				line = line.replace("Title:", "");
				if (!items.containsKey("Title")) {
					items.put("Title", line.substring(index++).trim());
				}
				continue;
			}
			if ((index = line.lastIndexOf("Author:")) != -1) {
				line = line.replace("Author:", "");
				items.put("Author", line.substring(index++).trim());
				continue;
			}
			if ((index = line.lastIndexOf("of several works by")) != -1) {
				if (!items.containsKey("Author")) {
					items.put("Author", line.substring(index++).trim());
				}
				continue;
			}

			if ((index = line.lastIndexOf("Release")) != -1) {
				line = line.replace("Release Date:", "");

				int index2;
				String line2;
				if (line.contains("[")) {
					line2 = line;
					if ((index2 = line2.lastIndexOf("[")) != -1) {
						items.put("ReleaseDate", line2.substring(index2).trim());
						line = line.substring(0, index2 - 1);
					}
				}
				continue;
			}
			if ((index = line.lastIndexOf("Posting")) != -1) {
				int index2;
				line = line.replace("Posting Date:", "");
				String line2 = line;

				if ((index2 = line2.lastIndexOf("[")) != -1) {
					line2 = line2.replace("[EBook #", "");
					line2 = line2.replace("]", "");
					line2 = line2.replace("[", "");
					items.put("Ebook", line2.substring(index2++).trim());
					line = line.substring(0, index2);
				}

				items.put("PostingDate", line.substring(index).trim());
				continue;
			}

			if ((index = line.lastIndexOf("Date:")) != -1) {
				int index2;
				String line2 = line;

				if ((index2 = line2.lastIndexOf("[")) != -1) {
					items.put("Ebook", line2.substring(index2++).trim());
					line = line.substring(0, index2);
				}
				line = line.replace("Date:", "");
				items.put("Date", line.substring(index++).trim());
				continue;
			}

			if ((index = line.lastIndexOf("Etext")) != -1) {
				line = line.replace("Etext of ", "");
				if (!items.containsKey("Title")) {
					items.put("Title", line.substring(index).replace("]", "").trim());
				}
				continue;
			}

			if ((index = line.lastIndexOf("The Project Gutenberg Etext of")) != -1) {
				if (!items.containsKey("Title")) {
					line.replace("Title:", "");
					items.put("Title", line.substring(index++).trim());
				}
				continue;
			}

			if ((index = line.lastIndexOf("Translanted by")) != -1) {
				items.put("Translanted by", line.substring(index++).trim());
				continue;
			}

			if ((index = line.lastIndexOf("*** START OF THIS PROJECT GUTENBERG EBOOK")) != -1) {
				if (!items.containsKey("Title")) {
					line.replace("Title:", "");
					items.put("Title", line.substring(index++).replace("***", "").trim());
				}
				continue;
			}

			if ((index = line.lastIndexOf("Language:")) != -1) {
				items.put("Language", line.substring(index++).trim());
				continue;
			}

		}
		return items;

	}

	HashMap<String, String> GetBookMetadata(String text) {

		HashMap<String, String> items = new HashMap<String, String>();
		int index;
		String split = System.getProperty("line.separator");
		String[] lines = text.split(split);
		int is;
		for (String line : lines) {
			if (line == null)
				break;
			if ((index = line.lastIndexOf("Title:")) != -1) {
				line = line.replace("Title:", "");
				if (!items.containsKey("Title")) {
					items.put("Title", line.substring(index++).trim());
				}
				continue;
			}
			if ((index = line.lastIndexOf("Author:")) != -1) {
				line = line.replace("Author:", "");
				items.put("Author", line.substring(index++).trim());
				continue;
			}
			if ((index = line.lastIndexOf("of several works by")) != -1) {
				if (!items.containsKey("Author")) {
					items.put("Author", line.substring(index++).trim());
				}
				continue;
			}

			if ((index = line.lastIndexOf("Release")) != -1) {
				line = line.replace("Release Date:", "");

				int index2;
				String line2;
				if (line.contains("[")) {
					line2 = line;
					if ((index2 = line2.lastIndexOf("[")) != -1) {
						items.put("ReleaseDate", line2.substring(index2).trim());
						line = line.substring(0, index2 - 1);
					}
				}
				continue;
			}
			if ((index = line.lastIndexOf("Posting")) != -1) {
				int index2;
				line = line.replace("Posting Date:", "");
				String line2 = line;

				if ((index2 = line2.lastIndexOf("[")) != -1) {
					line2 = line2.replace("[EBook #", "");
					line2 = line2.replace("]", "");
					line2 = line2.replace("[", "");
					items.put("Ebook", line2.substring(index2++).trim());
					line = line.substring(0, index2);
				}

				items.put("PostingDate", line.substring(index).trim());
				continue;
			}

			if ((index = line.lastIndexOf("Date:")) != -1) {
				int index2;
				String line2 = line;

				if ((index2 = line2.lastIndexOf("[")) != -1) {
					items.put("Ebook", line2.substring(index2++).trim());
					line = line.substring(0, index2);
				}
				line = line.replace("Date:", "");
				items.put("Date", line.substring(index++).trim());
				continue;
			}

			if ((index = line.lastIndexOf("Etext")) != -1) {
				line = line.replace("Etext of ", "");
				if (!items.containsKey("Title")) {
					items.put("Title", line.substring(index).replace("]", "").trim());
				}
				continue;
			}

			if ((index = line.lastIndexOf("The Project Gutenberg Etext of")) != -1) {
				if (!items.containsKey("Title")) {
					line.replace("Title:", "");
					items.put("Title", line.substring(index++).trim());
				}
				continue;
			}

			if ((index = line.lastIndexOf("Translanted by")) != -1) {
				items.put("Translanted by", line.substring(index++).trim());
				continue;
			}

			if ((index = line.lastIndexOf("*** START OF THIS PROJECT GUTENBERG EBOOK")) != -1) {
				if (!items.containsKey("Title")) {
					line.replace("Title:", "");
					items.put("Title", line.substring(index++).replace("***", "").trim());
				}
				continue;
			}

			if ((index = line.lastIndexOf("Language:")) != -1) {
				items.put("Language", line.substring(index++).trim());
				continue;
			}

		}
		return items;

	}

Replace Generic With Diamond HashMap<String,String> with HashMap<> in method package GetBookMetadata(text String) : HashMap<String,String> from class com.myexperiments.ward.GuttenbergHelper


	LinkedList<ChunkedBinaryExtraction> ReverbChunk(ChunkedSentence sent) {
		LinkedList<ChunkedBinaryExtraction> extractions = new LinkedList<>();

		for (ChunkedBinaryExtraction extr : reverb.extract(sent)) {
			extractions.add(extr);
			double conf = confFunc.getConf(extr);
			System.out.println("Arg1=" + extr.getArgument1());
			System.out.println("Rel=" + extr.getRelation());
			System.out.println("Arg2=" + extr.getArgument2());
			System.out.println("Conf=" + conf);
		}
		return extractions;
	}

	LinkedList<ChunkedBinaryExtraction> ReverbChunk(ChunkedSentence sent) {
		LinkedList<ChunkedBinaryExtraction> extractions = new LinkedList<ChunkedBinaryExtraction>();

		for (ChunkedBinaryExtraction extr : reverb.extract(sent)) {
			extractions.add(extr);
			double conf = confFunc.getConf(extr);
			System.out.println("Arg1=" + extr.getArgument1());
			System.out.println("Rel=" + extr.getRelation());
			System.out.println("Arg2=" + extr.getArgument2());
			System.out.println("Conf=" + conf);
		}
		return extractions;
	}

Replace Generic With Diamond LinkedList<ChunkedBinaryExtraction> with LinkedList<> in method package ReverbChunk(sent ChunkedSentence) : LinkedList<ChunkedBinaryExtraction> from class com.myexperiments.ward.ReverbProcessing


		public List<FacetCountsCollection.FacetValue> getFacetField(String field) {
			List<FacetCountsCollection.FacetValue> facets = new ArrayList<>();
			if (!facetFields.containsKey(field)) {
				return facets;
			}
			// this was written assuming that facetFields contains a map, but in recent
			// versions of Solr at least it's an array.
			Object o = facetFields.get(field);
			if (o instanceof Map) {
				for (Map.Entry<String, Integer> entry : ((Map<String, Integer>) o).entrySet()) {
					facets.add(new FacetCountsCollection.FacetValue(entry.getKey(), entry.getValue()));
				}
			} else if (o instanceof Collection) {
				Iterator<Object> iter = ((Collection<Object>) o).iterator();
				while (iter.hasNext()) {
					// alternating string value and integer count.
					facets.add(new FacetCountsCollection.FacetValue(iter.next().toString(), (Integer) iter.next()));
				}
			}
			return facets;
		}

		public List<FacetCountsCollection.FacetValue> getFacetField(String field) {
			List<FacetCountsCollection.FacetValue> facets = new ArrayList<FacetCountsCollection.FacetValue>();
			if (!facetFields.containsKey(field)) {
				return facets;
			}
			// this was written assuming that facetFields contains a map, but in recent
			// versions of Solr at least it's an array.
			Object o = facetFields.get(field);
			if (o instanceof Map) {
				for (Map.Entry<String, Integer> entry : ((Map<String, Integer>) o).entrySet()) {
					facets.add(new FacetCountsCollection.FacetValue(entry.getKey(), entry.getValue()));
				}
			} else if (o instanceof Collection) {
				Iterator<Object> iter = ((Collection<Object>) o).iterator();
				while (iter.hasNext()) {
					// alternating string value and integer count.
					facets.add(new FacetCountsCollection.FacetValue(iter.next().toString(), (Integer) iter.next()));
				}
			}
			return facets;
		}

Replace Generic With Diamond ArrayList<FacetCountsCollection.FacetValue> with ArrayList<> in method public getFacetField(field String) : List<FacetCountsCollection.FacetValue> from class com.myexperiments.ward.SearchResponse.FacetCountsCollection


		public List<FacetCountsCollection.FacetValue> getFacetRange(String field) {
			List<FacetCountsCollection.FacetValue> facets = new ArrayList<>();
			if (!facetRanges.containsKey(field)) {
				return facets;
			}
			for (Map.Entry<String, Integer> entry : facetRanges.get(field).counts.entrySet()) {
				facets.add(new FacetCountsCollection.FacetValue(entry.getKey(), entry.getValue()));
			}
			return facets;
		}

		public List<FacetCountsCollection.FacetValue> getFacetRange(String field) {
			List<FacetCountsCollection.FacetValue> facets = new ArrayList<FacetCountsCollection.FacetValue>();
			if (!facetRanges.containsKey(field)) {
				return facets;
			}
			for (Map.Entry<String, Integer> entry : facetRanges.get(field).counts.entrySet()) {
				facets.add(new FacetCountsCollection.FacetValue(entry.getKey(), entry.getValue()));
			}
			return facets;
		}

Replace Generic With Diamond ArrayList<FacetCountsCollection.FacetValue> with ArrayList<> in method public getFacetRange(field String) : List<FacetCountsCollection.FacetValue> from class com.myexperiments.ward.SearchResponse.FacetCountsCollection


    public static void main(String[] args) {
        ConfigHelper.of(MainCommand.NAME).loadAll(System.getProperties());
        LoggerHelper.disableDefaultConsoleLogger();

        int exitCode = 0;
        try (AnsiConsole ansi = AnsiConsole.windowsInstall()) {
            CommandLine cli = new CommandLine(new MainCommand());
            cli.setCaseInsensitiveEnumValuesAllowed(true);
            exitCode = cli.execute(args);
        } catch (CommandLine.ExecutionException ex) {
            Logger.getLogger(MainCommand.class.getName()).log(Level.SEVERE, "While executing command", ex);
            System.err.println(ex.getCause().getMessage());
        }
        System.exit(exitCode);
    }

    public static void main(String[] args) {
        ConfigHelper.of(MainCommand.NAME).loadAll(System.getProperties());
        LoggerHelper.disableDefaultConsoleLogger();
        int exitCode = 0;
        AnsiConsole.systemInstall();
        try {
            CommandLine cli = new CommandLine(new MainCommand());
            cli.setCaseInsensitiveEnumValuesAllowed(true);
            exitCode = cli.execute(args);
        } catch (CommandLine.ExecutionException ex) {
            Logger.getLogger(MainCommand.class.getName()).log(Level.SEVERE, "While executing command", ex);
            System.err.println(ex.getCause().getMessage());
        } finally {
            AnsiConsole.systemUninstall();
        }
        if (exitCode != 0) {
            System.exit(exitCode);
        }
    }

Try With Resources try(AnsiConsole ansi=AnsiConsole.windowsInstall()) in method public main(args String[]) : void from class sasquatch.cli.MainCommand


    private void finish() {
        offlineId = UUID.nameUUIDFromBytes(("OfflinePlayer:" + getName()).getBytes(StandardCharsets.UTF_8));
        if (uniqueId == null)
            uniqueId = offlineId;

        rewriteId = (bungee.config.isIpForward()) ? uniqueId : offlineId;

        if (BungeeCord.getInstance().config.isEnforceSecureProfile()) {
            if (getVersion() >= ProtocolConstants.MINECRAFT_1_19_1 && getVersion() < ProtocolConstants.MINECRAFT_1_19_3) {
                try {
                    if (!EncryptionUtil.check(loginRequest.getPublicKey(), uniqueId)) {
                        disconnect(bungee.getTranslation("secure_profile_invalid"));
                        return;
                    }
                } catch (Exception ignored) {}
            }
        }

        if ((isOnlineMode() && bungee.getPlayer(getName()) != null
                && bungee.getPlayer(getUniqueId()) != null)
                || bungee.getPlayer(getName()) != null) {
            disconnect(bungee.getTranslation("already_connected_proxy"));
            return;
        }

        bungee.getPluginManager().callEvent(new LoginEvent(InitialHandler.this, (result, error) -> {
            if (result.isCancelled()) {
                BaseComponent reason = result.getReason();
                disconnect((reason != null) ? reason : TextComponent.fromLegacy(bungee.getTranslation("kick_message")));
                return;
            }
            if (ch.isClosing()) return;

            ch.getHandle().eventLoop().execute(() -> {
                if (!ch.isClosing()) {
                    userCon = new UserConnection(bungee, ch, getName(), InitialHandler.this);
                    userCon.setCompressionThreshold(BungeeCord.getInstance().config.getCompressionThreshold());

                    if (getVersion() < ProtocolConstants.MINECRAFT_1_20_2) {
                        unsafe().sendPacket(new LoginSuccess(getRewriteId(), getName(), (loginProfile == null) ? null : loginProfile.getProperties()));
                        ch.setProtocol(Protocol.GAME);
                    }
                    finish2();
                }
            });
        }, this.getLoginProfile())); // Waterfall: Parse LoginResult object to new constructor of LoginEvent
    }

    private void finish() {
        offlineId = UUID.nameUUIDFromBytes(("OfflinePlayer:" + getName()).getBytes(StandardCharsets.UTF_8));
        if (uniqueId == null) {
            uniqueId = offlineId;
        }
        rewriteId = (bungee.config.isIpForward()) ? uniqueId : offlineId;

        if (BungeeCord.getInstance().config.isEnforceSecureProfile()) {
            if (getVersion() >= ProtocolConstants.MINECRAFT_1_19_1 && getVersion() < ProtocolConstants.MINECRAFT_1_19_3) {
                try {
                    if (!EncryptionUtil.check(loginRequest.getPublicKey(), uniqueId)) {
                        disconnect(bungee.getTranslation("secure_profile_invalid"));
                        return;
                    }
                } catch (GeneralSecurityException ignored) {
                }
            }
        }

        if (isOnlineMode()) {
            if (bungee.getPlayer(getName()) != null || bungee.getPlayer(getUniqueId()) != null) {
                disconnect(bungee.getTranslation("already_connected_proxy"));
                return;
            }
        } else {
            if (bungee.getPlayer(getName()) != null) {
                disconnect(bungee.getTranslation("already_connected_proxy"));
                return;
            }
        }

        bungee.getPluginManager().callEvent(new LoginEvent(InitialHandler.this, new Callback<LoginEvent>() {
            @Override
            public void done(LoginEvent result, Throwable error) {
                if (result.isCancelled()) {
                    BaseComponent reason = result.getReason();
                    disconnect((reason != null) ? reason : TextComponent.fromLegacy(bungee.getTranslation("kick_message")));
                    return;
                }
                if (ch.isClosing()) return;

                ch.getHandle().eventLoop().execute(() -> {
                    if (!ch.isClosing()) {
                        userCon = new UserConnection(bungee, ch, getName(), InitialHandler.this);
                        userCon.setCompressionThreshold(BungeeCord.getInstance().config.getCompressionThreshold());

                        if (getVersion() < ProtocolConstants.MINECRAFT_1_20_2) {
                            unsafe().sendPacket(new LoginSuccess(getRewriteId(), getName(), (loginProfile == null) ? null : loginProfile.getProperties()));
                            ch.setProtocol(Protocol.GAME);
                        }
                        finish2();
                    }
                });
            }
        }, this.getLoginProfile())); // Waterfall: Parse LoginResult object to new constructor of LoginEvent
    }

Replace Anonymous With Lambda net.md_5.bungee.connection.InitialHandler.finish.callEvent.new LoginEvent.new Callback<LoginEvent> with (result, error) -> {if(result.isCancelled()){BaseComponent reason=result.getReason(); in method private finish() : void from class net.md_5.bungee.connection.InitialHandler


    @Override
    public void handle(StatusRequest statusRequest) throws Exception
    {
        Preconditions.checkState( thisState == State.STATUS, "Not expecting STATUS" );

        ServerInfo forced = AbstractReconnectHandler.getForcedHost( this );
        final String motd = ( forced != null ) ? forced.getMotd() : listener.getMotd();
        final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion();

        Callback<ServerPing> pingBack = (result, error) -> {
            if ( error != null )
            {
                result = getPingInfo( bungee.getTranslation( "ping_cannot_connect" ), protocol );
                bungee.getLogger().log( Level.WARNING, "Error pinging remote server", error );
            }

            Callback<ProxyPingEvent> callback = (pingResult, error1) -> {
                Gson gson = BungeeCord.getInstance().gson;
                unsafe.sendPacket( new StatusResponse( gson.toJson( pingResult.getResponse() ) ) );
                if ( bungee.getConnectionThrottle() != null )
                {
                    bungee.getConnectionThrottle().unthrottle( getSocketAddress() );
                }
            };

            bungee.getPluginManager().callEvent( new ProxyPingEvent( InitialHandler.this, result, callback ) );
        };

        if ( forced != null && listener.isPingPassthrough() )
        {
            ( (BungeeServerInfo) forced ).ping( pingBack, handshake.getProtocolVersion() );
        } else
        {
            pingBack.done( getPingInfo( motd, protocol ), null );
        }

        thisState = State.PING;
    }

    @Override
    public void handle(StatusRequest statusRequest) throws Exception
    {
        Preconditions.checkState( thisState == State.STATUS, "Not expecting STATUS" );

        ServerInfo forced = AbstractReconnectHandler.getForcedHost( this );
        final String motd = ( forced != null ) ? forced.getMotd() : listener.getMotd();
        final int protocol = ( ProtocolConstants.SUPPORTED_VERSION_IDS.contains( handshake.getProtocolVersion() ) ) ? handshake.getProtocolVersion() : bungee.getProtocolVersion();

        Callback<ServerPing> pingBack = new Callback<ServerPing>()
        {
            @Override
            public void done(ServerPing result, Throwable error)
            {
                if ( error != null )
                {
                    result = getPingInfo( bungee.getTranslation( "ping_cannot_connect" ), protocol );
                    bungee.getLogger().log( Level.WARNING, "Error pinging remote server", error );
                }

                Callback<ProxyPingEvent> callback = new Callback<ProxyPingEvent>()
                {
                    @Override
                    public void done(ProxyPingEvent pingResult, Throwable error)
                    {
                        Gson gson = BungeeCord.getInstance().gson;
                        unsafe.sendPacket( new StatusResponse( gson.toJson( pingResult.getResponse() ) ) );
                        if ( bungee.getConnectionThrottle() != null )
                        {
                            bungee.getConnectionThrottle().unthrottle( getSocketAddress() );
                        }
                    }
                };

                bungee.getPluginManager().callEvent( new ProxyPingEvent( InitialHandler.this, result, callback ) );
            }
        };

        if ( forced != null && listener.isPingPassthrough() )
        {
            ( (BungeeServerInfo) forced ).ping( pingBack, handshake.getProtocolVersion() );
        } else
        {
            pingBack.done( getPingInfo( motd, protocol ), null );
        }

        thisState = State.PING;
    }

Replace Anonymous With Lambda net.md_5.bungee.connection.InitialHandler.handle.pingBack.new Callback<ServerPing> with (result, error) -> {if(error != null){result=getPingInfo(bungee.getTranslation("ping_cannot_connect"),protocol); in method public handle(statusRequest StatusRequest) : void from class net.md_5.bungee.connection.InitialHandler


    public void loadPlugins()
    {
        Map<PluginDescription, Boolean> pluginStatuses = new HashMap<>();
        for ( Map.Entry<String, PluginDescription> entry : toLoad.entrySet() )
        {
            PluginDescription plugin = entry.getValue();
            if ( !enablePlugin( pluginStatuses, new Stack<>(), plugin ) )
            {
                ProxyServer.getInstance().getLogger().log( Level.WARNING, "Failed to enable {0}", entry.getKey() );
            }
        }
        toLoad.clear();
        toLoad = null;
    }

    public void loadPlugins()
    {
        Map<PluginDescription, Boolean> pluginStatuses = new HashMap<>();
        for ( Map.Entry<String, PluginDescription> entry : toLoad.entrySet() )
        {
            PluginDescription plugin = entry.getValue();
            if ( !enablePlugin( pluginStatuses, new Stack<PluginDescription>(), plugin ) )
            {
                ProxyServer.getInstance().getLogger().log( Level.WARNING, "Failed to enable {0}", entry.getKey() );
            }
        }
        toLoad.clear();
        toLoad = null;
    }

Replace Generic With Diamond Stack<PluginDescription> with Stack<> in method public loadPlugins() : void from class net.md_5.bungee.api.plugin.PluginManager


        public SendCallback(CommandSender sender)
        {
            this.sender = sender;
            for ( ServerConnectRequest.Result result : ServerConnectRequest.Result.values() )
            {
                results.put( result, Collections.synchronizedList( new ArrayList<>() ) );
            }
        }

        public SendCallback(CommandSender sender)
        {
            this.sender = sender;
            for ( ServerConnectRequest.Result result : ServerConnectRequest.Result.values() )
            {
                results.put( result, new ArrayList<String>() );
            }
        }

Replace Generic With Diamond ArrayList<String> with ArrayList<> in method public SendCallback(sender CommandSender) from class net.md_5.bungee.module.cmd.send.CommandSend.SendCallback


            @Override
            public void run()
            {
                try ( Socket socket = new Socket(); )
                {
                    socket.connect( getAddress() );

                    DataOutputStream out = new DataOutputStream( socket.getOutputStream() );
                    out.write( 0xFE );
                    out.write( 0x01 );

                    PacketStream in = new PacketStream( socket.getInputStream() );
                    PacketFFKick response = new PacketFFKick( in.readPacket() );

                    String[] split = response.message.split( "\00" );

                    ServerPing ping = new ServerPing( Byte.parseByte( split[1] ), split[2], split[3], Integer.parseInt( split[4] ), Integer.parseInt( split[5] ) );
                    callback.done( ping, null );
                } catch ( Throwable t )
                {
                    callback.done( null, t );
                }
            }

            @Override
            public void run()
            {
                try
                {
                    Socket socket = new Socket();
                    socket.connect( getAddress() );
                    try ( DataOutputStream out = new DataOutputStream( socket.getOutputStream() ) )
                    {
                        out.write( 0xFE );
                        out.write( 0x01 );
                    }
                    try ( PacketStream in = new PacketStream( socket.getInputStream() ) )
                    {
                        PacketFFKick response = new PacketFFKick( in.readPacket() );

                        String[] split = response.message.split( "\00" );

                        ServerPing ping = new ServerPing( Byte.parseByte( split[1] ), split[2], split[3], Integer.parseInt( split[4] ), Integer.parseInt( split[5] ) );
                        callback.done( ping, null );
                    }
                } catch ( Throwable t )
                {
                    callback.done( null, t );
                }
            }

Try With Resources try(Socket socket=new Socket()) in method public run() : void from class net.md_5.bungee.BungeeServerInfo.ping.start.new Thread


    @BeforeEach
    void setup() throws IOException {
        String jsonFile = "src/test/resources/input/f24form.json";
        String jsonString = new String(Files.readAllBytes(Paths.get(jsonFile)));
        F24Form form = new ObjectMapper().readValue(jsonString, F24Form.class);

        recordList = new ArrayList<>(Arrays.asList(
                new Record("1000", "0", "1000"),
                new Record("0", "800", "800"),
                new Record("1200", "0", "1200"),
                new Record("500", "0", "500"),
                new Record("1000", "0", "1000"),
                new Record("0", "800", "800"),
                new Record("1200", "0", "1200"),
                new Record("500", "0", "500")));

        pdfCreator = new FormPDFCreator(form);
        pdfCreator.loadDoc(MODEL_NAME);
    }

  @BeforeEach
  void setup() throws IOException {
    String jsonFile = "src/test/resources/input/f24form.json";
    String jsonString = new String(Files.readAllBytes(Paths.get(jsonFile)));
    F24Form form = new ObjectMapper().readValue(jsonString, F24Form.class);

    recordList = new ArrayList<Record>(Arrays.asList(
        new Record("1000", "0", "1000"),
        new Record("0", "800", "800"),
        new Record("1200", "0", "1200"),
        new Record("500", "0", "500"),
        new Record("1000", "0", "1000"),
        new Record("0", "800", "800"),
        new Record("1200", "0", "1200"),
        new Record("500", "0", "500")));

    f24FormCreator = new FormPDFCreator(form);
    f24FormCreator.loadDoc(MODEL_NAME);
  }

Replace Generic With Diamond ArrayList<Record> with ArrayList<> in method package setup() : void from class org.f24.service.pdf.util.PDFFormManagerTest


    @BeforeEach
    void setup() throws IOException {
        String jsonFile = "src/test/resources/input/f24standard.json";
        String jsonString = new String(Files.readAllBytes(Paths.get(jsonFile)));
        form = new ObjectMapper().readValue(jsonString, F24Standard.class);

        recordList = new ArrayList<>(Arrays.asList(
                new Record("1000", "0", "1000"),
                new Record("0", "800", "800"),
                new Record("1200", "0", "1200"),
                new Record("500", "0", "500"),
                new Record("1000", "0", "1000"),
                new Record("0", "800", "800"),
                new Record("1200", "0", "1200"),
                new Record("500", "0", "500")));

        pdfCreator = new StandardPDFCreator(form);
        pdfCreator.loadDoc("templates" + "/ModF24IMU2013.pdf");
    }

    @BeforeEach
    void setup() throws IOException {
        String jsonFile = "src/test/resources/input/f24standard.json";
        String jsonString = new String(Files.readAllBytes(Paths.get(jsonFile)));
        form = new ObjectMapper().readValue(jsonString, F24Standard.class);

        recordList = new ArrayList<Record>(Arrays.asList(
                new Record("1000", "0", "1000"),
                new Record("0", "800", "800"),
                new Record("1200", "0", "1200"),
                new Record("500", "0", "500"),
                new Record("1000", "0", "1000"),
                new Record("0", "800", "800"),
                new Record("1200", "0", "1200"),
                new Record("500", "0", "500")));

        pdfCreator = new StandardPDFCreator(form);
        pdfCreator.loadDoc("templates" + "/ModF24IMU2013.pdf");
    }

Replace Generic With Diamond ArrayList<Record> with ArrayList<> in method package setup() : void from class org.f24.service.pdf.util.StandardPDFCreatorTest


    protected AbstractPiece(int noOfSurfaces) throws IllegalArgumentException {
        if (noOfSurfaces < 1 || noOfSurfaces > 3) {
            throw new IllegalArgumentException(String.format("Illegal number of surfaces: %o. Must be 1,2 or 3.", noOfSurfaces));
        }
        this.surfaces = new HashMap<>(noOfSurfaces);
    }

    protected AbstractPiece(int noOfSurfaces) throws IllegalArgumentException {
        if (noOfSurfaces < 1 || noOfSurfaces > 3) {
            throw new IllegalArgumentException(String.format("Illegal number of surfaces: %o. Must be 1,2 or 3.", noOfSurfaces));
        }
        this.surfaces = new HashMap<Direction, Color>(noOfSurfaces);
    }

Replace Generic With Diamond HashMap<Direction,Color> with HashMap<> in method protected AbstractPiece(noOfSurfaces int) from class dk.pert.rubiks.rubiksmodel.AbstractPiece


    @Override
    public <K, V> List<RecordMetadata> send(final SendKeyValuesTransactional<K, V> sendRequest) throws InterruptedException {
        final Producer<K, V> producer = new KafkaProducer<>(effectiveProducerProps(sendRequest.getProducerProps()));
        final List<RecordMetadata> metadata = new ArrayList<>();
        try {
            producer.initTransactions();
            producer.beginTransaction();
            for (String topic : sendRequest.getRecordsPerTopic().keySet()) {
                for (KeyValue<K, V> record : sendRequest.getRecordsPerTopic().get(topic)) {
                    final ProducerRecord<K, V> producerRecord = new ProducerRecord<>(topic, null, record.getKey(), record.getValue(), record.getHeaders());
                    final Future<RecordMetadata> f = producer.send(producerRecord);
                    try {
                        metadata.add(f.get());
                    } catch (ExecutionException e) {
                        if (RuntimeException.class.isAssignableFrom(e.getCause().getClass())) throw (RuntimeException) e.getCause();
                        else throw new RuntimeException(e.getCause());
                    }
                }
            }
            if (sendRequest.shouldFailTransaction()) producer.abortTransaction();
            else producer.commitTransaction();
        } catch (ProducerFencedException e) {
            producer.abortTransaction();
            final String message = String.format(
                    "There happens to be another producer that shares the transactional ID '%s'" +
                            "with this producer, but that has a newer epoch assigned to it. This producer " +
                            "has been fenced off, it can no longer write to the log transactionally. Hence, " +
                            "the ongoing transaction is aborted and the producer closed.",
                    sendRequest.getProducerProps().get(ProducerConfig.TRANSACTIONAL_ID_CONFIG));
            throw new RuntimeException(message, e);
        } catch (OutOfOrderSequenceException e) {
            producer.abortTransaction();
            final String message = "This producer has received out-of-band sequence numbers. This is a fatal condition " +
                    "and thus, the producer is no longer able to log transactionally and reliably. " +
                    "Hence, the ongoing transaction is aborted and the producer closed.";
            throw new RuntimeException(message, e);
        } finally {
            producer.flush();
            producer.close();
        }
        return Collections.unmodifiableList(metadata);
    }

    @Override
    public <K, V> List<RecordMetadata> send(final SendKeyValuesTransactional<K, V> sendRequest) throws InterruptedException {
        final Producer<K, V> producer = new KafkaProducer<>(effectiveProducerProps(sendRequest.getProducerProps()));
        final List<RecordMetadata> metadata = new ArrayList<>();
        try {
            producer.initTransactions();
            producer.beginTransaction();
            for (String topic : sendRequest.getRecordsPerTopic().keySet()) {
                for (KeyValue<K, V> record : sendRequest.getRecordsPerTopic().get(topic)) {
                    final ProducerRecord<K, V> producerRecord = new ProducerRecord<K, V>(topic, null, record.getKey(), record.getValue(), record.getHeaders());
                    final Future<RecordMetadata> f = producer.send(producerRecord);
                    try {
                        metadata.add(f.get());
                    } catch (ExecutionException e) {
                        if (RuntimeException.class.isAssignableFrom(e.getCause().getClass())) throw (RuntimeException) e.getCause();
                        else throw new RuntimeException(e.getCause());
                    }
                }
            }
            if (sendRequest.shouldFailTransaction()) producer.abortTransaction();
            else producer.commitTransaction();
        } catch (ProducerFencedException e) {
            producer.abortTransaction();
            final String message = String.format(
                    "There happens to be another producer that shares the transactional ID '%s'" +
                            "with this producer, but that has a newer epoch assigned to it. This producer " +
                            "has been fenced off, it can no longer write to the log transactionally. Hence, " +
                            "the ongoing transaction is aborted and the producer closed.",
                    sendRequest.getProducerProps().get(ProducerConfig.TRANSACTIONAL_ID_CONFIG));
            throw new RuntimeException(message, e);
        } catch (OutOfOrderSequenceException e) {
            producer.abortTransaction();
            final String message = "This producer has received out-of-band sequence numbers. This is a fatal condition " +
                    "and thus, the producer is no longer able to log transactionally and reliably. " +
                    "Hence, the ongoing transaction is aborted and the producer closed.";
            throw new RuntimeException(message, e);
        } finally {
            producer.flush();
            producer.close();
        }
        return Collections.unmodifiableList(metadata);
    }

Replace Generic With Diamond ProducerRecord<K,V> with ProducerRecord<> in method public send(sendRequest SendKeyValuesTransactional<K,V>) : List<RecordMetadata> from class net.mguenther.kafka.junit.provider.DefaultRecordProducer


    public static void main(String[] args) throws IOException {
        int port = 6379;
        try (ServerSocket serverSocket = new ServerSocket(port)) {
            // Since the tester restarts your program quite often, setting SO_REUSEADDR
            // ensures that we don't run into 'Address already in use' errors
            serverSocket.setReuseAddress(true);

            System.out.println("Server has started on port: " + port);

            while (true) {
                new ConnectionHandler(serverSocket.accept()).start();
            }
        }
    }

    public static void main(String[] args) {

        ServerSocket serverSocket;
        Socket clientSocket = null;
        int port = 6379;
        try {
            serverSocket = new ServerSocket(port);
            // Since the tester restarts your program quite often, setting SO_REUSEADDR
            // ensures that we don't run into 'Address already in use' errors
            serverSocket.setReuseAddress(true);

            while (true) {
                // Wait for connection from client.
                clientSocket = serverSocket.accept();

                ClientHandler clientHandler = new ClientHandler(clientSocket);

                new Thread(clientHandler).start();
            }

        } catch (IOException e) {
            System.out.println("IOException: " + e.getMessage());
        } finally {
            try {
                if (clientSocket != null) {
                    clientSocket.close();
                }
            } catch (IOException e) {
                System.out.println("IOException: " + e.getMessage());
            }
        }
    }

Try With Resources try(ServerSocket serverSocket=new ServerSocket(port)) in method public main(args String[]) : void from class com.codeycoder.redis.Main


    public static List readFile(String fileName, String seperator) {
        List<List> bigList = new ArrayList<>();
        try {

            try (BufferedReader reader = new BufferedReader(new FileReader(fileName))) {
                String line;

                while ((line = reader.readLine()) != null) {
                    Vector innerList = new Vector();
                    String[] values = line.split(seperator);
//                display(values);
                    innerList.addAll(Arrays.asList(values));
                    bigList.add(innerList);
                }
            }
        } catch (FileNotFoundException ex) {
            Logger.getLogger(Utilities.class.getName()).log(Level.SEVERE, null, ex);
            errorMessage(ex);
        } catch (IOException ex) {
            Logger.getLogger(Utilities.class.getName()).log(Level.SEVERE, null, ex);
            errorMessage(ex);
        }

        return bigList;
    }

    public static List readFile(String fileName, String seperator) {
        List<List> bigList = new ArrayList<>();
        try {

            BufferedReader reader = new BufferedReader(new FileReader(fileName));
            String line;

            while ((line = reader.readLine()) != null) {
                Vector innerList = new Vector();
                String[] values = line.split(seperator);
//                display(values);
                innerList.addAll(Arrays.asList(values));
                bigList.add(innerList);
            }

            reader.close();
        } catch (FileNotFoundException ex) {
            Logger.getLogger(Utilities.class.getName()).log(Level.SEVERE, null, ex);
            errorMessage(ex);
        } catch (IOException ex) {
            Logger.getLogger(Utilities.class.getName()).log(Level.SEVERE, null, ex);
            errorMessage(ex);
        }

        return bigList;
    }

Try With Resources try(BufferedReader reader=new BufferedReader(new FileReader(fileName))) in method public readFile(fileName String, seperator String) : List from class com.saburi.utils.Utilities


    public static void writeFile(String fileName, Object[] value) {

        try {
            try (BufferedWriter writer = new BufferedWriter(new FileWriter(fileName))) {
                for (Object s : value) {
                    writer.append(s.toString());
                    writer.newLine();
                }
            }
        } catch (FileNotFoundException ex) {
            errorMessage(ex);
        } catch (IOException ex) {
            errorMessage(ex);
        }

    }

    public static void writeFile(String fileName, Object[] value) {

        try {
            BufferedWriter writer = new BufferedWriter(new FileWriter(fileName));
            for (Object s : value) {
                writer.append(s.toString());
                writer.newLine();
            }
            writer.close();
        } catch (FileNotFoundException ex) {
            errorMessage(ex);
        } catch (IOException ex) {
            errorMessage(ex);
        }

    }

Try With Resources try(BufferedWriter writer=new BufferedWriter(new FileWriter(fileName))) in method public writeFile(fileName String, value Object[]) : void from class com.saburi.utils.Utilities


    public static void writeFile(String fileName, String content) {

        try {
            try (BufferedWriter writer = new BufferedWriter(new FileWriter(fileName))) {

                writer.write(content);
                writer.newLine();
            }
        } catch (FileNotFoundException ex) {
            errorMessage(ex);
        } catch (IOException ex) {
            errorMessage(ex);
        }

    }

    public static void writeFile(String fileName, String content) {

        try {
            BufferedWriter writer = new BufferedWriter(new FileWriter(fileName));

            writer.write(content);
            writer.newLine();

            writer.close();
        } catch (FileNotFoundException ex) {
            errorMessage(ex);
        } catch (IOException ex) {
            errorMessage(ex);
        }

    }

Try With Resources try(BufferedWriter writer=new BufferedWriter(new FileWriter(fileName))) in method public writeFile(fileName String, content String) : void from class com.saburi.utils.Utilities