### Question:
MediaItemHandler { protected MediaItem getRequestMediaItem(SocialRequestItem request) { MediaItem result = request.getOptionalTypedParameter("data", MediaItem.class); if (result == null) { result = request.getTypedParameter("mediaItem", MediaItem.class); } return result; } @Inject  MediaItemHandler(
      MediaItemService service, ContainerConfig config,
      CollectionOptionsFactory collectionOptionsFactory); @Operation(httpMethods = "GET") Future<?> get(SocialRequestItem request); @Operation(httpMethods = "DELETE") Future<?> delete(SocialRequestItem request); @Operation(httpMethods = "POST", bodyParam = "data") Future<?> create(SocialRequestItem request); @Operation(httpMethods = "PUT", bodyParam = "data") Future<?> update(SocialRequestItem request); @Operation(httpMethods = "GET", path = "/@supportedFields") List<Object> supportedFields(RequestItem request);  }### Answer:
@Test public void testGetRequestMediaItem() { String mediaItemJson = "{\"id\":\"mediaItem\"}"; request.setParameter("mediaItem", mediaItemJson); assertEquals("mediaItem", handler.getRequestMediaItem(request).getId()); String dataJson = "{\"id\":\"data\"}"; request.setParameter("data", dataJson); assertEquals("data", handler.getRequestMediaItem(request).getId()); }