Object randomPropertyValue() { return random.nextValueAsObject(); }
@Override public InputIterable nodes() { return () -> new RandomNodeGenerator( count, ( state, visitor, id ) -> { String[] keys = random.randomValues().selection( TOKENS, 1, TOKENS.length, false ); for ( String key : keys ) { visitor.property( key, random.nextValueAsObject() ); } visitor.labels( random.selection( TOKENS, 1, TOKENS.length, false ) ); } ); }
node.setProperty( key, random.nextValueAsObject() ); random.among( nodes, node -> node.setProperty( random.among( keys ), random.nextValueAsObject() ) );
if ( random.nextBoolean() ) node.setProperty( randomKey(), random.nextValueAsObject() ); if ( random.nextBoolean() ) relationship.setProperty( randomKey(), random.nextValueAsObject() ); random.among( nodes, node -> node.setProperty( randomKey(), random.nextValueAsObject() ) ); relationship -> relationship.setProperty( randomKey(), random.nextValueAsObject() ) );