So...., whats the objective of this piece of code? - like, you want to detect when a duplicate
String is being added to your arraylist or something?
I'm not sure what your requirement is, but...but if so, you can go for a Set instead of an ArrayList.