Java pattern programs related domains (1)