code: private Boolean indexExists(String labelName, List<String> propertyNames) {
          Schema schema = db.schema();
  
          for (IndexDefinition indexDefinition : Iterables.asList(schema.getIndexes(Label.label(labelName)))) {
              List<String> properties = Iterables.asList(indexDefinition.getPropertyKeys());
  
              if (properties.equals(propertyNames)) {
                  return true;
              }
          }
  
          return false;
      }
docs: Checks if an index exists for a given label and a list of properties
  This method checks for index on nodes
  
  @param labelName
  @param propertyNames
  @return true if the index exists otherwise it returns false