### Question:
MetaverseUtil { public static IDocumentController getDocumentController() { if ( documentController != null ) { return documentController; } try { documentController = (IDocumentController) MetaverseBeanUtil.getInstance().get( "IDocumentController" ); } catch ( Exception e ) { } return documentController; }  static IDocumentController getDocumentController(); static void setDocumentController( IDocumentController docController ); static IDocument createDocument(
    INamespace namespace,
    Object content,
    String id,
    String name,
    String extension,
    String mimeType ); static void addLineageGraph( final IDocument document, Graph graph ); static void enhanceEdge( Edge edge ); static void enhanceVertex( Vertex vertex ); static Operations convertOperationsStringToMap( String operations ); static Runnable getAnalyzerRunner( final IDocumentAnalyzer analyzer, final IDocument document ); static void delay(); static final String MESSAGE_PREFIX_NODETYPE; static final String MESSAGE_PREFIX_LINKTYPE; static final String MESSAGE_PREFIX_CATEGORY; static final String MESSAGE_FAILED_PREFIX; }### Answer:
@Test public void testGetDocumentController() throws Exception { IDocumentController documentController = MetaverseUtil.getDocumentController(); assertNotNull( documentController ); MetaverseUtil.documentController = null; assertNull( MetaverseUtil.getDocumentController() ); MetaverseBeanUtil instance = MetaverseBeanUtil.getInstance(); BundleContext bundleContext = mock( BundleContext.class ); Bundle bundle = mock( Bundle.class ); when( bundleContext.getBundle() ).thenReturn( bundle ); instance.setBundleContext( bundleContext ); ServiceReference serviceReference = mock( ServiceReference.class ); BlueprintContainer service = mock( BlueprintContainer.class ); when( bundleContext.getService( Mockito.any( ServiceReference.class ) ) ).thenReturn( service ); when( service.getComponentInstance( "IDocumentController" ) ).thenReturn( documentController ); assertNull( MetaverseUtil.getDocumentController() ); }