SpatialBin extends Bin { public static SpatialBin read(DataInput dataInput) throws IOException { return read(-1L, dataInput); } SpatialBin();  SpatialBin(long index, int numFeatures); void write(DataOutput dataOutput); void readFields(DataInput dataInput); static SpatialBin read(DataInput dataInput); static SpatialBin read(long index, DataInput dataInput); @Override String toString();  }
@Test public void testBinCreationWithIndex() throws Exception { final SpatialBin bin = SpatialBin.read(10L, new DataInputStream(new InputStream() { @Override public int read() throws IOException { return 0; } })); assertEquals(10L, bin.getIndex()); }