Updated the java class to support junit test case. Added code to prevent -1 from being added as genre if not in the predefined list.