I iterate through an ArrayList this way:
for (T t : list){ ... }
When I did this, I never thought I had to access the previous and next eleme
I found a solution too. It was next.
For next: letters.get(letters.indexOf(')')+1)
letters.get(letters.indexOf(')')+1)
For previous: letters.get(letters.indexOf(')')-1)
letters.get(letters.indexOf(')')-1)