@@ -0,0 +1,2715 @@
+package ru.matevosyan;%0A%0Aimport org.junit.Test;%0A%0Aimport java.util.NoSuchElementException;%0A%0Aimport static org.hamcrest.MatcherAssert.assertThat;%0Aimport static org.hamcrest.core.Is.is;%0Aimport static org.junit.Assert.assertFalse;%0Aimport static org.junit.Assert.assertTrue;%0A%0A/**%0A * Test MajorStore class.%0A * Created on 16.05.2017.%0A * @author Matevosyan Vardan%0A * @version 1.0%0A */%0A%0Apublic class MajorStoreTest %7B%0A%0A    /**%0A     * whenAddBaseAndGetObjectThanCheckAddedObject() method created to test %7B@link MajorStore#add(Base)%7D method.%0A     */%0A%0A    @Test%0A    public void whenAddBaseAndGetObjectThanCheckAddedObject() %7B%0A        Base user = new User(%22Vova%22, 12, %221%22);%0A        Base role = new Role(%222%22);%0A%0A        MajorStore majorStore = new MajorStore(2);%0A%0A        majorStore.add(user);%0A        majorStore.add(role);%0A%0A        assertThat(majorStore.get(%221%22), is(user));%0A    %7D%0A%0A    /**%0A     * whenAddBaseAndUpdateAndGetObjectThanCheckUpdatedObject() method created to test.%0A     * %7B@link MajorStore#update(String, Base)%7D )%7D method.%0A     */%0A%0A    @Test%0A    public void whenAddBaseAndUpdateAndGetObjectThanCheckUpdatedObject() %7B%0A        Base user = new User(%22Vova%22, 12, %221%22);%0A        Base role = new Role(%222%22);%0A        Base userToUpdate = new User(%22Ivan%22, 22, %221%22);%0A%0A        MajorStore majorStore = new MajorStore(2);%0A%0A        majorStore.add(user);%0A        majorStore.add(role);%0A%0A        majorStore.update(%221%22, userToUpdate);%0A%0A        assertThat(majorStore.get(%221%22), is(userToUpdate));%0A    %7D%0A%0A    /**%0A     * whenAddBaseAndDeleteObjectThanCheckBaseObject() method created to test.%0A     * %7B@link MajorStore#delete(String)%7D )%7D method.%0A     */%0A%0A    @Test%0A    public void whenAddBaseAndDeleteObjectThanCheckBaseObject() %7B%0A        Throwable e = null;%0A        User user = new User(%22Vova%22, 12, %221%22);%0A        User user2 = new User(%22Tom%22, 12, %222%22);%0A%0A        SimpleArray%3CBase%3E simpleArray = new SimpleArray%3C%3E(2);%0A        UserStore userStore = new UserStore(simpleArray);%0A%0A        try %7B%0A            userStore.add(user);%0A            userStore.add(user2);%0A            userStore.delete(%224%22);%0A        %7D catch (Throwable exp) %7B%0A            e = exp;%0A        %7D%0A%0A        assertTrue(e instanceof NoSuchElementException);%0A%0A    %7D%0A%0A    /**%0A     * whenAddBaseAndGetObjectThanCheckGetObject() method created to test.%0A     * %7B@link MajorStore#get(String)%7D )%7D method.%0A     */%0A%0A    @Test%0A    public void whenAddBaseAndGetObjectThanCheckGetObject() %7B%0A        Base user = new User(%22Vova%22, 12, %221%22);%0A        Base role = new Role(%222%22);%0A%0A        MajorStore majorStore = new MajorStore(2);%0A%0A        majorStore.add(user);%0A        majorStore.add(role);%0A%0A        assertThat(majorStore.get(%222%22), is(role));%0A        assertFalse(majorStore.get(%222%22).equals(user));%0A    %7D%0A%0A%7D

add MajorStoreTest.java