class RouteUtil {

    public static Spannable getTrafficDelayed(final Context context, final Route route) {
        final SpannableStringBuilder builder = new SpannableStringBuilder(" ");

        if (!isTrafficAvailable(route)) {
            return builder;
        }

        final boolean isBlockedRoad = route.getTtaIncludingTraffic(WHOLE_ROUTE).isBlocked();
        if (isBlockedRoad) {
            appendDrawable(context, builder, R.drawable.ic_warning, R.attr.colorAlert);
            appendText(context, builder, context.getString(R.string.msdkui_traffic_blocked), R.attr.colorAlert);
            return builder;
        }
        final long durationWithTraffic = route.getTtaIncludingTraffic(WHOLE_ROUTE)
                .getDuration();
        final long durationWithoutTraffic = route.getTtaExcludingTraffic(WHOLE_ROUTE)
                .getDuration();
        final long delayInSeconds = durationWithTraffic > durationWithoutTraffic ?
                durationWithTraffic - durationWithoutTraffic :
                0;
        final long delayInMinutes = (long) (delayInSeconds / 60);   // min
        if (delayInMinutes > 0) {
            appendDrawable(context, builder, R.drawable.ic_warning, R.attr.colorAlert);
            appendText(context, builder, context.getString(R.string.msdkui_incl_traffic_delay,
                    TimeFormatterUtil.format(context, TimeUnit.MINUTES.toMillis(delayInMinutes))), R.attr.colorAlert);
            return builder;
        } else {
            appendText(context, builder, context.getString(R.string.msdkui_no_traffic_delays), R.attr.colorForegroundSecondary);
        }
        return builder;
    }

    private  RouteUtil();

}