class PendingParser {

    /**
     * Utility constructor.
     */
    private PendingParser() {
    }

    /**
     * Parse the output of the Redis {@literal XPENDING} command with {@link Range}.
     *
     * @param xpendingOutput output of the Redis {@literal XPENDING}.
     * @return list of {@link PendingMessage}s.
     */
    @SuppressWarnings("unchecked")
    public static List<PendingMessage> parseRange(List<?> xpendingOutput) {<FILL_FUNCTION_BODY>}

    /**
     * Parse the output of the Redis {@literal XPENDING} reporting a summary on pending messages.
     *
     * @param xpendingOutput output of the Redis {@literal XPENDING}.
     * @return {@link PendingMessages}.
     */
    @SuppressWarnings("unchecked")
    public static PendingMessages parse(List<?> xpendingOutput) {

        LettuceAssert.notNull(xpendingOutput, "XPENDING output must not be null");
        LettuceAssert.isTrue(xpendingOutput.size() == 4, "XPENDING output must have exactly four output elements");

        Long count = (Long) xpendingOutput.get(0);
        String from = (String) xpendingOutput.get(1);
        String to = (String) xpendingOutput.get(2);

        Range<String> messageIdRange = Range.create(from, to);

        Collection<Object> consumerMessageCounts = (Collection) xpendingOutput.get(3);

        Map<String, Long> counts = new LinkedHashMap<>();

        for (Object element : consumerMessageCounts) {

            LettuceAssert.isTrue(element instanceof List, "Consumer message counts must be a List");
            List<Object> messageCount = (List) element;

            counts.put((String) messageCount.get(0), (Long) messageCount.get(1));
        }

        return new PendingMessages(count, messageIdRange, Collections.unmodifiableMap(counts));
    }

}


        LettuceAssert.notNull(xpendingOutput, "XPENDING output must not be null");

        List<PendingMessage> result = new ArrayList<>();

        for (Object element : xpendingOutput) {

            LettuceAssert.isTrue(element instanceof List, "Output elements must be a List");

            List<Object> message = (List) element;

            String messageId = (String) message.get(0);
            String consumer = (String) message.get(1);
            Long msSinceLastDelivery = (Long) message.get(2);
            Long deliveryCount = (Long) message.get(3);

            result.add(new PendingMessage(messageId, consumer, msSinceLastDelivery, deliveryCount));
        }

        return result;
    
<no_super_class>