private long findHighestId() {
        return this.registeredServices.stream().map(RegisteredService::getId).max(Comparator.naturalOrder()).orElse(0L);
    }
private long findHighestId ( ) { return this . registeredServices . stream ( ) . map ( RegisteredService :: getId ) . max ( Comparator . naturalOrder ( ) ) . orElse ( 0L ) ; }
This isn't super-fast but we don't expect thousands of services.

@return the highest service id in the list of registered services