public static void startTest(JFrame parent, List<String> algnames, int min, int max, int step, int repeat) {

        ProgressDialog pd = new ProgressDialog(parent, false);
        pd.setVisible(true);
        pd.println("Testing started.");

        Thread t = new Thread(() -> {
            try {
                Thread.sleep(100);
            } catch (InterruptedException ex) {
            }
            try {
                int totalSize = 0;
                for (int i = min; i <= max; i += min != max ? step : 1) {
                    for (int j = 0; j < repeat; j++) {
                        totalSize += i;
                        pd.print("Generating temporary file (" + i + " MB)... ");
                        long starttime = System.currentTimeMillis();
                        FileGenerator fg = new FileGenerator();
                        fg.generateNewFile(i);
                        files.add(fg);
                        long totaltime = System.currentTimeMillis() - starttime;
                        pd.println("\tDone in " + totaltime + " ms");
                    }
                }

                List<HashAlgoritm> algs = new ArrayList<>(algnames.size());

                algnames.stream().forEach((algname) -> {
                    algs.add(HashAlgoritms.getInstance().getAlgoritm(algname));
                });
                ChartMaker chart = new ChartMaker();
                for (HashAlgoritm alg : algs) {
                    pd.println("Start hashing with algorithm: '" + alg.getName() + "'");
                    
                    Collection<Number> time = new ArrayList<>(files.size());
                    Collection<Number> size = new ArrayList<>(files.size());
                    for (FileGenerator f : files) {
                        pd.print("\tHashing " + f.getFileLength() / (1024 * 1024) + " MB ...");
                        byte[] b = new byte[(int) f.getFileLength()];
                        f.getInputStream().read(b);

                        long starttime = System.currentTimeMillis();
                        alg.update(b);
                        alg.digest();
                        long totaltime = System.currentTimeMillis() - starttime;

                        alg.reset();
                        pd.println("\t\tDone in " + totaltime + " ms");
                        time.add(totaltime);
                        size.add(f.getFileLength() / (1024 * 1024));
                    }
                    chart.addSeries(alg.getName(), size, time);
                    pd.println("End hashing with algorithm: '" + alg.getName() + "'");
                }
                pd.print("Deleting temporary files (" + totalSize + " MB total)... ");
                deleteAllTempFiles();
                pd.println("\tDone!");

                pd.println("Test executed normaly.");
                pd.setOkEnabled(true);
                chart.display();
            } catch (Exception ex) {
                pd.println("\t\t\tFailed!");
                pd.println("\t" + ex.getMessage());
                pd.print("Deleting temporary files ... ");
                deleteAllTempFiles();
                pd.println("\tDone!");

                pd.println("Test executed abnormaly.");
                pd.setOkEnabled(true);
                ex.printStackTrace();
                return;
            }
            files.clear();
        });
        t.start();
    }