	@Test
	public void testReadTestObjectClosesStream() throws WebApplicationException, IOException {

		GsonProvider<TestObject> testObjectProvider = new GsonProvider<TestObject>();
		TestObject testObject = new TestObject( "foo" );
		String json = new Gson().toJson( testObject );
		ByteArrayInputStream inputStream = spy( new ByteArrayInputStream( json.getBytes( "UTF-8" ) ) );

		testObjectProvider.readFrom( TestObject.class, null, null, null, null, inputStream );

		verify( inputStream ).close();
	}