For anyone else who experiences this, I was using the incorrect method
on ObjectFactory to create the children, which are nested interfaces in
the DataPointer interface. The code should read:
List pathRef = pointer.getCategoryRefOrFieldRef();
for( int i = 0; i < 3; i++ )
{
FieldRef fieldRef = factory.createDataPointerFieldRef();
fieldRef.setId( i );
pathRef.add( fieldRef );
}
Thanks to Rob Collins for pointing this out.