Expanded Unit tests to IntLists/Sets
Maps are sadly not possible. It will require writing templates for permutations effectively copying guavas Test library. So this will take a lot longer
This commit is contained in:
@@ -252,7 +252,12 @@ public class HASH_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_TYPE imp
|
||||
|
||||
@Override
|
||||
public boolean contains(Object o) {
|
||||
#if TYPE_OBJECT
|
||||
if(o == null) return containsNull;
|
||||
#else
|
||||
if(o == null) return false;
|
||||
if(o instanceof CLASS_TYPE && KEY_EQUALS(CLASS_TO_KEY(o), EMPTY_KEY_VALUE)) return containsNull;
|
||||
#endif
|
||||
int pos = HashUtil.mix(o.hashCode()) & mask;
|
||||
KEY_TYPE current = keys[pos];
|
||||
if(KEY_EQUALS_NULL(current)) return false;
|
||||
@@ -265,7 +270,12 @@ public class HASH_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_TYPE imp
|
||||
|
||||
@Override
|
||||
public boolean remove(Object o) {
|
||||
#if TYPE_OBJECT
|
||||
if(o == null) return (containsNull ? removeNullIndex() : false);
|
||||
#else
|
||||
if(o == null) return false;
|
||||
if(o instanceof CLASS_TYPE && KEY_EQUALS(CLASS_TO_KEY(o), EMPTY_KEY_VALUE)) return (containsNull ? removeNullIndex() : false);
|
||||
#endif
|
||||
int pos = HashUtil.mix(o.hashCode()) & mask;
|
||||
KEY_TYPE current = keys[pos];
|
||||
if(KEY_EQUALS_NULL(current)) return false;
|
||||
|
||||
Reference in New Issue
Block a user