WindowParametersHelper { public static long getMaxTime( long windowMaxTimeLimit, long windowLimit, boolean rowBased ) { return windowLimit > 0 && rowBased ? Math.min( windowLimit, windowMaxTimeLimit ) : windowMaxTimeLimit; }  static String getCacheKey( String query, IDataServiceClientService.StreamingMode windowMode, long windowSize, long windowEvery,
                                    int windowMaxRowLimit, long windowMaxTimeLimit, long windowLimit, int serviceExecutorCacheKeyHash ); static long getWindowEvery( long windowEvery, boolean timeBased, int maxRows, long maxTime ); static long getWindowSize( long windowSize, boolean timeBased, int maxRows, long maxTime ); static long getMaxTime( long windowMaxTimeLimit, long windowLimit, boolean rowBased ); static int getMaxRows( int windowMaxRowLimit, long windowLimit, boolean timeBased );  }
@Test public void testGetMaxTimeRowMode() { assertEquals( 1000, WindowParametersHelper.getMaxTime( 1000, 0, true ) ); assertEquals( 10, WindowParametersHelper.getMaxTime( 1000, 10, true ) ); assertEquals( 1000, WindowParametersHelper.getMaxTime( 1000, 10000, true ) ); }
@Test public void testGetMaxTimeTimeMode() { assertEquals( 1000, WindowParametersHelper.getMaxTime( 1000, 0, false ) ); assertEquals( 1000, WindowParametersHelper.getMaxTime( 1000, 10, false ) ); assertEquals( 1000, WindowParametersHelper.getMaxTime( 1000, 10000, false ) ); }