public static void tar(@NotNull File source, @NotNull File dest) throws IOException {
        if (!source.exists()) {
            throw new IllegalArgumentException("No source file or folder exists: " + source.getAbsolutePath());
        }
        if (dest.exists()) {
            throw new IllegalArgumentException("Destination refers to existing file or folder: " + dest.getAbsolutePath());
        }

        try (TarArchiveOutputStream tarOut = new TarArchiveOutputStream(new GZIPOutputStream(
                new BufferedOutputStream(Files.newOutputStream(dest.toPath())), 0x1000))) {
            doTar("", source, tarOut);
        } catch (IOException e) {
            IOUtil.deleteFile(dest); // operation filed, let's remove the destination archive
            throw e;
        }
    }
@Test
    public void testNoSource() throws Exception {
        try {
            CompressBackupUtil.tar(new File(randName + ".txt"), dest);
        } catch (IllegalArgumentException e) {
            return;
        }
        Assert.fail("No source file/folder exists. Should have thrown an exception.");
    }