StreamSortSpec implements Serializable { public StreamSortSpec() { } StreamSortSpec();  StreamSortSpec(StreamSortSpec spec); String getWindowPeriod(); int getWindowPeriodMillis(); void setWindowPeriod(String windowPeriod); void setWindowPeriodMillis(int windowPeriodMillis); void setWindowPeriod2(Period period); int getWindowMargin(); void setWindowMargin(int windowMargin); @Override int hashCode(); @Override boolean equals(Object that); @Override String toString();  }
@Test public void testStreamSortSpec() { StreamSortSpec streamSortSpec = new StreamSortSpec(); Assert.assertEquals(30000, streamSortSpec.getWindowMargin()); Assert.assertEquals("", streamSortSpec.getWindowPeriod()); Assert.assertEquals(0, streamSortSpec.getWindowPeriodMillis()); Assert.assertEquals("StreamSortSpec[windowPeriod=,windowMargin=30000]", streamSortSpec.toString()); streamSortSpec.setWindowPeriod("PT60S"); Assert.assertEquals(60000, streamSortSpec.getWindowPeriodMillis()); Assert.assertEquals("PT60S", streamSortSpec.getWindowPeriod()); Assert.assertEquals("StreamSortSpec[windowPeriod=PT60S,windowMargin=30000]", streamSortSpec.toString()); streamSortSpec.setWindowMargin(20); Assert.assertEquals(20, streamSortSpec.getWindowMargin()); streamSortSpec.setWindowPeriodMillis(50000); Assert.assertEquals("StreamSortSpec[windowPeriod=PT50S,windowMargin=20]", streamSortSpec.toString()); streamSortSpec.setWindowPeriod2(Period.minutes(10)); Assert.assertEquals("StreamSortSpec[windowPeriod=PT10M,windowMargin=20]", streamSortSpec.toString()); Assert.assertTrue(streamSortSpec.equals(new StreamSortSpec(streamSortSpec))); Assert.assertTrue(streamSortSpec.hashCode() == new StreamSortSpec(streamSortSpec).hashCode()); }