Code examples of different approaches to testing regular expressions in Java.