You could either use regular expressions in Java using the pattern and matcher classes, or you could just create other variables and test for them.
Another way would to be to create an array that would hold each of these strings, then compare through each of these strings with a for loop and check if it's in there.
Or if you wanted it to be more dynamic and extensible, you could create an ArrayList!
Anyways, psuedocode for the array:
public class test
declare array w/ all strings in it
loop through array till you find it