@Test
public void baseIdentifiableIdOnly()
{

    final OrganisationUnit ou1 = new OrganisationUnit();
    ou1.setUid( "abc1" );
    final OrganisationUnit ou2 = new OrganisationUnit();
    ou2.setUid( "abc2" );
    final CategoryOption option = new CategoryOption();
    option.setUid( "def1" );
    option.getOrganisationUnits().add( ou1 );
    option.getOrganisationUnits().add( ou2 );
    final FieldFilterParams params = new FieldFilterParams( Collections.singletonList( option ), Arrays.asList( "id", "organisationUnits" ) );
    final ComplexNode node = service.toComplexNode( params );
    Assert.assertEquals( "categoryOption", node.getName() );
    Assert.assertTrue( getNamedNode( node.getUnorderedChildren(), "id" ) instanceof SimpleNode );
    Assert.assertEquals( "def1", ( (SimpleNode) getNamedNode( node.getUnorderedChildren(), "id" ) ).getValue() );
    Assert.assertTrue( getNamedNode( node.getUnorderedChildren(), "organisationUnits" ) instanceof CollectionNode );
    final CollectionNode collectionNode = (CollectionNode) getNamedNode( node.getUnorderedChildren(), "organisationUnits" );
    Assert.assertEquals( 2, collectionNode.getUnorderedChildren().size() );
    final List<String> ouIds = new ArrayList<>();
    Assert.assertTrue( collectionNode.getUnorderedChildren().get( 0 ) instanceof ComplexNode );
    ComplexNode complexNode = (ComplexNode) collectionNode.getUnorderedChildren().get( 0 );
    Assert.assertEquals( "organisationUnit", complexNode.getName() );
    Assert.assertEquals( 1, complexNode.getUnorderedChildren().size() );
    Assert.assertTrue( complexNode.getUnorderedChildren().get( 0 ) instanceof SimpleNode );
    SimpleNode simpleNode = (SimpleNode) complexNode.getUnorderedChildren().get( 0 );
    Assert.assertEquals( "id", simpleNode.getName() );
    ouIds.add( String.valueOf( simpleNode.getValue() ) );
    Assert.assertTrue( collectionNode.getUnorderedChildren().get( 1 ) instanceof ComplexNode );
    complexNode = (ComplexNode) collectionNode.getUnorderedChildren().get( 1 );
    Assert.assertEquals( "organisationUnit", complexNode.getName() );
    Assert.assertEquals( 1, complexNode.getUnorderedChildren().size() );
    Assert.assertTrue( complexNode.getUnorderedChildren().get( 0 ) instanceof SimpleNode );
    simpleNode = (SimpleNode) complexNode.getUnorderedChildren().get( 0 );
    Assert.assertEquals( "id", simpleNode.getName() );
    ouIds.add( String.valueOf( simpleNode.getValue() ) );
    Assert.assertThat( ouIds, Matchers.containsInAnyOrder( "abc1", "abc2" ) );
}