StreamRecord extends StreamElement { public long getTimestamp() { if (hasTimestamp) { return timestamp; } else { return Long.MIN_VALUE; } } StreamRecord(T value);  StreamRecord(T value, long timestamp); T getValue(); long getTimestamp(); boolean hasTimestamp(); @SuppressWarnings("unchecked") StreamRecord<X> replace(X element); @SuppressWarnings("unchecked") StreamRecord<X> replace(X value, long timestamp); void setTimestamp(long timestamp); void eraseTimestamp(); StreamRecord<T> copy(T valueCopy); void copyTo(T valueCopy, StreamRecord<T> target); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void testAllowedTimestampRange() { assertEquals(0L, new StreamRecord<>("test", 0).getTimestamp()); assertEquals(-1L, new StreamRecord<>("test", -1).getTimestamp()); assertEquals(1L, new StreamRecord<>("test", 1).getTimestamp()); assertEquals(Long.MIN_VALUE, new StreamRecord<>("test", Long.MIN_VALUE).getTimestamp()); assertEquals(Long.MAX_VALUE, new StreamRecord<>("test", Long.MAX_VALUE).getTimestamp()); }