package io.github.plastix.forage.data.local.model;

import android.location.Location;

import io.realm.RealmObject;

/**
 * Realm Model "wrapper" to store location data in a Realm. This is required because Realm doesn't
 * allow third party types such as Android's location type.
 */
public class RealmLocation extends RealmObject {

    public double latitude;
    public double longitude;

    /**
     * Returns a new Android Location object with the corresponding data from the realm object.
     *
     * @return New Location object.
     */
    public Location toLocation() {
        Location location = new Location("Realm");
        location.setLatitude(latitude);
        location.setLongitude(longitude);
        return location;
    }
}

@@ -80,16 +80,68 @@
 ation;%0A%0A
+import io.github.plastix.forage.util.LocationUtils;%0A
 import i
@@ -639,156 +639,63 @@
     
-Location l
+return L
 ocation
- = new Location(%22Realm%22);%0A        location.setLatitude(latitude);%0A        location.setLongitude(longitude);%0A        return location
+Utils.buildLocation(latitude, longitude)
 ;%0A  

Use new buildLocation helper method in LocationUtils