added PatternsTest.java