### Question:
ExternalResourceInfoFactory { public static IExternalResourceInfo createFileResource( FileObject fileObject ) { return createFileResource( fileObject, DEFAULT_IS_INPUT ); } protected  ExternalResourceInfoFactory(); static IExternalResourceInfo createDatabaseResource( DatabaseMeta databaseMeta ); static IExternalResourceInfo createDatabaseResource( DatabaseMeta databaseMeta, boolean isInput ); static IExternalResourceInfo createResource( ResourceEntry resourceEntry ); static IExternalResourceInfo createResource( ResourceEntry resourceEntry, boolean isInput ); static IExternalResourceInfo createFileResource( FileObject fileObject ); static IExternalResourceInfo createFileResource( FileObject fileObject, boolean isInput ); static IExternalResourceInfo createURLResource( String url ); static IExternalResourceInfo createURLResource( String url, boolean isInput );  }### Answer:
@Test public void testCreateFileResource() throws Exception { assertNull( ExternalResourceInfoFactory.createFileResource( null ) ); FileObject mockFile = mock( FileObject.class ); IExternalResourceInfo resource = ExternalResourceInfoFactory.createFileResource( mockFile, false ); assertNotNull( resource ); assertNull( resource.getName() ); assertFalse( resource.isInput() ); when( mockFile.getPublicURIString() ).thenReturn( "/path/to/file" ); resource = ExternalResourceInfoFactory.createFileResource( mockFile, true ); assertNotNull( resource ); assertEquals( "/path/to/file", resource.getName() ); assertTrue( resource.isInput() ); }