question: private static String ensureUniqueId ( String id ) { Object exists = DOM . getElementById ( id ) ; int i = 0 ; while ( exists != null ) { exists = DOM . getElementById ( id + "_" + ( ++ i ) ) ; } if ( i > 0 ) { id = id + "_" + i ; } return id ; }
target:  Ensures that the given id is not being used in the current document. If this is not the case, returns an unique id.