updated PatternsTest.java