Code example for TreeSet

Methods: addsize

0
        //given 
        Date today    = mock(Date.class);
        Date tomorrow = mock(Date.class);
 
        //when 
        Set<Date> set = new TreeSet<Date>();
        set.add(today);
        set.add(tomorrow);
 
        //then 
        assertEquals(2, set.size());
    } 
 
    @Test 
    public void shouldAllowStubbingAndVerifyingCompareTo() { 
        //given 
        Date mock    = mock(Date.class);
        when(mock.compareTo(any(Date.class))).thenReturn(10);
 
        //when