Created
December 5, 2011 19:52
-
-
Save tedpennings/1435060 to your computer and use it in GitHub Desktop.
When people call Java a noisy language, they are talking about the following
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private boolean parameterListsConflict(Map<String, String> map1, | |
Map<String, String> map2) { | |
if (map1.equals(map2)) { | |
return true; | |
} | |
if (map1.size() > map2.size()) { | |
return largerMapContainsAllEntriesInSmallerMap(map1, map2); | |
} else { | |
return largerMapContainsAllEntriesInSmallerMap(map2, map1); | |
} | |
} | |
private boolean largerMapContainsAllEntriesInSmallerMap( | |
Map<String, String> larger, Map<String, String> smaller) { | |
Set<Entry<String, String>> largerEntrySet = larger.entrySet(); | |
for (Entry<String, String> entry : smaller.entrySet()) { | |
if (!largerEntrySet.contains(entry)) { | |
return false; | |
} | |
} | |
return true; | |
} | |
private boolean groupsAndCategoriesMatch(Feature f1, Feature f2) { | |
return f1.getGroup().getKey().equals(f2.getGroup().getKey()) | |
&& f1.getCategory().getKey().equals(f2.getCategory().getKey()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment