private static List<Pair<Integer, String>> normalizeGeneralNames(Collection<List<?>> names) {
        // Extract a more convenient type than Java's Collection<List<?>>.
        List<Pair<Integer, String>> result = new ArrayList<>();
        for (List<?> tuple : names) {
            assertEquals(2, tuple.size());
            int type = (Integer) tuple.get(0);
            // TODO(davidben): Most name types are expected to have a String value, but some use
            // byte[]. Update this logic when testing those name types. See
            // X509Certificate.getSubjectAlternativeNames().
            String value = (String) tuple.get(1);
            result.add(Pair.of(type, value));
        }
        // Although there is a natural order (the order in the certificate), Java's API returns a
        // Collection, so there is no guarantee of the provider using a particular order. Normalize
        // the order before comparing.
        result.sort(Comparator.comparingInt(
                (Pair<Integer, String> a) -> a.getFirst()).thenComparing(Pair::getSecond));
        return result;
    }
This is a certificate whose keyUsage extension has more than nine bits. The getKeyUsage()
method internally rounds up to nine bits, so this tests what happens when it does not need to
round.
common/src/test/java/org/conscrypt/java/security/cert/X509CertificateTest.java