LocationFactory { @Deprecated public static LostApiClient sharedClient(Context context) { if (shared == null) { shared = new LostApiClient.Builder(context).build(); } return shared; }  @Deprecated static LostApiClient sharedClient(Context context); @Deprecated static LostApiClient sharedClient(Context context,
      ConnectionCallbacks callbacks); LostApiClient getApiClient(Context context);  }
@Test public void sharedClient_shouldNotBeNull() throws Exception { assertThat(LocationFactory.sharedClient(Mockito.mock(Context.class))).isNotNull(); }
@Test public void sharedClientWithCallbacks_shouldNotBeNull() throws Exception { assertThat(LocationFactory.sharedClient(Mockito.mock(Context.class), new TestConnectionCallbacks())).isNotNull(); }
@Test public void sharedClient_shouldReturnSameClientForSameContext() throws Exception { Context context = Mockito.mock(Context.class); assertThat(LocationFactory.sharedClient(context)) .isEqualTo(LocationFactory.sharedClient(context)); }
@Test public void sharedClientWithCallbacks_shouldReturnSameClientForSameContext() throws Exception { Context context = Mockito.mock(Context.class); LostApiClient.ConnectionCallbacks callbacks = new TestConnectionCallbacks(); assertThat(LocationFactory.sharedClient(context, callbacks)) .isEqualTo(LocationFactory.sharedClient(context, callbacks)); }
@Test public void sharedClient_shouldReturnSameClientForNewContext() throws Exception { assertThat(LocationFactory.sharedClient(Mockito.mock(Context.class))) .isEqualTo(LocationFactory.sharedClient(Mockito.mock(Context.class))); }
@Test public void sharedClientWithCallbacks_shouldReturnSameClientForNewContext() throws Exception { LostApiClient.ConnectionCallbacks callbacks = new TestConnectionCallbacks(); assertThat(LocationFactory.sharedClient(Mockito.mock(Context.class), callbacks)) .isEqualTo(LocationFactory.sharedClient(Mockito.mock(Context.class), callbacks)); }