### Question:
OperationResourceInfo { public List<MediaType> getConsumeTypes() { return consumeMimes; } OperationResourceInfo(Method mInvoke, ClassResourceInfo cri);   OperationResourceInfo(OperationResourceInfo ori, ClassResourceInfo cri);  OperationResourceInfo(Method mInvoke, Method mAnnotated, ClassResourceInfo cri);  OperationResourceInfo(Method m,
                                 ClassResourceInfo cri,
                                 URITemplate template,
                                 String httpVerb,
                                 String consumeMediaTypes,
                                 String produceMediaTypes,
                                 List<Parameter> params,
                                 boolean oneway); void addNameBindings(List<String> names); Set<String> getNameBindings(); boolean isOneway(); boolean isAsync(); List<Parameter> getParameters(); URITemplate getURITemplate(); void setURITemplate(URITemplate u); ClassResourceInfo getClassResourceInfo(); Method getMethodToInvoke(); Method getAnnotatedMethod(); void setMethodToInvoke(Method m); String getHttpMethod(); void setHttpMethod(String m); boolean isSubResourceLocator(); List<MediaType> getProduceTypes(); List<MediaType> getConsumeTypes(); boolean isEncodedEnabled(); String getDefaultParameterValue(); Annotation[][] getInParameterAnnotations(); Type[] getInGenericParameterTypes(); Class<?>[] getInParameterTypes(); Annotation[] getOutAnnotations();  }### Answer:
@Test public void testConsumeTypes() throws Exception { OperationResourceInfo ori1 = new OperationResourceInfo( TestClass.class.getMethod("doIt", new Class[]{}), new ClassResourceInfo(TestClass.class)); List<MediaType> ctypes = ori1.getConsumeTypes(); assertEquals("Single media type expected", 1, ctypes.size()); assertEquals("Class resource consume type should be used", "application/xml", ctypes.get(0).toString()); OperationResourceInfo ori2 = new OperationResourceInfo( TestClass.class.getMethod("doThat", new Class[]{}), new ClassResourceInfo(TestClass.class)); ctypes = ori2.getConsumeTypes(); assertEquals("Single media type expected", 1, ctypes.size()); assertEquals("Method consume type should be used", "application/atom+xml", ctypes.get(0).toString()); }