add TestPat.java and TestPatTest.java