private VectorResult queryVectorForCluster(TreeMap<Long, VectorResult> workList,
		double threshold)
		throws LSHException {
		Entry<Long, VectorResult> entry = workList.pollFirstEntry();
		VectorResult currentVector = entry.getValue();
		baseIds.remove(entry.getKey());		// Look-up vector and remove from to-do list
		queriedIds.add(entry.getKey());		// Mark that this id has been queried
		if (currentVector == null) {
			currentVector = buildSeedVector(entry.getKey());	// If VectorResult isn't present, this must be a seed for the cluster
		}
		QueryNearestVector query = buildVectorQuery(currentVector.vec, threshold);
		ResponseNearestVector response = query.execute(database);
		if (response == null || response.result.size() != 1) {
			throw new LSHException("Could not perform query on vector");
		}
		Iterator<VectorResult> iter = response.result.get(0).iterator();
		while (iter.hasNext()) {
			VectorResult vecResult = iter.next();
			Long curId = vecResult.vectorid;
			if (queriedIds.contains(curId)) {
				continue;	// Already queried
			}
			workList.put(curId, vecResult);
		}
		return currentVector;
	}
Pull one ID out of the workList, look-up its corresponding vector, and query for nearby vectors.
Add IDs of the close vectors (that have not been seen before) to the workList
Use vectorMap to keep track of what's been seen/queried before
@param workList is the current list of IDs yet to be processed for the cluster
@param threshold defines how similar "close" vectors are
@return the VectorResult of the next ID
@throws LSHException if something goes wrong during a query
Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/client/ExecutableComparison.java