@@ -0,0 +1,1898 @@
+package by.vorokhobko.Polymorphism;%0A%0Aimport org.junit.Test;%0Aimport static org.hamcrest.core.Is.is;%0Aimport static org.junit.Assert.assertThat;%0Aimport java.io.ByteArrayOutputStream;%0Aimport java.io.PrintStream;%0A%0A/**%0A * PaintTest.%0A *%0A * Class PaintTest for testing class Paint part 005, lesson 2.%0A * @author Evgeny Vorokhobko (vorokhobko2011@yandex.ru).%0A * @since 04.04.2017.%0A * @version 1.%0A */%0Apublic class PaintTest %7B%0A    /**%0A     * Test.%0A     * The method paint figure.%0A     */%0A    @Test%0A    public void whenDrawFiguresTriangle() %7B%0A        final int h = 3;%0A        Shape triangle = new Triangle(h);%0A        Paint paint = new Paint(triangle);%0A        ByteArrayOutputStream out = new ByteArrayOutputStream();%0A        System.setOut(new PrintStream(out));%0A        paint.draw(triangle);%0A        final String result = out.toString();%0A        String outPrint = %22  %5E %22%0A                + System.getProperty(%22line.separator%22) + %22  %5E %5E %22%0A                + System.getProperty(%22line.separator%22) + %22  %5E %5E %5E %22%0A                + System.getProperty(%22line.separator%22);%0A        assertThat(result, is(outPrint));%0A    %7D%0A    /**%0A     * Test.%0A     * The method paint figure.%0A     */%0A    @Test%0A    public void whenDrawFiguresSquare() %7B%0A        final int h = 5;%0A        Shape square = new Square(h);%0A        Paint paint = new Paint(square);%0A        ByteArrayOutputStream out = new ByteArrayOutputStream();%0A        System.setOut(new PrintStream(out));%0A        paint.draw(square);%0A        final String result = out.toString();%0A        String outPrint = %22*****%22%0A                + System.getProperty(%22line.separator%22) + %22*   *%22%0A                + System.getProperty(%22line.separator%22) + %22*   *%22%0A                + System.getProperty(%22line.separator%22) + %22*   *%22%0A                + System.getProperty(%22line.separator%22) + %22*****%22%0A                + System.getProperty(%22line.separator%22);%0A        assertThat(result, is(outPrint));%0A    %7D%0A%7D

add test class Paint