@Test
public final void listChildDepartments() {

    OrganisationUtils organisationUtils = new OrganisationUtils();
    Date date = DateUtils.date(2012, 1, 3);
    Company headquarter = organisationUtils.createCompany("总公司", date);
    headquarter.save();
    Department financial = organisationUtils.createDepartment("财务部", headquarter, date);
    Company company1 = organisationUtils.createCompany("分公司1", headquarter, date);
    Department dept1 = organisationUtils.createDepartment("核算科", financial, date);
    Department dept2 = organisationUtils.createDepartment("财务部2", company1, date);
    List<Department> departments = headquarter.listChildDepartments();
    assertTrue(departments.contains(financial));
    assertFalse(departments.contains(company1));
    assertFalse(departments.contains(dept1));
    assertFalse(departments.contains(dept2));
}