PageInfo { void setVisible(int visible) { this.visible = min(total, visible); } PageInfo(int pageSize);   PageInfo(int pageSize, int page, int visible, int total); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); int getFrom(); int getTo(); int getPage(); int getPages(); int getPageSize(); int getVisible(); int getTotal();  }
@Test public void setVisible() throws Exception { PageInfo pageInfo = new PageInfo(PAGE_SIZE, 0, 50, 100); pageInfo.setVisible(66); assertEquals(66, pageInfo.getVisible()); }