public JsonSet withIdStrategy ( IdStrategy strategy ) { this . strategy = strategy ; if ( size ( ) > 0 ) { JsonSet seen = new JsonSet ( ) . withIdStrategy ( strategy ) ; Iterator < JsonElement > iterator = this . iterator ( ) ; while ( iterator . hasNext ( ) ) { JsonElement e = iterator . next ( ) ; if ( seen . contains ( e ) ) { iterator . remove ( ) ; } else { seen . add ( e ) ; } } } return this ; }
Changes the strategy on the current set .