class GatewayConvertUtil {

    public void setTopologies(GatewayV4Request source, Gateway gateway) {
        if (!CollectionUtils.isEmpty(source.getTopologies())) {
            Set<GatewayTopology> gatewayTopologies = source.getTopologies().stream()
                    .map(g -> converterUtil.convert(g, GatewayTopology.class))
                    .collect(Collectors.toSet());
            gateway.setTopologies(gatewayTopologies);
            gatewayTopologies.forEach(g -> g.setGateway(gateway));
        }
    }

}