@Test
public void testGetChildren()
{

    Set<Long> parentIds = new HashSet<>();
    List<OrganisationUnitRelationship> relations = new ArrayList<>();
    int parentMax = 1000; // Increase to stress-test
    int childMax = 4;
    int childId = 0;
    for ( long parentId = 0; parentId < parentMax; parentId++ )
    {
        parentIds.add( parentId );
        for ( int j = 0; j < childMax; j++ )
        {
            relations.add( new OrganisationUnitRelationship( parentId, ++childId ) );
        }
    }
    OrganisationUnitHierarchy hierarchy = new OrganisationUnitHierarchy( relations );
    Set<Long> children = hierarchy.getChildren( parentIds );
    assertNotNull( children );
    assertEquals( (parentMax * childMax) + 1, children.size() );
}