title: Lookup.getDefault().lookup() returns null
body: <p>What should be done if a lookup returns null? I am using Lookup.getDefault().lookup() of <code>org.openide.util.Lookup</code> which is used for finding instances of objects. The general pattern is to pass a Class object and get back an instance of that class or null.</p>
  
  <p>I am using it in the code below:</p>
  
  <pre><code>StreamingServer server = Lookup.getDefault().lookup(StreamingServer.class);
  ServerControllerFactory controllerFactory = Lookup.getDefault().lookup(ServerControllerFactory.class);
  StreamingController controller = Lookup.getDefault().lookup(StreamingController.class);
  </code></pre>
  
  <p>Since no istances are found, null is returned for each of these, '<code>server</code>', '<code>controllerFactory</code>', '<code>controller</code>'. I need to handle this situation so I can use these objects to access methods, as in :</p>
  
  <pre><code>controllerFactory.createServerController(graph)
  
  server.register(serverController, context)
  </code></pre>
  
  <p>How can I accomplish this?</p>