code: public static List<String> getStoreNames(List<StoreDefinition> list, boolean ignoreViews) {
          List<String> storeNameSet = new ArrayList<String>();
          for(StoreDefinition def: list)
              if(!def.isView() || !ignoreViews)
                  storeNameSet.add(def.getName());
          return storeNameSet;
      }
docs: Get the list of store names from a list of store definitions
  
  @param list
  @param ignoreViews
  @return list of store names