MCPcopy Create free account
hub / github.com/antlr/codebuff / isPermutation

Method isPermutation

output/java_guava/1.4.18/Collections2.java:670–677  ·  view source on GitHub ↗

Returns true if the second list is a permutation of the first.

(List<?> first, List<?> second)

Source from the content-addressed store, hash-verified

668 */
669
670 private static boolean isPermutation(List<?> first, List<?> second) {
671 if (first.size() != second.size()) {
672 return false;
673 }
674 Multiset<?> firstMultiset = HashMultiset.create(first);
675 Multiset<?> secondMultiset = HashMultiset.create(second);
676 return firstMultiset.equals(secondMultiset);
677 }
678
679 private static boolean isPositiveInt(long n) {
680 return n >= 0 && n <= Integer.MAX_VALUE;

Callers 2

containsMethod · 0.45
containsMethod · 0.45

Calls 3

createMethod · 0.95
sizeMethod · 0.65
equalsMethod · 0.65

Tested by

no test coverage detected