@Override
    public boolean nextConfig(long timeout) {
        file.validateFile();
        if (checkReloaded()) {
            log.log(FINE, () -> "User forced config reload at " + System.currentTimeMillis());
            // User forced reload
            setConfigIfChanged(updateConfig());
            ConfigState<T> configState = getConfigState();
            log.log(FINE, () -> "Config updated at " + System.currentTimeMillis() + ", changed: " + configState.isConfigChanged());
            log.log(FINE, () -> "Config: " + configState.getConfig().toString());
            return true;
        }
        if (file.getLastModified() != ts) {
            setConfigIncGen(updateConfig());
            return true;
        }
        try {
            Thread.sleep(timeout);
        } catch (InterruptedException e) {
            throw new ConfigInterruptedException(e);
        }

        return false;
    }
@Test
    public void require_that_new_config_is_detected_in_time() throws IOException, InterruptedException {
        writeConfig("intval", "23");
        ConfigSubscription<SimpletypesConfig> sub = new FileConfigSubscription<>(
                new ConfigKey<>(SimpletypesConfig.class, ""),
                new FileSource(TEST_TYPES_FILE));
        assertTrue(sub.nextConfig(1000));
        assertEquals(23, sub.getConfigState().getConfig().intval());
        Thread.sleep(1000);
        writeConfig("intval", "33");
        assertTrue(sub.nextConfig(1000));
        assertEquals(33, sub.getConfigState().getConfig().intval());
    }