}
assertFalse( keyset.isEmpty() );
int[] keys_array = keyset.toArray();
int count = 0;
TIntIterator iter = keyset.iterator();
while ( iter.hasNext() ) {
int key = iter.next();
assertTrue( keyset.contains( key ) );
assertEquals( keys_array[count], key );
count++;
}
//noinspection ToArrayCallWithZeroLengthArrayArgument
keys_array = keyset.toArray( new int[0] );
count = 0;
iter = keyset.iterator();
while ( iter.hasNext() ) {
int key = iter.next();
assertTrue( keyset.contains( key ) );
assertEquals( keys_array[count], key );
count++;
}
keys_array = keyset.toArray( new int[keyset.size()] );
count = 0;
iter = keyset.iterator();
while ( iter.hasNext() ) {
int key = iter.next();
assertTrue( keyset.contains( key ) );
assertEquals( keys_array[count], key );
count++;
}
keys_array = keyset.toArray( new int[keyset.size() * 2] );
count = 0;
iter = keyset.iterator();
while ( iter.hasNext() ) {
int key = iter.next();
assertTrue( keyset.contains( key ) );
assertEquals( keys_array[count], key );
count++;
}
assertEquals( keyset.getNoEntryValue(), keys_array[keyset.size()] );