private InputIterable relationships( final long randomSeed, final long count, int batchSize,
final InputIdGenerator idGenerator, final IdGroupDistribution groups )
{
return () -> new GeneratingInputIterator<>( count, batchSize, new RandomsStates( randomSeed ),
( randoms, visitor, id ) -> {
randomProperties( randoms, "Name " + id, visitor );
ExistingId startNodeExistingId = idGenerator.randomExisting( randoms );
Group startNodeGroup = groups.groupOf( startNodeExistingId.nodeIndex );
ExistingId endNodeExistingId = idGenerator.randomExisting( randoms );
Group endNodeGroup = groups.groupOf( endNodeExistingId.nodeIndex );
Object startNode = idGenerator.miss( randoms, startNodeExistingId.id, 0.001f );
Object endNode = idGenerator.miss( randoms, endNodeExistingId.id, 0.001f );
visitor.startId( startNode, startNodeGroup );
visitor.endId( endNode, endNodeGroup );
String type = idGenerator.randomType( randoms );
if ( randoms.nextFloat() < 0.00005 )
{
type += "_odd";
}
visitor.type( type );
}, 0 );
}