### Question:
DynamicCamera extends SimpleCamera { @Override public Point target(RouteInformation routeInformation) { if (isShutdown) { return DEFAULT_TARGET; } if (routeInformation.location() != null) { Location target = routeInformation.location(); return Point.fromLngLat(target.getLongitude(), target.getLatitude()); } else if (routeInformation.route() != null) { return super.target(routeInformation); } LatLng currentTarget = mapboxMap.getCameraPosition().target; return Point.fromLngLat(currentTarget.getLongitude(), currentTarget.getLongitude()); } DynamicCamera(@NonNull MapboxMap mapboxMap); @Override Point target(RouteInformation routeInformation); @Override double tilt(RouteInformation routeInformation); @Override double zoom(RouteInformation routeInformation); void forceResetZoomLevel(); void clearMap();  }### Answer:
@Test public void onInformationFromRoute_engineCreatesCorrectTarget() throws Exception { DynamicCamera cameraEngine = buildDynamicCamera(); RouteInformation routeInformation = RouteInformation.create(buildDirectionsRoute(), null, null); Point target = cameraEngine.target(routeInformation); double lng = target.longitude(); assertEquals(-122.416686, lng); double lat = target.latitude(); assertEquals(37.783425, lat); }
@Test public void onInformationFromLocationAndProgress_engineCreatesCorrectTarget() throws Exception { DynamicCamera cameraEngine = buildDynamicCamera(); RouteInformation routeInformation = RouteInformation.create(null, buildDefaultLocationUpdate(-77.0339782574523, 38.89993519985637), buildDefaultRouteProgress(null)); Point target = cameraEngine.target(routeInformation); double lng = target.longitude(); assertEquals(-77.0339782574523, lng); double lat = target.latitude(); assertEquals(38.89993519985637, lat); }