### Question:
HistogramSegment { private void selectBestMerge() { int intervalToLeft = dtime - left.dstop; int intervalToRight = right.dstart - dtime; if (Math.abs(intervalToLeft - intervalToRight) >= LOSS_TIME) { if (intervalToLeft < intervalToRight) { mergeRight = false; } else { mergeLeft = false; } } } HistogramSegment(byte[] columnv, long sstart);  HistogramSegment(byte[] columnv, long sstart, byte[] val);  HistogramSegment(byte[] key, byte[] val); static long getSstart(byte[] key); byte[] key(); static byte[] key(long sstart, byte[] columnv); byte[] val(); static long segmentStart(long instant); void merge(int dtime1); @Override String toString(); static final long GROUPING_FACTOR; }### Answer:
@Test public void testSelectBestMerge() { HistogramSegment segment = new HistogramSegment("g10".getBytes(), 0); segment.add(1000, 4000, (short)4); segment.add(7000, 8000,(short)2); segment.merge(6000); assertFalse(segment.duplicate); assertFalse(segment.leftUpdated); assertFalse(segment.centerAdded); assertTrue(segment.rightUpdated); assertSegEquals(6000, 8000, (short)3, segment.pps.get(1)); assertFalse(segment.rightDeleted); }