class KneighborRecords extends SingleWayMultiPathsRecords {

    public KneighborRecords(boolean concurrent,
                            Id source, boolean nearest) {
        super(RecordType.INT, concurrent, source, nearest);
    }

    @Override
    public int size() {
        return (int) this.accessed();
    }

    @Override
    public List<Id> ids(long limit) {
        List<Id> ids = CollectionFactory.newList(CollectionType.EC);
        this.getRecords(limit, ids);
        return ids;
    }

    public Set<Id> idsBySet(long limit) {
        Set<Id> ids = CollectionFactory.newSet(CollectionType.EC);
        this.getRecords(limit, ids);
        return ids;
    }

    private void getRecords(long limit, Collection<Id> ids) {
        Stack<Record> records = this.records();
        // Not include record(i=0) to ignore source vertex
        for (int i = 1; i < records.size(); i++) {
            IntIterator iterator = records.get(i).keys();
            while ((limit == NO_LIMIT || limit > 0L) && iterator.hasNext()) {
                ids.add(this.id(iterator.next()));
                limit--;
            }
        }
    }

    @Override
    public PathSet paths(long limit) {<FILL_FUNCTION_BODY>}
}

        PathSet paths = new PathSet();
        Stack<Record> records = this.records();
        for (int i = 1; i < records.size(); i++) {
            IntIterator iterator = records.get(i).keys();
            while ((limit == NO_LIMIT || limit > 0L) && iterator.hasNext()) {
                paths.add(this.linkPath(i, iterator.next()));
                limit--;
            }
        }
        return paths;
    
<methods>public void <init>(org.apache.hugegraph.traversal.algorithm.records.record.RecordType, boolean, org.apache.hugegraph.backend.id.Id, boolean) ,public long accessed() ,public void addPath(org.apache.hugegraph.backend.id.Id, org.apache.hugegraph.backend.id.Id) ,public void addPathToRecord(int, int, org.apache.hugegraph.traversal.algorithm.records.record.Record) ,public org.apache.hugegraph.traversal.algorithm.HugeTraverser.EdgeRecord edgeResults() ,public org.apache.hugegraph.traversal.algorithm.HugeTraverser.PathSet findPath(org.apache.hugegraph.backend.id.Id, Function<org.apache.hugegraph.backend.id.Id,java.lang.Boolean>, boolean, boolean) ,public void finishOneLayer() ,public boolean hasNextKey() ,public abstract List<org.apache.hugegraph.backend.id.Id> ids(long) ,public Iterator<org.apache.hugegraph.backend.id.Id> keys() ,public org.apache.hugegraph.backend.id.Id nextKey() ,public abstract org.apache.hugegraph.traversal.algorithm.HugeTraverser.PathSet paths(long) ,public abstract int size() ,public void startOneLayer(boolean) <variables>private final non-sealed org.apache.hugegraph.util.collection.IntSet accessedVertices,private final non-sealed org.apache.hugegraph.traversal.algorithm.HugeTraverser.EdgeRecord edgeResults,private final non-sealed boolean nearest,private org.apache.hugegraph.util.collection.IntIterator parentRecordKeys,private final non-sealed Stack<org.apache.hugegraph.traversal.algorithm.records.record.Record> records,protected final non-sealed int sourceCode