class FinishReasonMapper {

    static FinishReason map(Candidate.FinishReason finishReason) {<FILL_FUNCTION_BODY>}
}

        switch (finishReason) {
            case STOP:
                return FinishReason.STOP;
            case MAX_TOKENS:
                return FinishReason.LENGTH;
            case SAFETY:
                return FinishReason.CONTENT_FILTER;
        }
        return FinishReason.OTHER;
    
<no_super_class>