private Collection<IntegrationEntity> collectEntities() {
if (entity instanceof IntegrationProject) {
return ((IntegrationProject) entity).getAllEntities();
} else if (entity instanceof Folder) {
KList<IntegrationEntity> items = ((Folder) entity).getAllItemsRecursively(IntegrationEntity.class);
return items.removeAll(new InstanceOfPredicate(Folder.class));
} else {
Set<IntegrationEntity> items = Sets.newHashSet(project.getDependencyStore().getRequiredObjectsRecursively(entity));
items.add(entity);
return items;
}