@Test
public void testGetParentCommunity() throws Exception 
{

    new NonStrictExpectations(authorizeService.getClass())
    {{
        // Allow current Community ADD perms
        authorizeService.authorizeAction((Context) any, (Community) any,
                Constants.ADD); result = null;
        // Allow *parent* Community ADD perms
        authorizeService.authorizeActionBoolean((Context) any, (Community) any,
                Constants.ADD); result = true;
    }};
    //null by default
    assertEquals("testGetParentCommunity 0", c.getParentCommunities().size(), 0);
    //community with  parent
    Community son = communityService.create(c, context);
    assertThat("testGetParentCommunity 1",son.getParentCommunities().size(), not(0));
    assertThat("testGetParentCommunity 2", son.getParentCommunities().get(0), equalTo(c));
}