public Map<TopicPartition, OffsetAndMetadata> divergentOffsets() {
        return divergentOffsets;
    }
Get the divergent offsets for the partitions which were truncated. For each
partition, this is the first offset which is known to diverge from what the
consumer read.

Note that there is no guarantee that this offset will be known. It is necessary
to use {@link #partitions()} to see the set of partitions that were truncated
and then check for the presence of a divergent offset in this map.
clients/src/main/java/org/apache/kafka/clients/consumer/LogTruncationException.java