public static void testStorage(Shortener shortener) throws IOException, ClassNotFoundException {
    //    14.4.1. Создавать три строки. Текст 1 и 3 строк должен быть одинаковым.
        String string1 = "firstString";
        String string2 = "secondString";
        String string3 = "firstString";
// Получать и сохранять идентификаторы для всех трех строк с помощью shortener.
        Long stringID1 = shortener.getId(string1);//раз
        Long stringID2 = shortener.getId(string2);//два
        Long stringID3 = shortener.getId(string3);//три
//Проверять, что идентификатор для 2 строки не равен идентификатору для 1 и 3 строк
        Assert.assertNotEquals(stringID2, stringID1);
        Assert.assertNotEquals(stringID2, stringID3);
        // Проверять, что идентификаторы для 1 и 3 строк равны.
        Assert.assertEquals(stringID1, stringID3);
//
//        14.4.5. Получать три строки по трем идентификаторам с помощью shortener.
        String stringFromShortener1 = shortener.getString(stringID1);//раз
        String stringFromShortener2 = shortener.getString(stringID2);//два
        String stringFromShortener3 = shortener.getString(stringID3);//три

//        14.4.6. Проверять, что строки, полученные в предыдущем пункте, эквивалентны оригинальным.

        Assert.assertEquals(string1, stringFromShortener1);
        Assert.assertEquals(string2, stringFromShortener2);
        Assert.assertEquals(string3, stringFromShortener3);
    }
Также требует в каждом тестовом методе вызывать testStorage()
@Test
    public void testHashMapStorageStrategy() throws IOException, ClassNotFoundException {
        Shortener shortener = new Shortener(new HashMapStorageStrategy());
        testStorage(shortener);
    }

    @Test
    public void testOurHashMapStorageStrategy() throws IOException, ClassNotFoundException {
        Shortener shortener = new Shortener(new OurHashMapStorageStrategy());
        testStorage(shortener);
    }
    @Test
    public void testFileStorageStrategy() throws IOException, ClassNotFoundException {
        Shortener shortener = new Shortener(new FileStorageStrategy());
        testStorage(shortener);

    }
    @Test
    public void testHashBiMapStorageStrategy() throws IOException, ClassNotFoundException {
        Shortener shortener = new Shortener(new HashBiMapStorageStrategy());
        testStorage(shortener);

    }
    @Test
    public void testDualHashBidiMapStorageStrategy() throws IOException, ClassNotFoundException {
        Shortener shortener = new Shortener(new DualHashBidiMapStorageStrategy());
        testStorage(shortener);

    }
    @Test
    public void testOurHashBiMapStorageStrategy() throws IOException, ClassNotFoundException {
        Shortener shortener = new Shortener(new OurHashBiMapStorageStrategy());
        testStorage(shortener);

    }
Тесты проходит.