Since you are using ArrayList
to store your% s of% s, I would advise you to go through all the variables in your list and check if it contains the text you want. Example:
List<String> list = new ArrayList<String>();
//pega os dados do xhtml e joga na variavel list
for(String s: list) {
if(s.contains("Bean")) {
System.out.println(s);
}
}
In the example above I'm printing all the% s of% s that have the literal String
of the variable String
and then printing it. Instead of printing you can manipulate the variable Bean
the way you want, it contains the literal excerpt that you put in the list
conditional above.