public static void main(String[] args) {

        File startDir = new File(START_SEARCH_DIR);
        File[] filesInDir = startDir.listFiles();
        if (!startDir.isDirectory() || !startDir.exists()) {
            throw new IllegalArgumentException("Start directory does not exists: " + startDir.getAbsolutePath());
        }

        for (File f : filesInDir) {
            File[] javaFiles = f.listFiles(new JavaFilesFilter());
            if (javaFiles != null) {
                String packageName = f.getName();
                for (File javaFile : javaFiles) {
                    RandomAccessFile randomAccessResultFile = null;
                    FileReader fileTmpReader = null;
                    String javaFileName = javaFile.getAbsolutePath();
                    try {
                        if (!isPackageWordExistsInFile(javaFile)) {
                            javaFile.renameTo(new File(javaFileName + "_tmp"));
                            File resultFile = new File(javaFileName);
                            boolean isResultFileCreated = resultFile.createNewFile();
                            randomAccessResultFile = new RandomAccessFile(resultFile, "rw");
                            String packageToWrite = PACKAGE_WORD + packageName + ";" + "\n";
                            System.out.println("ResultFile: " + resultFile.getAbsolutePath() + " string to write: "
                                    + packageToWrite + " created: " + isResultFileCreated);
                            randomAccessResultFile.write(packageToWrite.getBytes());
                            copyContentFile(javaFileName + "_tmp", resultFile.getAbsolutePath());
                        }
                    } catch (IOException e) {
                        e.printStackTrace();
                    } finally {
                        new File(javaFileName + "_tmp").delete();
                        try {
                            if (randomAccessResultFile != null)
                                randomAccessResultFile.close();
                        } catch (IOException e) {
                            e.printStackTrace();
                        }
                    }
                }
            }

        }
    }