public boolean isAdjacent(Geometry geometry, GeometryIndex one, GeometryIndex two) {
		List<GeometryIndex> neighbors = null;
		try {
			if (isVertex(two)) {
				neighbors = getAdjacentVertices(geometry, one);
			} else if (isEdge(two)) {
				neighbors = getAdjacentEdges(geometry, one);
			}
		} catch (GeometryIndexNotFoundException e) {
			return false;
		}

		if (neighbors != null) {
			for (GeometryIndex neighbor : neighbors) {
				if (neighbor.equals(two)) {
					return true;
				}
			}
		}

		return false;
	}
public boolean isAdjacent ( Geometry geometry , GeometryIndex one , GeometryIndex two ) { List < GeometryIndex > neighbors = null ; try { if ( isVertex ( two ) ) { neighbors = getAdjacentVertices ( geometry , one ) ; } else if ( isEdge ( two ) ) { neighbors = getAdjacentEdges ( geometry , one ) ; } } catch ( GeometryIndexNotFoundException e ) { return false ; } if ( neighbors != null ) { for ( GeometryIndex neighbor : neighbors ) { if ( neighbor . equals ( two ) ) { return true ; } } } return false ; }
Given a certain geometry and index (one), check if the the other index (two) is a neighbor.

@param geometry
The geometry wherein to search if indices one and two are neighbors.
@param one
One of the indices. Must point to either a vertex or and edge.
@param two
Another one of the indices. Must point to either a vertex or and edge.
@return true or false.