examples/iot-nirvana/common/src/main/java/com/google/cloud/demo/iot/nirvana/common/TemperatureUtils.java
/**
   * Create a test dataset of cities and return it as a map whose key is the MD5 of the latitude and
   * longitude of the city
   */
Create a test dataset of cities and return it as a map whose key is the MD5 of the latitude and
longitude of the city
Create a test dataset of cities and return it as a map whose key is the MD5 of the latitude and longitude of the city
public static Map<String, City> loadCities() throws FormatException {
    String citiesJson = loadJsonFromFile();
    City.Builder[] cities = City.fromJsonArray(citiesJson);
    Map<String, City> citiesMap = new HashMap<>();
    for (City.Builder cityBuilder : cities) {
      City city = cityBuilder.build();
      String key = generateCityKey(city);
      citiesMap.put(key, city);
    }
    return citiesMap;
  }
public static Map < String , City > loadCities ( ) throws FormatException { String citiesJson = loadJsonFromFile ( ) ; City . Builder [ ] cities = City . fromJsonArray ( citiesJson ) ; Map < String , City > citiesMap = new HashMap < > ( ) ; for ( City . Builder cityBuilder : cities ) { City city = cityBuilder . build ( ) ; String key = generateCityKey ( city ) ; citiesMap . put ( key , city ) ; } return citiesMap ; }
Create a test dataset of cities and return it as a map whose key is the MD5 of the latitude and
 longitude of the city
Create a test dataset of cities and return it as a map whose key is the MD5 of the latitude and longitude of the city