public Map<String, String> subjectAltNames() {
        Map<String, String> san = new HashMap<>();
        int i = 0;
        for (String name : dnsNames()) {
            san.put("DNS." + (i++), name);
        }
        i = 0;
        for (String ip : ipAddresses()) {
            san.put("IP." + (i++), ip);
        }
        return san;
    }
@Test
    public void testSubjectAlternativeNames()   {
        Subject subject = new Subject.Builder()
                .withCommonName("joe")
                .withOrganizationName("MyOrg")
                .addDnsName("example.com")
                .addDnsName("example.org")
                .addDnsNames(List.of("example.cz", "example.co.uk"))
                .addIpAddress("123.123.123.123")
                .addIpAddress("127.0.0.1")
                .build();
        assertEquals(Map.of(
                "IP.0", "123.123.123.123",
                "IP.1", "127.0.0.1",
                "DNS.0", "example.org",
                "DNS.1", "example.co.uk",
                "DNS.2", "example.com",
                "DNS.3", "example.cz"),
                subject.subjectAltNames());
    }