class EntityReference implements Serializable, Cloneable, Comparable<EntityReference> {

    @Override public EntityReference clone()
    {
        EntityReference reference;
        try {
            reference = (EntityReference) super.clone();
        } catch (CloneNotSupportedException e) {
            // Should never happen
            throw new RuntimeException("Failed to clone object", e);
        }
        reference.setName(getName());
        reference.setType(getType());
        if (getParent() != null) {
            reference.setParent(getParent().clone());
        }
        return reference;
    }

    public  EntityReference(String name, EntityType type);
    public  EntityReference(String name, EntityType type, EntityReference parent);

}