### Question:
DelegatingContentHandlerImpl implements FileContentReferenceHandler { @Override public File getFile(ContentReference contentReference, boolean waitForTransfer) throws ContentIOException, InterruptedException { ContentReferenceHandler delegate = getDelegate(contentReference); if (!(FileContentReferenceHandler.class.isAssignableFrom(delegate.getClass()))) { throw new UnsupportedOperationException( delegate.getClass().getSimpleName() + " does not implement " + FileContentReferenceHandler.class.getSimpleName()); } return ((FileContentReferenceHandler) delegate).getFile(contentReference, waitForTransfer); }  void setDelegates(List<ContentReferenceHandler> delegates); @Override boolean isContentReferenceSupported(ContentReference contentReference); @Override boolean isContentReferenceExists(ContentReference contentReference); @Override ContentReference createContentReference(String fileName, String mediaType); @Override InputStream getInputStream(ContentReference contentReference, boolean waitForAvailability); @Override long putInputStream(InputStream sourceInputStream, ContentReference targetContentReference); @Override long putFile(File sourceFile, ContentReference targetContentReference); @Override void delete(ContentReference contentReference); @Override boolean isAvailable(); @Override File getFile(ContentReference contentReference, boolean waitForTransfer);  }### Answer:
@Test public void testGetFile() throws Exception { File sourceFile = delegatingHandler.getFile(contentReferenceFile1a, false); assertTrue(sourceFile.exists()); }
@Test public void testNonFileDelegate() throws Exception { MockEmptyContentReferenceHandlerImpl handlerC = new MockEmptyContentReferenceHandlerImpl(); ArrayList<ContentReferenceHandler> delegates = new ArrayList<ContentReferenceHandler>(); delegates.add(handlerA); delegates.add(handlerB); delegates.add(handlerC); ContentReference contentReference = new ContentReference("mock: thrown.expect(UnsupportedOperationException.class); delegatingHandler.getFile(contentReference, false); }