Generate dynamic list in JAVA