package com.campmongoose.serversaturday.common.submission;

import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;

public abstract class AbstractSubmitter<B extends AbstractBuild, I, L> {

    protected final Map<String, B> builds = new HashMap<>();
    @Nonnull
    protected final String name;
    @Nonnull
    protected final UUID uuid;

    protected AbstractSubmitter(@Nonnull String name, @Nonnull UUID uuid) {
        this.name = name;
        this.uuid = uuid;
    }

    @Nullable
    public B getBuild(@Nonnull String name) {
        return builds.get(name);
    }

    @Nonnull
    public List<B> getBuilds() {
        return new ArrayList<>(builds.values());
    }

    @Nonnull
    public abstract I getMenuRepresentation();

    @Nonnull
    public String getName() {
        return name;
    }

    @Nonnull
    public UUID getUUID() {
        return uuid;
    }

    @Nonnull
    public abstract B newBuild(@Nonnull String name, @Nonnull L location);

    public boolean removeBuild(@Nonnull String name) {
        return builds.remove(name) != null;
    }

    public abstract void save(@Nonnull File file);
}

@@ -1219,24 +1219,194 @@
 ull;%0A    %7D%0A%0A
+    public void renameBuild(String newName, B build) %7B%0A        builds.remove(build.getName());%0A        build.setName(newName);%0A        builds.put(newName, build);%0A    %7D%0A%0A
     public a

Fix an issue with updating builds.