+ @Test
+ public void testGroupingStatementReuse() throws Exception {
+ final ModuleEffectiveStatement module = StmtTestUtils.parseYangSource("/bugs/YT1208/grouping.yang")
+ .getModuleStatements()
+ .get(QNameModule.create(URI.create("foo")));
+ assertNotNull(module);
+
+ final NotificationEffectiveStatement notif = module
+ .findFirstEffectiveSubstatement(NotificationEffectiveStatement.class).orElseThrow();
+
+ final GroupingEffectiveStatement grpBar = notif
+ .findFirstEffectiveSubstatement(GroupingEffectiveStatement.class).orElseThrow()
+ .findFirstEffectiveSubstatement(ContainerEffectiveStatement.class).orElseThrow()
+ .findFirstEffectiveSubstatement(GroupingEffectiveStatement.class).orElseThrow();
+ final GroupingEffectiveStatement contBar = notif
+ .findFirstEffectiveSubstatement(ContainerEffectiveStatement.class).orElseThrow()
+ .findFirstEffectiveSubstatement(ContainerEffectiveStatement.class).orElseThrow()
+ .findFirstEffectiveSubstatement(GroupingEffectiveStatement.class).orElseThrow();
+
+ assertSame(contBar, grpBar);
+ }
+