java pattern sample