### Question:
RandomElementStrategy implements ElementFromListStrategy { @Override public <T> T get(List<T> list) { int index = random.nextInt(list.size()); return list.get(index); }  @Override T get(List<T> list);  }### Answer:
@Test(expected = IllegalArgumentException.class) public void empty_list_throws_exception() { this.list.clear(); this.strategy.get(this.list); }
@Test public void list_of_one_element_returns_element() { Object element = new Object(); this.list.add(element); Object result = this.strategy.get(this.list); assertSame(element, result); }
@Test public void list_of_multiple_elements_returns_one() { Object element1 = new Object(); Object element2 = new Object(); Object element3 = new Object(); this.list.add(element1); this.list.add(element2); this.list.add(element3); for(int i = 0; i < 100; i++) { Object element = this.strategy.get(this.list); assertTrue(this.list.contains(element)); } }