class NavigationHelper {

  static boolean isUserOffRoute(NavigationLocationUpdate navigationLocationUpdate, RouteProgress routeProgress,
                                OffRouteCallback callback) {
    MapboxNavigationOptions options = navigationLocationUpdate.mapboxNavigation().options();
    if (!options.enableOffRouteDetection()) {
      return false;
    }
    OffRoute offRoute = navigationLocationUpdate.mapboxNavigation().getOffRouteEngine();
    setOffRouteDetectorCallback(offRoute, callback);
    Location location = navigationLocationUpdate.location();
    return offRoute.isUserOffRoute(location, routeProgress, options);
  }

  private  NavigationHelper();

}