### Question:
InnerQueryCursor implements Cursor { @Override public QueryResultBase getNextResults(int numResults) { AssignmentsQueryResult all = new AssignmentsQueryResult(new ArrayList<>()); AssignmentsQueryResult nextResult; do { nextResult = this.innerCursor.getNextResults(numResults); all.getAssignments().addAll(nextResult.getAssignments()); } while (nextResult.getSize() > 0); return all; } InnerQueryCursor(CompositeTraversalCursorContext context, PathsTraversalCursor innerCursor, CreateInnerQueryCursorRequest cursorRequest); @Override QueryResultBase getNextResults(int numResults); @Override TraversalCursorContext getContext(); CreateInnerQueryCursorRequest getCursorRequest();  }### Answer:
@Test public void testSingleElement() { TraversalCursorContext context = Mockito.mock(TraversalCursorContext.class); PathsTraversalCursor cursorMock = Mockito.mock(PathsTraversalCursor.class); AssignmentsQueryResult res1 = AssignmentsQueryResult.Builder.instance(). withAssignment( instance().withEntity(Entity.Builder.instance().withEID("123") .withETag(Stream.of("Child").toJavaSet()) .withEType("Entity").build()).build()) .build(); when(cursorMock.getNextResults(anyInt())).thenReturn(res1, AssignmentsQueryResult.Builder.instance().build()); InnerQueryCursor cursor = new InnerQueryCursor(new CompositeTraversalCursorContext(context,Collections.emptyList()), cursorMock, null); AssignmentsQueryResult<Entity, Relationship> nextResults = (AssignmentsQueryResult<Entity, Relationship>) cursor.getNextResults(1000); Assert.assertEquals(1, nextResults.getAssignments().size()); Assert.assertEquals(1, nextResults.getAssignments().get(0).getEntities().size()); Assert.assertEquals("123", nextResults.getAssignments().get(0).getEntities().get(0).geteID()); Assert.assertTrue(nextResults.getAssignments().get(0).getEntities().get(0).geteTag().contains("Child")); Assert.assertEquals("Entity", nextResults.getAssignments().get(0).getEntities().get(0).geteType()); }