class UcteAliasesCreation {

    public static void createAliases(Network network) {
        Set<String> duplicatedAliases = new HashSet<>();
        network.getBranchStream().forEach(branch -> {
            if (branch instanceof TieLine) {
                TieLine tieLine = (TieLine) branch;
                tieLine.addAlias(tieLine.getHalf1().getId());
                tieLine.addAlias(tieLine.getHalf2().getId());
                addHalfElementNameAliases(tieLine, duplicatedAliases);
            }
            addElementNameAlias(branch, duplicatedAliases);
        });
        network.getSwitchStream().forEach(switchEl -> addElementNameAlias(switchEl, duplicatedAliases));
        network.getDanglingLineStream().forEach(dl -> addElementNameAlias(dl, duplicatedAliases));
    }

    private  UcteAliasesCreation();

}