### Question:
DynamicCamera extends SimpleCamera { @Override public double tilt(RouteInformation routeInformation) { if (isShutdown) { return DEFAULT_TILT; } RouteProgress progress = routeInformation.routeProgress(); if (progress != null) { double distanceRemaining = progress.currentLegProgress().currentStepProgress().distanceRemaining(); return createTilt(distanceRemaining); } return super.tilt(routeInformation); } 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_engineCreatesCorrectTilt() throws Exception { DynamicCamera cameraEngine = buildDynamicCamera(); RouteInformation routeInformation = RouteInformation.create(buildDirectionsRoute(), null, null); double tilt = cameraEngine.tilt(routeInformation); assertEquals(50d, tilt); }
@Test public void onHighDistanceRemaining_engineCreatesCorrectTilt() throws Exception { DynamicCamera cameraEngine = buildDynamicCamera(); RouteInformation routeInformation = RouteInformation.create(null, buildDefaultLocationUpdate(-77.0339782574523, 38.89993519985637), buildDefaultRouteProgress(1000d)); double tilt = cameraEngine.tilt(routeInformation); assertEquals(50d, tilt); }
@Test public void onMediumDistanceRemaining_engineCreatesCorrectTilt() throws Exception { DynamicCamera cameraEngine = buildDynamicCamera(); RouteInformation routeInformation = RouteInformation.create(null, buildDefaultLocationUpdate(-77.0339782574523, 38.89993519985637), buildDefaultRouteProgress(200d)); double tilt = cameraEngine.tilt(routeInformation); assertEquals(40d, tilt); }
@Test public void onLowDistanceRemaining_engineCreatesCorrectTilt() throws Exception { DynamicCamera cameraEngine = buildDynamicCamera(); RouteInformation routeInformation = RouteInformation.create(null, buildDefaultLocationUpdate(-77.0339782574523, 38.89993519985637), buildDefaultRouteProgress(null)); double tilt = cameraEngine.tilt(routeInformation); assertEquals(35d, tilt); }