<commit_before>package com.bugsnag;

import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import org.junit.Test;

import java.util.List;

public class ThreadStateTest {

    @Test
    public void testThreadStateDoesNotContainCurrentThread() {
        List<ThreadState> threadStates = ThreadState.getLiveThreads(new Configuration("apikey"));

        for (ThreadState thread : threadStates) {
            if (thread.getId() == Thread.currentThread().getId()) {
                fail();
            }
        }

        // Just test that there is at least one thread
        assertTrue(threadStates.size() > 1);
    }
}<commit_msg>test serialisation of thread state properties<commit_after>package com.bugsnag;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import org.junit.Before;
import org.junit.Test;

import java.lang.Exception;
import java.util.List;

public class ThreadStateTest {

    private List<ThreadState> threadStates;

    /**
     * Generates a list of current thread states
     *
     * @throws Exception if the thread state could not be constructed
     */
    @Before
    public void setUp() throws Exception {
        threadStates = ThreadState.getLiveThreads(new Configuration("apikey"));
    }

    @Test
    public void testThreadStateDoesNotContainCurrentThread() {

        for (ThreadState thread : threadStates) {
            if (thread.getId() == Thread.currentThread().getId()) {
                fail();
            }
        }

        // Just test that there is at least one thread
        assertTrue(threadStates.size() > 1);
    }

    @Test
    public void testThreadName() {
        for (ThreadState threadState : threadStates) {
            assertNotNull(threadState.getName());
        }
    }

    @Test
    public void testThreadStacktrace() {
        for (ThreadState threadState : threadStates) {
            List<Stackframe> stacktrace = threadState.getStacktrace();
            assertNotNull(stacktrace);
        }
    }
}
{'fraction_non_alphanumeric': 0.09594985535197685, 'fraction_numerical': 0.0009643201542912247, 'mean_word_length': 2.666077738515901, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 8, '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': '1682996', 'n_tokens_mistral': 556, 'n_tokens_neox': 548, 'n_words': 142}