complete requirement8 without Java design pattern