To avoid ClassCastException while retriving entity from RESTResource of

GenericResource