### Question:
Incrementer extends BaseBlockImporter<A, SwiftResultSet> { @Override protected Inserting getInserting(SegmentKey segKey) { Segment seg = SegmentUtils.newSegment(segKey); return new Inserting(SwiftInserter.ofAppendMode(seg), seg, SegmentUtils.safeGetRowCount(seg)); } Incrementer(DataSource dataSource, A alloter);   }### Answer:
@Test public void getInserting() { SegmentKey segKey = mock(SegmentKey.class); Segment seg = mock(Segment.class); mockStatic(SegmentUtils.class); when(SegmentUtils.newSegment(segKey)).thenReturn(seg); SwiftInserter inserter = mock(SwiftInserter.class); mockStatic(SwiftInserter.class); when(SwiftInserter.ofAppendMode(seg)).thenReturn(inserter); when(seg.isReadable()).thenReturn(true); when(seg.getRowCount()).thenReturn(1); Incrementer<SwiftSourceAlloter<?, RowInfo>> incrementer = new Incrementer<SwiftSourceAlloter<?, RowInfo>>(mock(DataSource.class), mock(SwiftSourceAlloter.class)); Object inserting = incrementer.getInserting(segKey); assertEquals(inserter, Whitebox.getInternalState(inserting, "inserter")); assertEquals(seg, Whitebox.getInternalState(inserting, "seg")); assertEquals(1, (int) Whitebox.getInternalState(inserting, "rowCount")); }