SimpleJaxb implements Jaxb { public <T> T unmarshal(Class<T> type, Type genericType, Reader reader) throws JAXBException { return (T) unmarshaller.unmarshal(reader); } SimpleJaxb(JAXBContext jaxbContext); void marshal(T object, OutputStream out, Charset charset); T unmarshal(Class<T> type, Type genericType, Reader reader);  }
@Test public void shouldUnmarshalByDelegatingToJaxbUnmarshallerWithGivenArgument() throws JAXBException { Object expected = new Object(); Class arg = Object.class; Type arg2 = String.class; Reader reader = mock(Reader .class); when(mockUnmarshaller.unmarshal(reader)).thenReturn(expected); Object actual = toTest.unmarshal(arg, arg2, reader); verify(mockUnmarshaller).unmarshal(reader); assertSame(expected, actual); }