package org.mobop.flatseeker.model;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

public class StubFinder extends FlatFinder {
    public Collection<Flat> Find(SearchParams params) {
        ArrayList<Flat> flats = new ArrayList<Flat>();
        //GregorianCalendar.getInstance().set(2015, Calendar.JANUARY, 1);
        SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy");

        try {
            if (params.city.toLowerCase() == "neuchatel") {
                flats.add(new Flat(3.0, 67, 1200, 120, format.parse("01/03/2015"), "Neuchâtel", "Faubourg de l'Hopital", 2, 2));
                flats.add(new Flat(3.5, 70, 1350, 120, format.parse("01/04/2015"), "Neuchâtel", "Avenue des Terreaux", 4, 1));
                flats.add(new Flat(5.0, 130, 2100, 120, format.parse("01/02/2015"), "Neuchâtel", "Rue des Battieux", 7, 5));
            } else if (params.city.toLowerCase() == "lausanne") {
                flats.add(new Flat(5.0, 170, 2400, 280, format.parse("15/03/2015"), "Lausanne", "Rue St-Roch", 1, 3));
                flats.add(new Flat(2.5, 57, 920, 60, format.parse("01/04/2015"), "Lausanne", "Avenue du Théatre", 56, 3));
                flats.add(new Flat(1.5, 43, 650, 40, format.parse("15/02/2015"), "Lausanne", "Rue Caroline", 6, 2));
                flats.add(new Flat(3.0, 62, 1400, 180, format.parse("01/02/2015"), "Neuchâtel", "Rue Centrale", 24, 8));
            } else if (params.city.toLowerCase() == "geneve") {
                flats.add(new Flat(3.5, 67, 1700, 210, format.parse("08/03/2015"), "Genêve", "Rue des Alpes", 3, 4));
            }
        } catch (ParseException e) {
            e.printStackTrace();
        }

        return flats;
    }
}

@@ -279,82 +279,8 @@
 ();%0A
-        //GregorianCalendar.getInstance().set(2015, Calendar.JANUARY, 1);%0A
     
@@ -401,20 +401,24 @@
 erCase()
- == 
+.equals(
 %22neuchat
@@ -421,16 +421,17 @@
 chatel%22)
+)
  %7B%0A     
@@ -854,20 +854,24 @@
 erCase()
- == 
+.equals(
 %22lausann
@@ -873,16 +873,17 @@
 usanne%22)
+)
  %7B%0A     
@@ -1409,12 +1409,16 @@
 se()
- == 
+.equals(
 %22gen
@@ -1422,16 +1422,17 @@
 geneve%22)
+)
  %7B%0A     

Replace == by equals().