HashMap to class
String[] modalidades = new String[precos.size()];
int i = 0;
for (Map.Entry<String, Preco> entry : precos.entrySet()) {
Gson gson = new Gson();
JsonElement jsonElement = gson.toJsonTree(entry.getValue());
Preco p = gson.fromJson(jsonElement, Preco.class);
modalidades[i] = p.getNome();
i++;
}