question: public List < Node > findMb ( String targetName ) { Node target = getVariableForName ( targetName ) ; List < Node > blanket = new LinkedList < > ( ) ; boolean changed = true ; while ( changed ) { changed = false ; List < Node > remaining = new LinkedList < > ( variables ) ; remaining . removeAll ( blanket ) ; remaining . remove ( target ) ; for ( Node node : remaining ) { if ( ! independenceTest . isIndependent ( node , target , blanket ) ) { blanket . add ( node ) ; changed = true ; } } } changed = true ; while ( changed ) { changed = false ; for ( Node node : new LinkedList < > ( blanket ) ) { blanket . remove ( node ) ; if ( independenceTest . isIndependent ( node , target , blanket ) ) { changed = true ; continue ; } blanket . add ( node ) ; } } return blanket ; }
target:  Finds the Markov blanket of the given target.