class ChronicleHashCorruptionImpl implements ChronicleHashCorruption {

    private int segmentIndex;
    private Supplier<String> messageSupplier;
    private Throwable exception;
    private String message;

    public static void report(
            ChronicleHashCorruption.Listener corruptionListener,
            ChronicleHashCorruptionImpl corruption, int segmentIndex,
            Supplier<String> messageSupplier) {
        corruption.set(segmentIndex, messageSupplier, null);
        corruptionListener.onCorruption(corruption);
    }

    public static void reportException(
            ChronicleHashCorruption.Listener corruptionListener,
            ChronicleHashCorruptionImpl corruption, int segmentIndex,
            Supplier<String> messageSupplier, Throwable exception) {
        corruption.set(segmentIndex, messageSupplier, exception);
        corruptionListener.onCorruption(corruption);
    }

    public static String format(String message, Object... args) {
        return MessageFormatter.arrayFormat(message, args).getMessage();
    }

    private void set(int segmentIndex, Supplier<String> messageSupplier, Throwable exception) {<FILL_FUNCTION_BODY>}

    @Override
    public String message() {
        if (message == null) {
            message = messageSupplier.get();
        }
        return message;
    }

    @Nullable
    @Override
    public Throwable exception() {
        return exception;
    }

    @Override
    public int segmentIndex() {
        return segmentIndex;
    }
}

        this.segmentIndex = segmentIndex;
        this.messageSupplier = messageSupplier;
        this.exception = exception;
        this.message = null;
    
<no_super_class>