@Test
  public void testGetInstances() {
    try {
      for (int i = 0; i < 10000; i++) {
        applicationElement.getInstances("*");
      }

      assertEquals(3, applicationElement.getInstances("*").getCount());
      assertEquals(1, applicationElement.getInstances("Slow*").getCount());
    } catch (AoException e) {
      fail(e.reason);
    }
  }
  @Test
  public void testRemoveInstance() {
    try {
      assertEquals(3, applicationElement.getInstances("*").getCount());

      InstanceElement ie = applicationElement.createInstance("new_instance");
      assertEquals(4, applicationElement.getInstances("*").getCount());
      assertEquals(ie.getName(), applicationElement.getInstanceByName("new_instance").getName());

      applicationElement.removeInstance(ie.getId(), false);
      assertEquals(3, applicationElement.getInstances("*").getCount());
      assertEquals(null, applicationElement.getInstanceByName("new_instance"));
    } catch (AoException e) {
      fail(e.reason);
    }
    // non existing instance
    try {
      applicationElement.removeInstance(ODSHelper.asODSLongLong(999), false);
      fail("AoException expected");
    } catch (AoException e) {
    }
  }