@@ -0,0 +1,1592 @@
+package org.csanchez.jenkins.plugins.kubernetes;%0A%0Aimport org.csanchez.jenkins.plugins.kubernetes.pipeline.PodTemplateMap;%0Aimport org.junit.Before;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.jvnet.hudson.test.JenkinsRule;%0A%0Aimport java.io.IOException;%0A%0Aimport static org.junit.Assert.assertEquals;%0A%0Apublic class PodTemplateMapTest %7B%0A    @Rule%0A    public JenkinsRule j = new JenkinsRule();%0A%0A    private PodTemplateMap instance;%0A    private KubernetesCloud cloud;%0A%0A    @Before%0A    public void setUp() throws IOException %7B%0A        this.instance = PodTemplateMap.get();%0A        this.cloud = new KubernetesCloud(%22kubernetes%22);%0A        j.jenkins.clouds.add(cloud);%0A        j.jenkins.save();%0A    %7D%0A%0A    @Test%0A    public void concurrentAdds() throws Exception %7B%0A        assertEquals(0, this.instance.getTemplates(cloud).size());%0A        int n = 10;%0A        Thread%5B%5D t = new Thread%5Bn%5D;%0A        for (int i = 0; i %3C t.length; i++) %7B%0A            t%5Bi%5D = newThread(i);%0A        %7D%0A        for (int i = 0; i %3C t.length; i++) %7B%0A            t%5Bi%5D.start();%0A        %7D%0A        for (int i = 0; i %3C t.length; i++) %7B%0A            t%5Bi%5D.join();%0A        %7D%0A        assertEquals(n, this.instance.getTemplates(cloud).size());%0A    %7D%0A%0A    private Thread newThread(int i) %7B%0A        String name = %22test-%22 + i;%0A        return new Thread(() -%3E %7B%0A            instance.addTemplate(cloud, buildPodTemplate(name));%0A        %7D, name);%0A    %7D%0A%0A    private PodTemplate buildPodTemplate(String label) %7B%0A        PodTemplate podTemplate = new PodTemplate();%0A        podTemplate.setLabel(label);%0A        return podTemplate;%0A    %7D%0A%7D%0A

Add a unit test