Advanced Factory Method - java