You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: hide_hierarchy_system.rs
    path of file: ./repos/amethyst/amethyst_core/src
    
    the code of the file until where you have to start completion: use std::collections::HashSet;

#[cfg(feature = "profiler")]
use thread_profiler::profile_scope;

use crate::{
    ecs::{Entity, IntoQuery, ParallelRunnable, System, SystemBuilder},
    transform::{Children, Parent},
    HiddenPropagate,
};

/// This system adds a [`HiddenPropagate`](struct.HiddenPropagate.html)-component to all children
/// of an entity with a [`HiddenPropagate`](struct.HiddenPropagate.html) and removes it when it is removed
/// from the parent.
#[derive(Debug)]
pub struct HideHierarchySystem;

impl System for HideHierarchySystem {
    fn build(self) -> Box<dyn ParallelRunnable> {
        Box::new(
            SystemBuilder::new("HideHierarchySystem")
                .with_query(<(&Children, Option<&HiddenPropagate>)>::query())
                .with_query(<(Entity, &Parent, Option<&HiddenPropagate>)>::query())
                .write_component::<HiddenPropagate>()
                .build(move |commands, world, _resources, (parent, children)| {
                    #[cfg(feature = "profiler")]
                    profile_scope!("hide_hierarchy_system");

                    let mut children_with_hidden_parent: HashSet<&Entity> = HashSet::new();
                    let mut children_without_hidden_parent: HashSet<&Entity> = HashSet::new();

                    for (current_children, hidden) in parent.iter(world) {
                        if let Some(hidden_propagate) = hidden {
                  
    
    fn should_not_add_hidden_to_child_if_not_propagated() {
        let mut resources = Resources::default();
        let mut world = World::default();

        let mut schedule = Schedule::from(vec![
            systems::Step::Systems(systems::Executor::new(vec![
                MissingPreviousParentSystem.build()
            ])),
            systems::Step::FlushCmdBuffers,
            systems::Step::Systems(systems::Executor::new(vec![
                HideHierarchySystem.build(),
                ParentUpdateSystem.build(),
            ])),
            systems::Step::FlushCmdBuffers,
        ]);

        let parent = world.push((Transform::default(),));
        let children = world.extend(vec![(Transform::default(),), (Transform::default(),)]);
        let (e1, e2) = (children[0], children[1]);
        // Parent `e1` and `e2` to `parent`.
        world.entry(e1).unwrap().add_component(Parent(parent));
        world.entry(e2).unwrap().add_component(Parent(parent));

        schedule.execute(&mut world, &mut resources);

        assert!(
            world
                .entry(parent)
                .unwrap()
                .get_component::<HiddenPropagate>()
                .is_err()
        );

        assert!(
            world
                .entry(e1)
                .unwrap()
                .get_component::<HiddenPropagate>()
                .is_err()
        );

        assert!(
            world
                .entry(e2)
                .unwrap()
                .get_component::<HiddenPropagate>()
                .is_err()
        );

        world
            .entry(parent)
            .unwrap()
            .add_component(HiddenPropagate::new());

        schedule.execute(&mut world, &mut resources);

        assert!(
            world
                .entry(parent)
                .unwrap()
                .get_component::<HiddenPropagate>()
                .is_ok()
        );

        schedule.execute(&mut world, &mut resources);

        assert!(
            world
                .entry(e1)
                .unwrap()
                .get_component::<HiddenPropagate>()
                .is_err()
        );

        assert!(
            world
                .entry(e2)
                .unwrap()
                .get_component::<HiddenPropagate>()
                .is_err()
        );
    }