assertEquals( element_count, map.size() );
// No argument
int[] keys_array = map.keys();
assertEquals( element_count, keys_array.length );
TIntList keys_list = new TIntArrayList( keys_array );
for ( int i = 0; i < element_count; i++ ) {
assertTrue( keys_list.contains( keys[i] ) );
}
// Zero length array
keys_array = map.keys( new int[0] );
assertEquals( element_count, keys_array.length );
keys_list = new TIntArrayList( keys_array );
for ( int i = 0; i < element_count; i++ ) {
assertTrue( keys_list.contains( keys[i] ) );
}
// appropriate length array
keys_array = map.keys( new int[map.size()] );
assertEquals( element_count, keys_array.length );
keys_list = new TIntArrayList( keys_array );
for ( int i = 0; i < element_count; i++ ) {
assertTrue( keys_list.contains( keys[i] ) );
}
// longer array
keys_array = map.keys( new int[element_count * 2] );
assertEquals( element_count * 2, keys_array.length );
keys_list = new TIntArrayList( keys_array );
for ( int i = 0; i < element_count; i++ ) {
assertTrue( keys_list.contains( keys[i] ) );
}
assertEquals( map.getNoEntryKey(), keys_array[element_count] );
}