private static List<Port> dedupPorts(List<Port> ports) {
        final List<Port> dedupedList = new ArrayList<>();
        for (Port port : ports) {
            boolean found = false;
            for (Port deduped : dedupedList) {
                if (port.getPort() == deduped.getPort() &&
                    Objects.equal(port.getAddress(), deduped.getAddress()) &&
                    Objects.equal(port.getIp(), deduped.getIp())) {
                    found = true;
                    if (port.getProtocols() != null) {
                        final Set<SessionProtocol> merged = EnumSet.copyOf(port.getProtocols());
                        if (deduped.getProtocols() != null) {
                            merged.addAll(deduped.getProtocols());
                        }
                        deduped.setProtocols(ImmutableList.copyOf(merged));
                    }
                    break;
                }
            }
            if (!found) {
                dedupedList.add(port);
            }
        }
        return ImmutableList.copyOf(dedupedList);
    }
Remove duplicate {@link Port} entries within the list.
If there are duplicates, keep the preceding {@link Port}.
The criteria for duplication are based on {@link Port#getPort()}, {@link Port#getAddress()},and
{@link Port#getIp()}.
spring/boot3-autoconfigure/src/main/java/com/linecorp/armeria/internal/spring/ArmeriaConfigurationUtil.java