createImplementationClass("initial");
Registry registry = createRegistry();
ReloadableService reloadable = registry.getService(ReloadableService.class);
fireUpdateCheck(registry);
assertEquals(reloadable.getStatus(), "initial");
fireUpdateCheck(registry);
// Sleep long enough that the Java millisecond clock advances.
Thread.currentThread().sleep(1500);
createImplementationClass("updated");
// Doesn't take effect until after the update check
assertEquals(reloadable.getStatus(), "initial");
fireUpdateCheck(registry);
assertEquals(reloadable.getStatus(), "updated");
registry.shutdown();
}