### Question:
OSMIDSegmentedMap implements LongIntMap { @Override public int get( long key ) { int retBucket = SparseLongLongArray.binarySearch(keys, 0, currentBucket + 1, key); if (retBucket < 0) { retBucket = ~retBucket; retBucket--; if (retBucket < 0) { return (int) getNoEntryValue(); } long storedKey = keys[retBucket]; if (storedKey == key) { return retBucket * bucketSize; } VLongStorage buck = buckets[retBucket]; long tmp = buck.getPosition(); buck.seek(0); int max = currentBucket == retBucket ? currentIndex + 1 : bucketSize; int ret = getNoEntryValue(); for (int i = 1; i < max; i++) { storedKey += buck.readVLong(); if (storedKey == key) { ret = retBucket * bucketSize + i; break; } else if (storedKey > key) { break; } } buck.seek(tmp); return ret; } return retBucket * bucketSize; } OSMIDSegmentedMap();  OSMIDSegmentedMap( int initialCapacity, int maxEntryPerBucket ); void write( long key ); @Override int get( long key ); int getNoEntryValue(); @Override long getSize(); @Override void optimize(); @Override int getMemoryUsage(); @Override int put( long key, int value );  }### Answer:
@Test public void testGet() { OSMIDSegmentedMap map = new OSMIDSegmentedMap(); map.write(9); map.write(10); map.write(11); map.write(12); map.write(20); map.write(21); map.write(31); assertEquals(7, map.getSize()); assertEquals(-1, map.get(8)); assertEquals(0, map.get(9)); assertEquals(1, map.get(10)); assertEquals(2, map.get(11)); assertEquals(3, map.get(12)); assertEquals(-1, map.get(13)); assertEquals(-1, map.get(19)); assertEquals(4, map.get(20)); assertEquals(5, map.get(21)); assertEquals(6, map.get(31)); assertEquals(-1, map.get(32)); for (int i = 0; i < 200; i++) { map.write(i + 50); } assertEquals(207, map.getSize()); assertEquals(-1, map.get(49)); assertEquals(7, map.get(50)); }