discovery(java): add global discovery api

   * Add global discovery api
   * Move injectMockPlugin from test to main so that we can use it
     in other platforms like mojo.

MultiPart: 1/3
Change-Id: If5e1e9345fa605e8855ffa78e0d860daee608816
2 files changed