@Test
	public void testAsKeySetToTypedArray() {
		populateStore(-3, 3, 1, -1);

		List<Long> list = Arrays.asList(keySet.toArray(new Long[0]));
		assertEquals(List.of(-3L, -1L, 1L, 3L), list);
		list = Arrays.asList(keySet.toArray(new Long[4]));
		assertEquals(List.of(-3L, -1L, 1L, 3L), list);
		list = Arrays.asList(keySet.toArray(new Long[5]));
		assertEquals(Arrays.asList(new Long[] { -3L, -1L, 1L, 3L, null }), list);

		List<Long> rList = Arrays.asList(rKeySet.toArray(new Long[0]));
		assertEquals(List.of(3L, 1L, -1L, -3L), rList);
		rList = Arrays.asList(rKeySet.toArray(new Long[4]));
		assertEquals(List.of(3L, 1L, -1L, -3L), rList);
		rList = Arrays.asList(rKeySet.toArray(new Long[5]));
		assertEquals(Arrays.asList(new Long[] { 3L, 1L, -1L, -3L, null }), rList);
	}
This exists to verify behavior in {@link #testAsValuesSubIterator()}
Ghidra/Debug/ProposedUtils/src/test/java/ghidra/util/database/DBCachedObjectStoreTest.java