long (Map<String, List<String>> strings) { long count = 0L; for (Map.Entry<String, List<String>> e : strings.entrySet()) { if (!e.getKey().isEmpty()) { String sInner = e.getKey(); for (String s : e.getValue()) { if (sInner.equals(s)) { count++; } } } } return count; }