package com.google.sps.data;

/** User representing a location **/
public class User {

  private MapLocation geolocation;

  /** Creates a user with a geolocation
  * @param geolocation lat/lng coordinate
  * @return User with geolocation
  **/
  public User(MapLocation geolocation) {
    this.geolocation = geolocation;
  }
  
  /** Creates a user with a zipcode
  * @param zipcode
  * @return User with zipCode
  **/
  public User(int zipCode) {

  }

  public MapLocation getGeolocation() {
    return geolocation;
  }
}
@@ -27,99 +27,649 @@
 a;%0A%0A
-/** User representing a location **/%0Apublic class User %7B%0A%0A  private MapLocation geolocation
+import com.google.maps.GeocodingApi;%0Aimport com.google.maps.model.AddressComponentType;%0Aimport com.google.maps.model.AddressType;%0Aimport com.google.maps.model.ComponentFilter;%0Aimport com.google.maps.model.GeocodingResult;%0Aimport com.google.maps.GeoApiContext;%0Aimport com.google.maps.model.LatLng;%0Aimport com.google.maps.model.LocationType;%0Aimport java.util.Arrays;%0Aimport java.util.logging.Logger;%0A%0A/** User representing a location **/%0Apublic class User %7B%0A%0A  private MapLocation geolocation;%0A  private final String KEY = %22AIzaSyDDIsG-SJAZ69ZoOecmfbXOB7ZIS4pZkAw%22;%0A  private final static Logger LOGGER = Logger.getLogger(User.class.getName())
 ;%0A%0A 
@@ -982,11 +982,14 @@
 ser(
+Str
 in
-t
+g
  zip
@@ -996,16 +996,69 @@
 Code) %7B%0A
+    this.geolocation = zipCodeToMapLocation(zipCode);
 %0A  %7D%0A%0A  
@@ -1122,10 +1122,574 @@
 ion;%0A  %7D
+%0A%0A  private MapLocation zipCodeToMapLocation(String zipCode) %7B%0A    final GeoApiContext context = new GeoApiContext.Builder()%0A            .apiKey(KEY)%0A            .build();%0A    final GeocodingResult%5B%5D results;%0A    try %7B%0A        results = GeocodingApi.geocode(context, zipCode).await();%0A        MapLocation geolocation = new MapLocation(results%5B0%5D.geometry.location.lat, results%5B0%5D.geometry.location.lng);%0A        return geolocation;%0A    %7D catch (final Exception e) %7B%0A        LOGGER.warning(e.getMessage());%0A    %7D%0A    return new MapLocation(0,0);  // null Island%0A  %7D
 %0A%7D

Implement ziptoGeolocation function