WindowFrame { static Builder builder() { return new Builder(); } private  WindowFrame(
      WindowBoundTypes leftBoundType,
      int initialLeftBound,
      WindowBoundTypes rightBoundType,
      int initialRightBound); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void precedingBeforeFollowing() { Throwable thrown = assertThrows( IllegalArgumentException.class, () -> WindowFrame.builder().setLeftFollowing(10).setRightPreceding(10).build()); assertTrue(thrown.getMessage().contains("FOLLOWING cannot come before PRECEDING")); }
@Test public void followingBeforeCurrentRow() { Throwable thrown = assertThrows( IllegalArgumentException.class, () -> WindowFrame.builder().setLeftFollowing(10).setRightCurrentRow().build()); assertTrue(thrown.getMessage().contains("FOLLOWING cannot come before CURRENT_ROW")); }
@Test public void rightShiftLargerThanLeftShiftWithPrecedingWindow() { Throwable thrown = assertThrows( IllegalArgumentException.class, () -> WindowFrame.builder().setLeftPreceding(5).setRightPreceding(10).build()); assertTrue( thrown .getMessage() .contains("must be greater than the number preceding at the end of the window ")); }
@Test public void rightShiftLargerThanLeftShiftWithFollowinggWindow() { Throwable thrown = assertThrows( IllegalArgumentException.class, () -> WindowFrame.builder().setLeftFollowing(10).setRightFollowing(5).build()); assertTrue( thrown .getMessage() .contains("must be less than the number following at the end of the window")); }
@Test public void rightShiftEqualsThanLeftShift() { assertThrows( IllegalArgumentException.class, () -> WindowFrame.builder().setLeftPreceding(5).setRightPreceding(5).build()); }