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

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

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