Nokia Interview Question

Solve use case using generic in Java