Home ResponseBuilder - Long cannot be cast to Collection?
 I have this: Map social = new HashMap(); social.put("socialId", socialId); social.put("savedComment", savedComment); and I'm trying to do this: builder = Response.status(Response.Status.OK).entity(social); Why am I receiving HTTP Status 500 - java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.Collection, since Object should work with Long and general Object classes? Can't I send two different types of data, so data contains data.socialId (as a Long) and data.savedComment (as an object)? *By the way, socialId is a Long object, and savedComment is a SocialComment object.