<commit_before>package org.leplus.util;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import java.util.Arrays;
import java.util.Set;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;

import com.google.common.collect.testing.SetTestSuiteBuilder;
import com.google.common.collect.testing.TestStringSetGenerator;
import com.google.common.collect.testing.features.CollectionFeature;
import com.google.common.collect.testing.features.CollectionSize;
import com.google.common.collect.testing.features.SetFeature;
import com.google.common.collect.testing.testers.SetHashCodeTester;

import junit.framework.TestSuite;

@RunWith(Suite.class)
@Suite.SuiteClasses({ TestIdentityHashSet.GuavaTests.class, TestIdentityHashSet.AdditionalTests.class, })
public class TestIdentityHashSet {

	public static class AdditionalTests {
	
		@Test
		public void testClear() {
			final Set<Dumb> set = new IdentityHashSet<Dumb>();
			final Dumb d = new Dumb();
			set.add(d);
			assertFalse(set.isEmpty());
			assertEquals(1, set.size());
			set.clear();
			assertTrue(set.isEmpty());
			assertEquals(0, set.size());
		}
	
		@Test
		public void testClone() {
			final IdentityHashSet<Dumb> set1 = new IdentityHashSet<Dumb>();
			set1.add(new Dumb());
			@SuppressWarnings("unchecked")
			final IdentityHashSet<Dumb> set2 = (IdentityHashSet<Dumb>) set1.clone();
			assertEquals(set1, set2);
			assertTrue(set1.iterator().next() == set2.iterator().next());
			set1.clear();
			assertEquals(0, set1.size());
			assertEquals(1, set2.size());
		}
	
		@Test
		public void testEqualsOneObject() {
			final Dumb d = new Dumb();
			final Set<Dumb> set1 = new IdentityHashSet<Dumb>();
			set1.add(d);
			final Set<Dumb> set2 = new IdentityHashSet<Dumb>();
			set2.add(d);
			assertEquals(set1, set2);
		}
	
		@Test
		public void testEqualsTwoObjects() {
			final Set<Dumb> set1 = new IdentityHashSet<Dumb>();
			set1.add(new Dumb());
			final Set<Dumb> set2 = new IdentityHashSet<Dumb>();
			set2.add(new Dumb());
			assertFalse(set1.equals(set2));
		}
	
		@Test
		public void testIsEmpty() {
			final Set<Dumb> set = new IdentityHashSet<Dumb>();
			assertTrue(set.isEmpty());
		}
	
		@Test
		public void testNotEmpty() {
			final Set<Dumb> set = new IdentityHashSet<Dumb>();
			set.add(new Dumb());
			assertFalse(set.isEmpty());
			assertEquals(1, set.size());
		}
	
		@Test
		public void testOneObject() {
			final Set<Dumb> set = new IdentityHashSet<Dumb>();
			final Dumb d = new Dumb();
			set.add(d);
			set.add(d);
			assertFalse(set.isEmpty());
			assertEquals(1, set.size());
			assertTrue(set.contains(d));
			assertFalse(set.contains(new Dumb()));
			set.remove(d);
			assertFalse(set.contains(d));
			assertTrue(set.isEmpty());
			assertEquals(0, set.size());
		}
	
		@Test
		public void testTwoObjects() {
			final Set<Dumb> set = new IdentityHashSet<Dumb>();
			set.add(new Dumb());
			set.add(new Dumb());
			assertFalse(set.isEmpty());
			assertEquals(2, set.size());
			assertFalse(set.contains(new Dumb()));
		}
		
		@Test
		public void testHashCode() {
			final Dumb a = new Dumb();
			final Dumb b = new Dumb();
			final Dumb c = new Dumb();
			final Set<Dumb> set1 = new IdentityHashSet<Dumb>(Arrays.asList(a, b, c));
			final Set<Dumb> set2 = new IdentityHashSet<Dumb>(Arrays.asList(b, c, a));
			assertEquals(set1.hashCode(), set2.hashCode());
		}
		
	}

	public static class GuavaTests {

		public static TestSuite suite() {
			return SetTestSuiteBuilder.using(new TestStringSetGenerator() {

				@Override
				protected Set<String> create(String[] elements) {
					return new IdentityHashSet<String>(Arrays.asList(elements));
				}

			}).named("IdentityHashSet tests")
					.withFeatures(
							SetFeature.GENERAL_PURPOSE,
							CollectionFeature.ALLOWS_NULL_QUERIES,
							CollectionFeature.ALLOWS_NULL_VALUES,
							CollectionFeature.DESCENDING_VIEW,
							CollectionFeature.FAILS_FAST_ON_CONCURRENT_MODIFICATION,
							CollectionFeature.GENERAL_PURPOSE,
							CollectionFeature.KNOWN_ORDER,
							CollectionFeature.REMOVE_OPERATIONS,
							CollectionFeature.RESTRICTS_ELEMENTS,
							CollectionFeature.SUBSET_VIEW,
							CollectionFeature.SUPPORTS_ADD,
							CollectionFeature.SUPPORTS_ITERATOR_REMOVE,
							CollectionFeature.SUPPORTS_REMOVE,
							CollectionSize.ANY,
							CollectionSize.ONE,
							CollectionSize.SEVERAL,
							CollectionSize.ZERO
							)
					.suppressing(SetHashCodeTester.getHashCodeMethods())
					.createTestSuite();
		}

	}
	
}<commit_msg>Removing failing order tests for set<commit_after>package org.leplus.util;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import java.util.Arrays;
import java.util.Set;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;

