add java design pattern