{false, false}
};
boolean[] truths = { true, false };
// Some other parent, somewhere
AbstractComponent mockParent = mockComponent(false, true);
for (boolean last : truths) { // Whether or not comps are the last manifestations
for (boolean[] group : groups) {
// Assemble object graphs
Collection<AbstractComponent> selected = new ArrayList<AbstractComponent>();
Collection<AbstractComponent> toDelete = new HashSet<AbstractComponent>();
for (int i = 0; i < group.length; i++) {
AbstractComponent mockComponent = mockComponent(true, true);
Mockito.when(mockComponent.getReferencingComponents())
.thenReturn(Arrays.asList(mockParent));
toDelete.add(mockComponent);
selected.add(mockComponent);
List<AbstractComponent> children = new ArrayList<AbstractComponent>();
for (int j = 0; j < group.length ; j++){
AbstractComponent mockChild = mockComponent(group[j], true);
children.add(mockChild);
if (group[j]) {
toDelete.add(mockChild);
}
List<AbstractComponent> grandchildren = new ArrayList<AbstractComponent>();
for (int k = 0; k < group.length; k++) {
AbstractComponent mockGrandchild = mockComponent(group[k], true);
grandchildren.add(mockGrandchild);
if (group[j] && group[k]) {
toDelete.add(mockGrandchild);
}
Mockito.when(mockGrandchild.getReferencingComponents())
.thenReturn(last ?
Arrays.asList(mockChild) :
Arrays.asList(mockParent, mockChild));
}
Mockito.when(mockChild.getComponents())