List of usage examples for java.util LinkedHashMap putIfAbsent
default V putIfAbsent(K key, V value)
From source file:org.sonatype.nexus.repository.r.internal.RPackagesUtils.java
static List<Map<String, String>> merge(List<List<Map<String, String>>> parts) { final LinkedHashMap<String, Map<String, String>> merged = new LinkedHashMap<>(); for (List<Map<String, String>> part : parts) { for (Map<String, String> thisEntry : part) { merged.putIfAbsent(thisEntry.get(P_PACKAGE), thisEntry); }//from w w w . jav a2 s . c o m } return new ArrayList<>(merged.values()); }