Please, Could someone point out what the error is? I can't find it
package com.codegym.task.task08.task0815;
import java.util.HashMap;
import java.util.HashSet;
/*
Census
*/
public class Solution {
public static HashMap<String, String> createMap() {
//write your code here
HashMap<String, String> map = new HashMap<String, String>();
map.put("Gonzales", "Carlos");
map.put("Ruiz", "Maria");
map.put("Lopez", "Luis");
map.put("Gonzales", "Ernesto");
map.put("Ramos", "Carlos");
map.put("Flores", "Alberto");
map.put("Lopez", "Maria");
map.put("Gonzales", "Genaro");
map.put("Ruiz", "Jenny");
map.put("Perez", "Adam");
return map;
}
public static int getSameFirstNameCount(HashMap<String, String> map, String name) {
//write your code here
int counter = 0; // counter for same first name
for (HashMap.Entry<String, String> pair : map.entrySet())
{
if (pair.getValue().equalsIgnoreCase(name)) counter++;
}
return counter;
}
public static int getSameLastNameCount(HashMap<String, String> map, String lastName) {
//write your code here
int counter = 0; // counter for same first name
for (HashMap.Entry<String, String> pair : map.entrySet())
{
if (pair.getKey().equalsIgnoreCase(lastName)) counter++;
}
return counter;
}
public static void main(String[] args) {
}
}