### Question:
FusedLocationProviderApiImpl extends ApiImpl implements FusedLocationProviderApi, EventCallbacks, ServiceConnection { @Override public PendingResult<Status> setMockTrace(LostApiClient client, String path, String filename) { throwIfNotConnected(client); try { service.setMockTrace(path, filename); } catch (RemoteException e) { Log.e(TAG, "Error occurred trying to set mock trace", e); } return new SimplePendingResult(true); } FusedLocationProviderApiImpl(FusedLocationServiceConnectionManager connectionManager,
      FusedLocationServiceCallbackManager callbackManager, RequestManager requestManager,
      ClientManager clientManager); @Override void onConnect(Context context); @Override void onServiceConnected(IBinder binder); @Override void onDisconnect(); @Override void onServiceConnected(ComponentName name, IBinder binder); @Override void onServiceDisconnected(ComponentName name); boolean isConnecting(); void addConnectionCallbacks(LostApiClient.ConnectionCallbacks callbacks); void connect(Context context, LostApiClient.ConnectionCallbacks callbacks); void disconnect(); boolean isConnected(); @Override Location getLastLocation(LostApiClient client); @Override LocationAvailability getLocationAvailability(LostApiClient client); @Override PendingResult<Status> requestLocationUpdates(LostApiClient client,
      LocationRequest request, LocationListener listener); @Override PendingResult<Status> requestLocationUpdates(LostApiClient client,
      LocationRequest request, LocationListener listener, Looper looper); @Override PendingResult<Status> requestLocationUpdates(LostApiClient client,
      LocationRequest request, LocationCallback callback, Looper looper); @Override PendingResult<Status> requestLocationUpdates(LostApiClient client,
      LocationRequest request, PendingIntent callbackIntent); @Override PendingResult<Status> removeLocationUpdates(LostApiClient client,
      LocationListener listener); @Override PendingResult<Status> removeLocationUpdates(LostApiClient client,
      PendingIntent callbackIntent); @Override PendingResult<Status> removeLocationUpdates(LostApiClient client,
      LocationCallback callback); @Override PendingResult<Status> setMockMode(LostApiClient client, boolean isMockMode); @Override PendingResult<Status> setMockLocation(LostApiClient client,
      Location mockLocation); @Override PendingResult<Status> setMockTrace(LostApiClient client, String path,
      String filename); Map<LostApiClient, Set<LocationListener>> getLocationListeners();  }### Answer:
@Test public void setMockTrace_shouldCallService() throws Exception { api.setMockTrace(connectedClient, "path", "name"); verify(service).setMockTrace("path", "name"); }
@Test public void setMockTrace_shouldReturnFusedLocationPendingResult() { PendingResult<Status> result = api.setMockTrace(connectedClient, "path", "name"); assertThat(result.await().getStatus().getStatusCode()).isEqualTo(Status.SUCCESS); assertThat(result.await(1000, TimeUnit.MILLISECONDS).getStatus().getStatusCode()).isEqualTo( Status.SUCCESS); assertThat(result.isCanceled()).isFalse(); com.mapzen.android.lost.internal.TestResultCallback callback = new com.mapzen.android.lost.internal.TestResultCallback(); result.setResultCallback(callback); assertThat(callback.getStatus().getStatusCode()).isEqualTo(Status.SUCCESS); com.mapzen.android.lost.internal.TestResultCallback otherCallback = new com.mapzen.android.lost.internal.TestResultCallback(); result.setResultCallback(otherCallback, 1000, TimeUnit.MILLISECONDS); assertThat(otherCallback.getStatus().getStatusCode()).isEqualTo(Status.SUCCESS); }