@SuppressWarnings("unchecked")
	private <F> boolean queryExternal(JoinQuery query, JoinQueryResultHandler<E, F> handler, SpatialIndex<E>.Node node1, SpatialIndex<F>.Node node2) {
		for (int i = 0; i < node1.numEntries; i++) {
			int k = node1 == node2 ? i + 1 : 0;

			for (int j = k; j < node2.numEntries; j++) {
				if (query.query(node1.volumes[i], node2.volumes[j], false)) {
					if (!handler.handle((E) node1.entries[i], (F) node2.entries[j])) {
						return false;
					}
				} else {
					if (node1 == node2 && !query.isSymmetric()) {
						if (query.query(node2.volumes[j], node1.volumes[i], false)) {
							if (!handler.handle((E) node2.entries[j], (F) node1.entries[i])) {
								return false;
							}
						}
					}
				}
			}
		}

		return true;
	}