public void testEmptyProvider() throws IOException {
    assertEquals(1, ServerRegistry.getInstance().getProviders().size());

    ServerInstanceProvider provider = ServerRegistry.getInstance().getProviders().iterator().next();
    assertTrue(provider instanceof MockInstanceProvider);
    ((MockInstanceProvider) provider).clear();
    assertTrue(provider.getInstances().isEmpty());
  }
    public void stateChanged(ChangeEvent e) {
      final ServerRegistry registry = (ServerRegistry) e.getSource();

      List<ServerInstance> current = new ArrayList<ServerInstance>();
      for (ServerInstanceProvider provider : registry.getProviders()) {
        current.addAll(provider.getInstances());
      }

      List<ServerInstance> expected = steps.get(stepIndex++);
      assertEquals(expected.size(), current.size());

      for (ServerInstance instance : expected) {
        current.remove(instance);
      }

      assertTrue(current.isEmpty());
    }