PaginationContext { public Optional<Long> getActualRowCount() { if (null == rowCountSegment) { return Optional.empty(); } return Optional.of(rowCountSegment.isBoundOpened() ? actualRowCount + 1 : actualRowCount); } PaginationContext(final PaginationValueSegment offsetSegment, final PaginationValueSegment rowCountSegment, final List<Object> parameters); Optional<PaginationValueSegment> getOffsetSegment(); Optional<PaginationValueSegment> getRowCountSegment(); long getActualOffset(); Optional<Long> getActualRowCount(); Optional<Integer> getOffsetParameterIndex(); Optional<Integer> getRowCountParameterIndex(); long getRevisedOffset(); long getRevisedRowCount(final SelectStatementContext selectStatementContext);  }
@Test public void assertGetActualRowCountWithNumberLiteralPaginationValueSegment() { assertThat(new PaginationContext(getOffsetSegmentWithNumberLiteralPaginationValueSegment(), getRowCountSegmentWithNumberLiteralPaginationValueSegment(), getParameters()).getActualRowCount().orElse(null), is(20L)); }