<commit_before>package com.github.K0zka.kerub

import org.mockito.Matchers
import org.mockito.Mockito
import org.mockito.verification.VerificationMode

fun <T> verify(param : T) = Mockito.verify(param)

fun <T> verify(param : T, mode : VerificationMode) = Mockito.verify(param, mode)

val once = Mockito.only()

val never = Mockito.never()

fun times(n : Int) = Mockito.times(n)

fun <T> on(param : T) = Mockito.`when`(param)

fun <T> eq(param : T) = Matchers.eq(param) ?: param

fun anyString() = Matchers.anyString() ?: ""

fun anyInt() = Matchers.anyInt() ?: 1

fun anyLong() = Matchers.anyLong() ?: 1L

fun <T> matchAny(clazz : Class<T>) : T = Matchers.any(clazz) ?: Mockito.mock(clazz)

fun <T> matchAny(clazz : Class<T>, instance : T) : T = Matchers.any(clazz) ?: instance<commit_msg>a kclass version of the mockito helper util<commit_after>package com.github.K0zka.kerub

import org.mockito.Matchers
import org.mockito.Mockito
import org.mockito.verification.VerificationMode
import kotlin.reflect.KClass

fun <T> verify(param : T) = Mockito.verify(param)

fun <T> verify(param : T, mode : VerificationMode) = Mockito.verify(param, mode)

val once = Mockito.only()

val never = Mockito.never()

fun times(n : Int) = Mockito.times(n)

fun <T> on(param : T) = Mockito.`when`(param)

fun <T> eq(param : T) = Matchers.eq(param) ?: param

fun anyString() = Matchers.anyString() ?: ""

fun anyInt() = Matchers.anyInt() ?: 1

fun anyLong() = Matchers.anyLong() ?: 1L

fun <T> matchAny(clazz : Class<T>) : T = Matchers.any(clazz) ?: Mockito.mock(clazz)
fun <T : Any> matchAny(clazz : KClass<T>) : T = matchAny(clazz.java)

fun <T> matchAny(clazz : Class<T>, instance : T) : T = Matchers.any(clazz) ?: instance
{'fraction_non_alphanumeric': 0.16100702576112413, 'fraction_numerical': 0.00351288056206089, 'mean_word_length': 4.852739726027397, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7055466', 'n_tokens_mistral': 657, 'n_tokens_neox': 652, 'n_words': 153}