<commit_before>package org.ccci.gto.android.common.androidx.lifecycle

import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.LifecycleRegistry
import com.nhaarman.mockitokotlin2.any
import com.nhaarman.mockitokotlin2.clearInvocations
import com.nhaarman.mockitokotlin2.inOrder
import com.nhaarman.mockitokotlin2.mock
import com.nhaarman.mockitokotlin2.never
import org.junit.Assert.assertEquals
import org.junit.Before
import org.junit.Test

class ConstrainedStateLifecycleOwnerTest {
    private val parentLifecycleOwner = object : LifecycleOwner {
        val registry = LifecycleRegistry(this)
        override fun getLifecycle() = registry
        var currentState
            get() = registry.currentState
            set(value) {
                registry.currentState = value
            }
    }
    private lateinit var observer: DefaultLifecycleObserver

    private lateinit var lifecycleOwner: ConstrainedStateLifecycleOwner

    @Before
    fun setup() {
        parentLifecycleOwner.currentState = Lifecycle.State.CREATED
        lifecycleOwner = ConstrainedStateLifecycleOwner(parentLifecycleOwner)<commit_msg>update ConstrainedStateLifecycleOwner to utilize TestLifecycleOwner<commit_after>package org.ccci.gto.android.common.androidx.lifecycle

import androidx.arch.core.executor.testing.InstantTaskExecutorRule
import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.testing.TestLifecycleOwner
import com.nhaarman.mockitokotlin2.any
import com.nhaarman.mockitokotlin2.clearInvocations
import com.nhaarman.mockitokotlin2.inOrder
import com.nhaarman.mockitokotlin2.mock
import com.nhaarman.mockitokotlin2.never
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.TestCoroutineDispatcher
import org.junit.Assert.assertEquals
import org.junit.Before
import org.junit.Rule
import org.junit.Test

class ConstrainedStateLifecycleOwnerTest {
    @get:Rule
    val rule = InstantTaskExecutorRule()

    @OptIn(ExperimentalCoroutinesApi::class)
    private val parentLifecycleOwner = TestLifecycleOwner(Lifecycle.State.STARTED, TestCoroutineDispatcher())
    private lateinit var observer: DefaultLifecycleObserver

    private lateinit var lifecycleOwner: ConstrainedStateLifecycleOwner

    @Before
    fun setup() {
        parentLifecycleOwner.currentState = Lifecycle.State.CREATED
        lifecycleOwner = ConstrainedStateLifecycleOwner(parentLifecycleOwner)
{'fraction_non_alphanumeric': 0.060594214229867084, 'fraction_numerical': 0.003909304143862392, 'mean_word_length': 5.181159420289855, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4338706', 'n_tokens_mistral': 748, 'n_tokens_neox': 721, 'n_words': 128}