PrefixIndex { public T get(short key) { int pos = key & 0xFFFF; int wordIndex = pos >>> 6; assert wordIndex >= offset && wordIndex <= offset + range; if ((keys[wordIndex] & (1L << pos)) != 0) { return values.get(pos); } return null; } PrefixIndex();  PrefixIndex(long[] keys);   PrefixIndex(long[] keys, ChunkedArray<T> values, int offset, int range);   PrefixIndex(int offset, int range); int getMinChunkIndex(); int getMaxChunkIndex(); boolean isEmpty(); T get(short key); void insert(short key, T value); Stream<PrefixIndex<T>> streamUniformPartitions(); void forEach(KeyValueConsumer<T> consumer); ReductionContext<Model, Output, Result> reduce(ReductionProcedure<Model, Output, Result, T> procedure); double reduceDouble(ReductionProcedure<?, Output, Double, T> procedure); double reduceDouble(double initial, IntFunction<U> mapKey, ToDoubleBiFunction<T, U> mapValue, DoubleBinaryOperator reduce); double reduceDouble(double initial, ToDoubleFunction<T> map, DoubleBinaryOperator reduce); long reduceLong(ReductionProcedure<?, Output, Long, T> procedure); long reduceLong(long initial, ToLongFunction<T> map, LongBinaryOperator reduce); int reduceInt(ReductionProcedure<?, Output, Integer, T> procedure); int reduceInt(int initial, ToIntFunction<T> map, IntBinaryOperator reduce); void writeChunk(int wordIndex, long word, T[] chunk); void transferChunk(int wordIndex, long word, T[] chunk); long computeKeyWord(int wordIndex, long value, LongBinaryOperator op); long readKeyWord(int wordIndex); boolean readChunk(int chunkIndex, T[] ouptut);  }
@Test public void ifValueDoesntExisteGetNull() { PrefixIndex<String> index = new PrefixIndex<>(); assertNull(index.get((short) 0)); }