code: public static void validateUserStoreNamesOnNode(AdminClient adminClient,
                                                      Integer nodeId,
                                                      List<String> storeNames) {
          List<StoreDefinition> storeDefList = adminClient.metadataMgmtOps.getRemoteStoreDefList(nodeId)
                                                                          .getValue();
          Map<String, Boolean> existingStoreNames = new HashMap<String, Boolean>();
          for(StoreDefinition storeDef: storeDefList) {
              existingStoreNames.put(storeDef.getName(), true);
          }
          for(String storeName: storeNames) {
              if(!Boolean.TRUE.equals(existingStoreNames.get(storeName))) {
                  Utils.croak("Store " + storeName + " does not exist!");
              }
          }
      }
docs: Utility function that checks if store names are valid on a node.
  
  @param adminClient An instance of AdminClient points to given cluster
  @param nodeId Node id to fetch stores from
  @param storeNames Store names to check