@Test public void iterateOverLabeledNodeIds() { PrimitiveLongResourceIterator labeledNodes = PrimitiveLongResourceCollections.iterator( null, 1, 2, 4, 8 ); when( nodeStore.getHighId() ).thenReturn( 15L ); int[] labelIds = new int[]{1, 2}; when( labelScanReader.nodesWithAnyOfLabels( labelIds ) ).thenReturn( labeledNodes ); LabelScanViewNodeStoreScan<Exception> storeScan = getLabelScanViewStoreScan( labelIds ); PrimitiveLongResourceIterator idIterator = storeScan.getEntityIdIterator(); List<Long> visitedNodeIds = PrimitiveLongCollections.asList( idIterator ); assertThat(visitedNodeIds, Matchers.hasSize( 4 )); assertThat( visitedNodeIds, Matchers.hasItems( 1L, 2L, 4L, 8L ) ); }