@Test
public void testWithSimpleCycle_Depth2()
                        throws Exception {

    GMLAppSchemaReader xsdDecoder = new GMLAppSchemaReader( null, null, schemaWithSimpleCycle );
    AppSchema appSchema = xsdDecoder.extractAppSchema();
    CRSRef storageCrs = CRSManager.getCRSRef( "EPSG:4326" );
    GeometryStorageParams geometryParams = new GeometryStorageParams( storageCrs, String.valueOf( "0" ), DIM_2 );
    AppSchemaMapper mapper = new AppSchemaMapper( appSchema, false, true, geometryParams, 63, true, true, 2 );
    MappedAppSchema mappedSchema = mapper.getMappedSchema();
    Map<QName, FeatureTypeMapping> ftMappings = mappedSchema.getFtMappings();
    assertThat( ftMappings.size(), is( 1 ) );
    FeatureTypeMapping featureA = mappedSchema.getFtMapping( FEATURE_A );
    List<Mapping> mappings = featureA.getMappings();
    assertThat( mappings.size(), is( 5 ) );
    // Depth 0
    CompoundMapping featureCDepth0 = getFeatureC( mappings );
    List<Mapping> featureCDepth0Mapping = featureCDepth0.getParticles();
    assertThat( featureCDepth0Mapping.size(), is( 3 ) );
    // Depth 1
    CompoundMapping featureCDepth1 = getFeatureC( featureCDepth0Mapping );
    List<Mapping> featureCDepth1Mapping = featureCDepth1.getParticles();
    assertThat( featureCDepth1Mapping.size(), is( 3 ) );
    // Depth 2
    CompoundMapping featureCDepth2 = getFeatureC( featureCDepth1Mapping );
    List<Mapping> featureCDepth2Mapping = featureCDepth2.getParticles();
    assertThat( featureCDepth2Mapping.size(), is( 2 ) );
    // Depth 3
    CompoundMapping featureCDepth3 = getFeatureC( featureCDepth2Mapping );
    assertThat( featureCDepth3, is( nullValue() ) );
}