How can I split strings in an ArrayList when finding reserved words in Java