@Test
public void cancelSchedule() throws InterruptedException {

    PropertySource ps = BuildablePropertySource.builder().withName("test")
            .withSimpleProperty("foo", "bar").build();
    PropertySourceChangeSupport support = new PropertySourceChangeSupport(ChangeSupport.IMMUTABLE, ps);
    support.load(ps.getProperties());
    String v1 = support.getVersion();
    support.scheduleChangeMonitor(() -> Collections.emptyMap(), 1, TimeUnit.SECONDS);
    Thread.sleep(500L);
    support.cancelSchedule();
    String v2 = support.getVersion();
    assertThat(v1).isEqualTo(v2);
}