package ru.napadovskiuB;

import org.junit.Test;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;

/**
 *
 */
public class SimpleMapTest {

    /**
     *
     */
    @Test
    public void whenInsertThenReturnValue() {
        SimpleMap<Integer, String> myMap = new SimpleMap<>();

        myMap.insert(5, "Пятый");
        myMap.insert(4, "Четвертый");
        myMap.insert(2, "Второй");

        String checkValue = myMap.get(4);

        assertThat(checkValue, is("Четвертый"));

    }


    /**
     *
     */
    @Test (expected = NullPointerException.class)
    public void whenDeleteItemThenReturnNull() {
        SimpleMap<Integer, String> myMap = new SimpleMap<>();

        myMap.insert(5, "Пятый");
        myMap.insert(4, "Четвертый");
        myMap.insert(2, "Второй");


        myMap.delete(4);
        String checkValue = myMap.get(4);

    }

}
package ru.napadovskiuB;

import org.junit.Test;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;

/**
 *
 */
public class SimpleMapTest {

    /**
     *
     */
    @Test
    public void whenInsertThenReturnValue() {
        SimpleMap<Integer, String> myMap = new SimpleMap<>();
        final Integer fifthElem = 5;
        final Integer fourthElem = 4;
        final Integer secondElem = 2;

        myMap.insert(fifthElem, "Пятый");
        myMap.insert(fourthElem, "Четвертый");
        myMap.insert(secondElem, "Второй");

        String checkValue = myMap.get(fourthElem);

        assertThat(checkValue, is("Четвертый"));

    }


    /**
     *
     */
    @Test (expected = NullPointerException.class)
    public void whenDeleteItemThenReturnNull() {
        SimpleMap<Integer, String> myMap = new SimpleMap<>();
        final Integer fifthElem = 5;
        final Integer fourthElem = 4;
        final Integer secondElem = 2;


        myMap.insert(fifthElem, "Пятый");
        myMap.insert(fourthElem, "Четвертый");
        myMap.insert(secondElem, "Второй");


        myMap.delete(fourthElem);
        String checkValue = myMap.get(fourthElem);

    }

}
fix some checkStyle problem