Source:
<code>public void postImg(final Context context, final ProductImage image) { final LoadToast lt = new LoadToast(context); lt.setText(context.getString(R.string.toastSending)); lt.setBackgroundColor(context.getResources().getColor(R.color.blue)); lt.setTextColor(context.getResources().getColor(R.color.white)); lt.show(); String lang = Locale.getDefault().getLanguage(); <START> HashMap<String, RequestBody> imgMap = new HashMap<>(); <END> imgMap.put("code", image.getCode()); imgMap.put("imagefield", image.getField()); imgMap.put("imgupload_front\"; filename=\"front_"+ lang +".png\"", image.getImguploadFront()); imgMap.put("imgupload_ingredients\"; filename=\"ingredients_" + lang + ".png\"", image.getImguploadIngredients()); imgMap.put("imgupload_nutrition\"; filename=\"nutrition_" + lang + ".png\"", image.getImguploadNutrition()); imgMap.put("imgupload_other\"; filename=\"other_" + lang + ".png\"", image.getImguploadOther()); apiService.saveImage(imgMap) .enqueue(new Callback<JsonNode>() { @Override public void onResponse(Call<JsonNode> call, Response<JsonNode> response) { if(!response.isSuccess()) { Toast.makeText(context, context.getString(R.string.errorWeb), Toast.LENGTH_LONG).show(); lt.error(); return; } JsonNode body = response.body(); if (body == null || !body.isObject()) { lt.error(); } else if (body.get("status").asText().contains("status not ok")) { Toast.makeText(context, body.get("error").asText(), Toast.LENGTH_LONG).show(); lt.error(); } else { lt.success(); } } @Override public void onFailure(Call<JsonNode> call, Throwable t) { Toast.makeText(context, context.getString(R.string.errorWeb), Toast.LENGTH_LONG).show(); lt.error(); } }); }</code><technical_language>a generic interface for declaration Map<String, RequestBody> imgMap = new HashMap<>();</technical_language>

Target:
public void postImg(final Context context, final ProductImage image) { final LoadToast lt = new LoadToast(context); lt.setText(context.getString(R.string.toastSending)); lt.setBackgroundColor(context.getResources().getColor(R.color.blue)); lt.setTextColor(context.getResources().getColor(R.color.white)); lt.show(); String lang = Locale.getDefault().getLanguage(); Map<String, RequestBody> imgMap = new HashMap<>(); imgMap.put("code", image.getCode()); imgMap.put("imagefield", image.getField()); imgMap.put("imgupload_front\"; filename=\"front_"+ lang +".png\"", image.getImguploadFront()); imgMap.put("imgupload_ingredients\"; filename=\"ingredients_" + lang + ".png\"", image.getImguploadIngredients()); imgMap.put("imgupload_nutrition\"; filename=\"nutrition_" + lang + ".png\"", image.getImguploadNutrition()); imgMap.put("imgupload_other\"; filename=\"other_" + lang + ".png\"", image.getImguploadOther()); apiService.saveImage(imgMap) .enqueue(new Callback<JsonNode>() { @Override public void onResponse(Call<JsonNode> call, Response<JsonNode> response) { if(!response.isSuccess()) { Toast.makeText(context, context.getString(R.string.errorWeb), Toast.LENGTH_LONG).show(); lt.error(); return; } JsonNode body = response.body(); if (body == null || !body.isObject()) { lt.error(); } else if (body.get("status").asText().contains("status not ok")) { Toast.makeText(context, body.get("error").asText(), Toast.LENGTH_LONG).show(); lt.error(); } else { lt.success(); } } @Override public void onFailure(Call<JsonNode> call, Throwable t) { Toast.makeText(context, context.getString(R.string.errorWeb), Toast.LENGTH_LONG).show(); lt.error(); } }); }