java pattern test and study