@Test
public void testOnRemove() throws Exception {

    Process process = new Process();
    process.setName("rp1");
    Cluster cluster = new Cluster();
    cluster.setName("rc1");
    cluster.setColo("2");
    org.apache.ivory.entity.v0.process.Cluster processCluster = new org.apache.ivory.entity.v0.process.Cluster();
    processCluster.setName("rc1");
    process.setClusters(new org.apache.ivory.entity.v0.process.Clusters());
    process.getClusters().getClusters().add(processCluster);
    store.publish(EntityType.CLUSTER, cluster);
    store.publish(EntityType.PROCESS, process);
    Set<Entity> entities = graph.getDependents(process);
    Assert.assertEquals(entities.size(), 1);
    Assert.assertTrue(entities.contains(cluster));
    entities = graph.getDependents(cluster);
    Assert.assertEquals(entities.size(), 1);
    Assert.assertTrue(entities.contains(process));
    store.remove(EntityType.PROCESS, process.getName());
    entities = graph.getDependents(cluster);
    Assert.assertTrue(entities == null);
    entities = graph.getDependents(process);
    Assert.assertTrue(entities == null);
}