TemporalBin extends Bin { @Override public String toString() { return String.format("%s{index=%d, numObs=%d, numPasses=%d, featureValues=%s}", getClass().getSimpleName(), index, numObs, numPasses, Arrays.toString(featureValues)); } TemporalBin();  TemporalBin(long index, int numFeatures); int getNumPasses(); void setNumPasses(int numPasses); void write(DataOutput dataOutput); void readFields(DataInput dataInput); static TemporalBin read(DataInput dataInput); static TemporalBin read(long index, DataInput dataInput); @Override String toString();  }
@Test public void testToString() { TemporalBin bin = new TemporalBin(42, 0); assertEquals("TemporalBin{index=42, numObs=0, numPasses=0, featureValues=[]}", bin.toString()); bin = new TemporalBin(43, 3); assertEquals("TemporalBin{index=43, numObs=0, numPasses=0, featureValues=[0.0, 0.0, 0.0]}", bin.toString()); bin.setNumPasses(7); bin.setNumObs(3); assertEquals("TemporalBin{index=43, numObs=3, numPasses=7, featureValues=[0.0, 0.0, 0.0]}", bin.toString()); bin.featureValues[0] = 1.2f; bin.featureValues[2] = 2.4f; assertEquals("TemporalBin{index=43, numObs=3, numPasses=7, featureValues=[1.2, 0.0, 2.4]}", bin.toString()); }