public boolean checkAndRefresh() {
        FileTime newLastModifiedTime = updateLastModifiedTime();
        if (newLastModifiedTime != null && !newLastModifiedTime.equals(lastModifiedTime)) {
            this.lastModifiedTime = newLastModifiedTime;
            return true;
        }
        return false;
    }
@Test(dataProvider = "files")
    public void testFileModified(String fileName) throws IOException, InterruptedException {
        Path path = Paths.get(fileName);
        createFile(path);
        FileModifiedTimeUpdater fileModifiedTimeUpdater = new FileModifiedTimeUpdater(fileName);
        Thread.sleep(2000);
        Files.setLastModifiedTime(path, FileTime.fromMillis(System.currentTimeMillis()));
        FileTime fileTime = fileModifiedTimeUpdater.getLastModifiedTime();
        Assert.assertTrue(fileModifiedTimeUpdater.checkAndRefresh());
        Assert.assertNotEquals(fileTime, fileModifiedTimeUpdater.getLastModifiedTime());
    }