<commit_before>package org.lightmare.utils;

import java.net.URL;
import java.util.Arrays;

import org.junit.Assert;
import org.junit.Test;

public class CollectionUtilsTest {

    private String format = "%s %s %s\n";

    private <T> void print(T[] empty) {

	int length = empty.length;
	Class<?> arrayClass = empty.getClass();
	Assert.assertTrue(
		String.format("array of type %s is not empty", arrayClass),
		length == 0);
	System.out.format(format, arrayClass, Arrays.toString(empty), length);
    }

    @Test
    public void emptyArrayTest() {

	String[] strings = CollectionUtils.emptyArray(String.class);
	print(strings);

	Integer[] integers = CollectionUtils.emptyArray(Integer.class);
	print(integers);

	Long[] longs = CollectionUtils.emptyArray(Long.class);
	print(longs);

	URL[] urls = CollectionUtils.emptyArray(URL.class);
	print(urls);
    }

    @Test
    public void arrayCastTest() {

	try {

	    boolean[] bools = new boolean[2];
	    bools[0] = false;
	    bools[1] = true;

	    boolean[] casted = ObjectUtils.cast(bools, boolean[].class);

	    System.out.println(Arrays.toString(casted));

	} catch (Exception ex) {
	    ex.printStackTrace();
	}<commit_msg>edited CollectionUtils class test case<commit_after>package org.lightmare.utils;

import java.lang.reflect.Array;
import java.net.URL;
import java.util.Arrays;

import org.junit.Assert;
import org.junit.Test;

public class CollectionUtilsTest {

    private String format = "%s %s %s\n";

    private <T> void print(T[] empty) {

	int length = empty.length;
	Class<?> arrayClass = empty.getClass();
	Assert.assertTrue(
		String.format("array of type %s is not empty", arrayClass),
		length == 0);
	System.out.format(format, arrayClass, Arrays.toString(empty), length);
    }

    @Test
    public void emptyArrayTest() {

	String[] strings = CollectionUtils.emptyArray(String.class);
	print(strings);

	Integer[] integers = CollectionUtils.emptyArray(Integer.class);
	print(integers);

	Long[] longs = CollectionUtils.emptyArray(Long.class);
	print(longs);

	URL[] urls = CollectionUtils.emptyArray(URL.class);
	print(urls);
    }

    @Test
    public void arrayCastTest() {

	try {

	    boolean[] bools = new boolean[2];
	    bools[0] = Boolean.FALSE;
	    bools[1] = Boolean.TRUE;

	    boolean[] casted = ObjectUtils.cast(bools, boolean[].class);

	    System.out.println(Arrays.toString(casted));

	    Object wrapperCasted = ObjectUtils.cast(bools, boolean[].class);

	    System.out.println(Array.getBoolean(wrapperCasted, 0));
	    System.out.println(Array.getBoolean(wrapperCasted, 1));

	} catch (Exception ex) {
	    ex.printStackTrace();
	}
{'fraction_non_alphanumeric': 0.13906782872300114, 'fraction_numerical': 0.0037893141341417205, 'mean_word_length': 4.057471264367816, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '254573', 'n_tokens_mistral': 878, 'n_tokens_neox': 832, 'n_words': 188}