package com.javarush.task.task33.task3310;

/**
 * Created by Alexey Vedensky on 14.04.2017.
 * MAIL: avedensky@gmail.com
 */
public class Shortener {
    public Long getId(String string) {

        return null;
    }

    public String getString(Long id) {
        return null;
    }
}

@@ -37,16 +37,84 @@
 k3310;%0A%0A
+import com.javarush.task.task33.task3310.strategy.StorageStrategy;%0A%0A
 /**%0A * C
@@ -221,62 +221,487 @@
    p
-ublic Long getId(String string) %7B%0A%0A        return null
+rivate Long lastId;%0A    private StorageStrategy storageStrategy;%0A%0A    public Shortener(StorageStrategy storageStrategy) %7B%0A        this.lastId = 0L;%0A        this.storageStrategy = storageStrategy;%0A    %7D%0A%0A    public synchronized Long getId(String string) %7B%0A        if (storageStrategy.containsValue(string)) %7B%0A            return storageStrategy.getKey(string);%0A        %7D else %7B%0A            lastId++;%0A            storageStrategy.put(lastId, string);%0A        %7D%0A%0A        return lastId
 ;%0A  
@@ -716,16 +716,29 @@
  public 
+synchronized 
 String g
@@ -776,12 +776,36 @@
 urn 
-null
+storageStrategy.getValue(id)
 ;%0A  

Task 3310 (3) has done