code: public List<GeometryIndex> getAdjacentVertices(Geometry geometry, GeometryIndex index)
  			throws GeometryIndexNotFoundException {
  		if (geometry == null || index == null) {
  			throw new IllegalArgumentException("No null values allowed!");
  		}
  		GeometryIndexCombo combo = recursiveSearch(geometry, index);
  
  		int[] indices = new int[] {};
  		if (isVertex(index)) {
  			indices = getAdjacentVerticesForVertex(combo.getGeometry(), combo.getIndex());
  		} else if (isEdge(index)) {
  			indices = getAdjacentVerticesForEdge(combo.getGeometry(), combo.getIndex());
  		}
  
  		List<GeometryIndex> indexList = new ArrayList<GeometryIndex>();
  		for (int current : indices) {
  			indexList.add(recursiveCreate(index, current, GeometryIndexType.TYPE_VERTEX));
  		}
  
  		// Can return an empty list.
  		return indexList;
  	}
docs: Given a certain geometry and index, find the neighboring vertices. It is important to understand that searching
  vertices within a closed ring will always return 2 vertices (unless the ring contains only 1 or 2 coordinates),
  while searching within a LineString can yield different results (the beginning or end only has 1 neighbor).
  
  @param geometry
  The geometry wherein to search for neighboring vertices.
  @param index
  The index to start out from. Must point to either a vertex or and edge.
  @return The list of neighboring vertices.
  @throws GeometryIndexNotFoundException
  Thrown in case the given index does not match the given geometry.