code goes here *public findother ( personreturn null/stub for find public void remove ( personp other/remove code goes here *this class should be compared with class personpairdirectory in code fragment given the class abovewe can declare variable referring to an instance of personpairdirectorygenericthat stores pairs of objects of type studentpersonpairdirectorygeneric mystudentdirectoryfor such an instancemethod findother returns value of type student thusthe following statementwhich does not use castis correctstudent cute_one mystudentdirectory findother(smart_one)the generics framework allows us to define generic versions of methods in this casewe can include the generic definition among the method modifiers for examplewe show below the definition of method that can compare the keys from any two pair objectsprovided that their keys implement the comparable interfacepublic static int comparepairs(pair ppair qreturn getkey(compareto( getkey())/ ' key implements compare to there is an important caveat related to generic typesnamelythat the elements stored in array cannot be type variable or parameterized type java allows for an array to be defined with parameterized typebut it doesn' allow parameterized type to be used to create new array fortunatelyit allows for an array defined with parameterized type to be initialized with newly creatednonparametric array even sothis latter mechanism causes the java compiler to issue warningbecause it is not type-safe we illustrate this point in the following