}
protected abstract void detachFromAllocation();
public final boolean belongsToSomeOf(Map<Long, Set<BaseEntity>> allocations) {
BaseEntity parent = getParent();
if (parent.getId() == null) {
Set<BaseEntity> entitiesWithNullId = allocations.get(null);
return entitiesWithNullId != null
&& entitiesWithNullId.contains(parent);
}
Set<BaseEntity> set = allocations.get(parent.getId());
return set != null;
}