private void checkIndexPresence(Cache cache) {
    SearchIntegrator searchFactory = Search.getSearchManager(cache).unwrap(SearchIntegrator.class);

    assertTrue(searchFactory.getIndexedTypes().contains(getModelFactory().getUserImplClass()));
    assertNotNull(searchFactory.getIndexManager(getModelFactory().getUserImplClass().getName()));

    assertTrue(searchFactory.getIndexedTypes().contains(getModelFactory().getAccountImplClass()));
    assertNotNull(searchFactory.getIndexManager(getModelFactory().getAccountImplClass().getName()));

    assertTrue(
        searchFactory.getIndexedTypes().contains(getModelFactory().getTransactionImplClass()));
    assertNotNull(
        searchFactory.getIndexManager(getModelFactory().getTransactionImplClass().getName()));

    assertFalse(searchFactory.getIndexedTypes().contains(getModelFactory().getAddressImplClass()));
    assertNull(searchFactory.getIndexManager(getModelFactory().getAddressImplClass().getName()));
  }
 protected void assertIndexingKnows(BasicCache<?, ?> cache, Class<?>... types) {
   ComponentRegistry cr = ((Cache) cache).getAdvancedCache().getComponentRegistry();
   SearchIntegrator searchIntegrator = cr.getComponent(SearchIntegrator.class);
   assertNotNull(searchIntegrator);
   HashSet<Class<?>> expectedTypes = new HashSet<Class<?>>(Arrays.asList(types));
   HashSet<Class<?>> indexedTypes = new HashSet<Class<?>>(searchIntegrator.getIndexedTypes());
   assertEquals(expectedTypes, indexedTypes);
 }