package ru.job4j.collections;

import org.junit.Test;

import java.util.*;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

/**
 * Created by admin on 12.05.2017.
 */
public class SortUserTest {
    @Test
    public void sortTest() {
        List<User2> list = new ArrayList<>(Arrays.asList(new User2("name", 23), new User2("name2", 19), new User2("name3", 29)));
        TreeSet<User2> treeSet = (TreeSet<User2>) new SortUser().sort(list);
        Iterator<User2> iterator = treeSet.iterator();
        User2 user = iterator.next();
        iterator.next();
        User2 user2 = iterator.next();
        assertThat(user, is(new User2("name2", 19)));

        assertThat(user2, is(new User2("name3", 29)));
    }

}

@@ -649,16 +649,27 @@
 hat(user
+.toString()
 , is(new
@@ -687,16 +687,27 @@
 e2%22, 19)
+.toString()
 ));%0A%0A   
@@ -727,16 +727,27 @@
 at(user2
+.toString()
 , is(new
@@ -757,29 +757,40 @@
 er2(%22name3%22, 29)
+.toString()
 ));%0A    %7D%0A%0A%7D%0A

task 10034