import com.google.common.collect.testing.SetTestSuiteBuilder;
import com.google.common.collect.testing.TestStringSetGenerator;
import com.google.common.collect.testing.features.CollectionFeature;
import com.google.common.collect.testing.features.CollectionSize;
import com.google.common.collect.testing.features.SetFeature;
import com.google.common.collect.testing.testers.SetHashCodeTester;

import junit.framework.TestSuite;

@RunWith(Suite.class)
@Suite.SuiteClasses({ TestIdentityHashSet.GuavaTests.class, TestIdentityHashSet.AdditionalTests.class, })
public class TestIdentityHashSet {

	public static class AdditionalTests {
	
		@Test
		public void testClear() {
			final Set<Dumb> set = new IdentityHashSet<Dumb>();
			final Dumb d = new Dumb();
			set.add(d);
			assertFalse(set.isEmpty());
			assertEquals(1, set.size());
			set.clear();
			assertTrue(set.isEmpty());
			assertEquals(0, set.size());
		}
	
		@Test
		public void testClone() {
			final IdentityHashSet<Dumb> set1 = new IdentityHashSet<Dumb>();
			set1.add(new Dumb());
			@SuppressWarnings("unchecked")
			final IdentityHashSet<Dumb> set2 = (IdentityHashSet<Dumb>) set1.clone();
			assertEquals(set1, set2);
			assertTrue(set1.iterator().next() == set2.iterator().next());
			set1.clear();
			assertEquals(0, set1.size());
			assertEquals(1, set2.size());
		}
	
		@Test
		public void testEqualsOneObject() {
			final Dumb d = new Dumb();
			final Set<Dumb> set1 = new IdentityHashSet<Dumb>();
			set1.add(d);
			final Set<Dumb> set2 = new IdentityHashSet<Dumb>();
			set2.add(d);
			assertEquals(set1, set2);
		}
	
		@Test
		public void testEqualsTwoObjects() {
			final Set<Dumb> set1 = new IdentityHashSet<Dumb>();
			set1.add(new Dumb());
			final Set<Dumb> set2 = new IdentityHashSet<Dumb>();
			set2.add(new Dumb());
			assertFalse(set1.equals(set2));
		}
	
		@Test
		public void testIsEmpty() {
			final Set<Dumb> set = new IdentityHashSet<Dumb>();
			assertTrue(set.isEmpty());
		}
	
		@Test
		public void testNotEmpty() {
			final Set<Dumb> set = new IdentityHashSet<Dumb>();
			set.add(new Dumb());
			assertFalse(set.isEmpty());
			assertEquals(1, set.size());
		}
	
		@Test
		public void testOneObject() {
			final Set<Dumb> set = new IdentityHashSet<Dumb>();
			final Dumb d = new Dumb();
			set.add(d);
			set.add(d);
			assertFalse(set.isEmpty());
			assertEquals(1, set.size());
			assertTrue(set.contains(d));
			assertFalse(set.contains(new Dumb()));
			set.remove(d);
			assertFalse(set.contains(d));
			assertTrue(set.isEmpty());
			assertEquals(0, set.size());
		}
	
		@Test
		public void testTwoObjects() {
			final Set<Dumb> set = new IdentityHashSet<Dumb>();
			set.add(new Dumb());
			set.add(new Dumb());
			assertFalse(set.isEmpty());
			assertEquals(2, set.size());
			assertFalse(set.contains(new Dumb()));
		}
		
		@Test
		public void testHashCode() {
			final Dumb a = new Dumb();
			final Dumb b = new Dumb();
			final Dumb c = new Dumb();
			final Set<Dumb> set1 = new IdentityHashSet<Dumb>(Arrays.asList(a, b, c));
			final Set<Dumb> set2 = new IdentityHashSet<Dumb>(Arrays.asList(b, c, a));
			assertEquals(set1.hashCode(), set2.hashCode());
		}
		
	}

	public static class GuavaTests {

		public static TestSuite suite() {
			return SetTestSuiteBuilder.using(new TestStringSetGenerator() {

				@Override
				protected Set<String> create(String[] elements) {
					return new IdentityHashSet<String>(Arrays.asList(elements));
				}

			}).named("IdentityHashSet tests")
					.withFeatures(
							SetFeature.GENERAL_PURPOSE,
							CollectionFeature.ALLOWS_NULL_QUERIES,
							CollectionFeature.ALLOWS_NULL_VALUES,
							CollectionFeature.DESCENDING_VIEW,
							CollectionFeature.FAILS_FAST_ON_CONCURRENT_MODIFICATION,
							CollectionFeature.GENERAL_PURPOSE,
							CollectionFeature.REMOVE_OPERATIONS,
							CollectionFeature.RESTRICTS_ELEMENTS,
							CollectionFeature.SUBSET_VIEW,
							CollectionFeature.SUPPORTS_ADD,
							CollectionFeature.SUPPORTS_ITERATOR_REMOVE,
							CollectionFeature.SUPPORTS_REMOVE,
							CollectionSize.ANY,
							CollectionSize.ONE,
							CollectionSize.SEVERAL,
							CollectionSize.ZERO
							)
					.suppressing(SetHashCodeTester.getHashCodeMethods())
					.createTestSuite();
		}

	}
	
}
{'fraction_non_alphanumeric': 0.13131862158930319, 'fraction_numerical': 0.007609522774214589, 'mean_word_length': 4.125348189415042, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 59, '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': '1559497', 'n_tokens_mistral': 3555, 'n_tokens_neox': 2982, 'n_words': 566}