Buggy code:
class CompositeNodeDataWithSchema extends AbstractNodeDataWithSchema { private static final Function < DataSchemaNode , QName > QNAME_FUNCTION = new Function < DataSchemaNode , QName > ( ) { @ Override public QName apply ( @ Nonnull final DataSchemaNode input ) { } } ; private final Multimap < AugmentationSchema , AbstractNodeDataWithSchema > augmentationsToChild = ArrayListMultimap . create ( ) ; private final List < AbstractNodeDataWithSchema > children = new ArrayList < > ( ) ; public CompositeNodeDataWithSchema ( final DataSchemaNode schema ) { } public AbstractNodeDataWithSchema addChild ( final Deque < DataSchemaNode > schemas ) { Preconditions . checkArgument ( ( ! ( schemas . isEmpty ( ) ) ) , "Expecting<seq2seq4repair_space>at<seq2seq4repair_space>least<seq2seq4repair_space>one<seq2seq4repair_space>schema" ) ; final DataSchemaNode schema = schemas . pop ( ) ; if ( schemas . isEmpty ( ) ) { return addChild ( schema ) ; } final DataSchemaNode choiceCandidate = schema ; Preconditions . checkArgument ( ( choiceCandidate instanceof ChoiceSchemaNode ) , "Expected<seq2seq4repair_space>node<seq2seq4repair_space>of<seq2seq4repair_space>type<seq2seq4repair_space>ChoiceNode<seq2seq4repair_space>but<seq2seq4repair_space>was<seq2seq4repair_space>%s" , choiceCandidate . getClass ( ) . getSimpleName ( ) ) ; final ChoiceSchemaNode choiceNode = ( ( ChoiceSchemaNode ) ( choiceCandidate ) ) ; final DataSchemaNode caseCandidate = schemas . pop ( ) ; Preconditions . checkArgument ( ( caseCandidate instanceof ChoiceCaseNode ) , "Expected<seq2seq4repair_space>node<seq2seq4repair_space>of<seq2seq4repair_space>type<seq2seq4repair_space>ChoiceCaseNode<seq2seq4repair_space>but<seq2seq4repair_space>was<seq2seq4repair_space>%s" , caseCandidate . getClass ( ) . getSimpleName ( ) ) ; final ChoiceCaseNode caseNode = ( ( ChoiceCaseNode ) ( caseCandidate ) ) ; AugmentationSchema augSchema = null ; if ( choiceCandidate . isAugmenting ( ) ) { augSchema = findCorrespondingAugment ( getSchema ( ) , choiceCandidate ) ; } final Collection < AbstractNodeDataWithSchema > childNodes ; if ( augSchema != null ) { childNodes = augmentationsToChild . get ( augSchema ) ; } else { childNodes = children ; } CompositeNodeDataWithSchema caseNodeDataWithSchema = findChoice ( childNodes , choiceCandidate , caseCandidate ) ; if ( caseNodeDataWithSchema == null ) { ChoiceNodeDataWithSchema choiceNodeDataWithSchema = new ChoiceNodeDataWithSchema ( choiceNode ) ; <START_BUG> addChild ( choiceNodeDataWithSchema ) ; <END_BUG> caseNodeDataWithSchema = choiceNodeDataWithSchema . addCompositeChild ( caseNode ) ; } return caseNodeDataWithSchema . addChild ( schemas ) ; } private AbstractNodeDataWithSchema addSimpleChild ( final DataSchemaNode schema ) { } private CaseNodeDataWithSchema findChoice ( final Collection < AbstractNodeDataWithSchema > childNodes , final DataSchemaNode choiceCandidate , final DataSchemaNode caseCandidate ) { } AbstractNodeDataWithSchema addCompositeChild ( final DataSchemaNode schema ) { } void addCompositeChild ( final CompositeNodeDataWithSchema newChild ) { } private AbstractNodeDataWithSchema addChild ( final DataSchemaNode schema ) { } public void addChild ( final AbstractNodeDataWithSchema newChild ) { } protected final int childSizeHint ( ) { } AugmentationSchema findCorrespondingAugment ( final DataSchemaNode parent , final DataSchemaNode child ) { } @ Override public void write ( final NormalizedNodeStreamWriter writer ) throws IOException { } private static AugmentationIdentifier toAugmentationIdentifier ( final AugmentationSchema schema ) { } }

Fix:
childNodes . add ( choiceNodeDataWithSchema ) ;