InternalIdToLongIterator implements EdgeIterator, ReusableInternalIdToLongIterator { public InternalIdToLongIterator(LongToInternalIntBiMap nodesIndexMap, EdgeTypeMask edgeTypeMask) { this.nodesIndexMap = nodesIndexMap; this.edgeTypeMask = edgeTypeMask; this.currentNodeId = 0; } InternalIdToLongIterator(LongToInternalIntBiMap nodesIndexMap, EdgeTypeMask edgeTypeMask); @Override EdgeIterator resetWithIntIterator(IntIterator inputIntIterator); @Override long nextLong(); @Override byte currentEdgeType(); @Override long currentMetadata(); @Override int skip(int i); @Override boolean hasNext(); @Override Long next(); @Override void remove();  }
@Test public void testInternalIdToLongIterator() { LongToInternalIntBiMap nodesToIndexBiMap = new ArrayBasedLongToInternalIntBiMap(10, 0.5, -1, -1L, nullStatsReceiver); int n = 7; int[] expectedIndices = new int[n]; long[] expectedEntries = new long[n]; for (int i = 0; i < n; i++) { expectedIndices[i] = nodesToIndexBiMap.put(i); expectedEntries[i] = (long) i; } IntIterator intIterator = new IntArrayList(expectedIndices).iterator(); InternalIdToLongIterator internalIdToLongIterator = new InternalIdToLongIterator(nodesToIndexBiMap, new IdentityEdgeTypeMask()); internalIdToLongIterator.resetWithIntIterator(new WithEdgeMetadataIntIteratorImpl(intIterator)); assertEquals(new LongArrayList(expectedEntries), new LongArrayList(internalIdToLongIterator)); }