### Question:
SelectionTableRowData { public SelectionTableRowData duplicate() { descriptor.retain(); SelectionTableRowData dupe = new SelectionTableRowData(descriptor); dupe.pageSelection.set(pageSelection.get()); dupe.reverse.set(reverse.get()); dupe.pace.set(pace.get()); return dupe; } SelectionTableRowData(PdfDocumentDescriptor descriptor); SelectionTableRowData duplicate(); PdfDocumentDescriptor descriptor(); void invalidate(); Set<PageRange> toPageRangeSet(); final SimpleStringProperty pageSelection; final SimpleStringProperty pace; final SimpleBooleanProperty reverse; }### Answer:
@Test public void duplicate() { PdfDocumentDescriptor descriptor = mock(PdfDocumentDescriptor.class); SelectionTableRowData victim = new SelectionTableRowData(descriptor); assertFalse(victim.reverse.get()); assertEquals("1", victim.pace.get()); assertThat(victim.pageSelection.get(), isEmptyString()); victim.reverse.set(true); victim.pace.set("3"); victim.pageSelection.set("4"); SelectionTableRowData dupe = victim.duplicate(); verify(descriptor).retain(); assertTrue(dupe.reverse.get()); assertEquals("3", dupe.pace.get()); assertEquals("4", dupe.pageSelection.get()); }