class ConnectTrial {

    boolean isNeedTrialHeadMethodForInstanceLength(
            long oldInstanceLength, @NonNull DownloadConnection.Connected connected) {
        if (oldInstanceLength != CHUNKED_CONTENT_LENGTH) {
            // the instance length already has certain value.
            return false;
        }

        final String contentRange = connected.getResponseHeaderField(CONTENT_RANGE);
        if (contentRange != null && contentRange.length() > 0) {
            // because of the Content-Range can certain the result is right, so pass.
            return false;
        }

        final boolean isChunked = parseTransferEncoding(
                connected.getResponseHeaderField(TRANSFER_ENCODING));
        if (isChunked) {
            // because of the Transfer-Encoding can certain the result is right, so pass.
            return false;
        }

        final String contentLengthField = connected.getResponseHeaderField(CONTENT_LENGTH);
        if (contentLengthField == null || contentLengthField.length() <= 0) {
            // because of the response header isn't contain the Content-Length so the HEAD method
            // request is useless, because we plan to get the right instance-length on the
            // Content-Length field through the response header of non 0-0 Range HEAD method request
            return false;
        }

        // because of the response header contain Content-Length, but because of we using Range: 0-0
        // so we the Content-Length is always 1 now, we can't use it, so we try to use HEAD method
        // request just for get the certain instance-length.
        return true;
    }

    public  ConnectTrial(@NonNull DownloadTask task, @NonNull BreakpointInfo info);

}