### Question:
ListDataType extends CollectionDataType { @Override public ListDataValue make() { return new ListDataValue(this); } ListDataType(DataType inner_type, AnyType any); static final String build_list_name(DataType inner); static ListDataType list_of(DataType inner, PrimitiveScope pscope); @Override ListDataValue make(); @Override boolean is_abstract();  }### Answer:
@Test public void add_wrong_types() throws Exception { try { m_list.add(m_scope.bool().make(true)); fail(); } catch (IllegalArgumentException e) { } try { m_list.add(m_vsuper); fail(); } catch (IllegalArgumentException e) { } }
@Test public void add_remove_check_invalid_parameters() throws Exception { try { m_list.add(null); fail(); } catch (IllegalArgumentException e) { } try { m_list.add(m_scope.bool().make(true)); fail(); } catch (IllegalArgumentException e) { } try { m_list.remove(-1); fail(); } catch (IllegalArgumentException e) { } try { m_list.remove(1); fail(); } catch (IllegalArgumentException e) { } try { m_list.get(-1); fail(); } catch (IllegalArgumentException e) { } try { m_list.get(0); fail(); } catch (IllegalArgumentException e) { } try { m_list.contains(null); fail(); } catch (IllegalArgumentException e) { } try { m_list.contains(m_scope.bool().make(true)); fail(); } catch (IllegalArgumentException e) { } try { m_list.index_of(null); fail(); } catch (IllegalArgumentException e) { } try { m_list.index_of(m_scope.bool().make(true)); fail(); } catch (IllegalArgumentException e) { } }
@Test public void list_comparison() throws Exception { ListDataValue v = m_list_type.make(); assertTrue(v.equals(m_list)); assertTrue(v.hashCode() == m_list.hashCode()); ListDataValue sup_v = new ListDataType(m_super_type, m_scope.any()).make(); assertFalse(sup_v.equals(m_list)); assertTrue(m_list.add(m_v1)); assertFalse(v.equals(m_list)); assertFalse(v.hashCode() == m_list.hashCode()); assertTrue(m_list.add(m_v2)); assertTrue(v.add(m_v2)); assertFalse(v.equals(m_list)); assertFalse(v.hashCode() == m_list.hashCode()); assertTrue(v.add(m_v1)); assertFalse(v.equals(m_list)); assertFalse(v.hashCode() == m_list.hashCode()); v.remove(0); v.remove(0); assertTrue(v.add(m_v1)); assertTrue(v.add(m_v2)); assertTrue(v.equals(m_list)); assertTrue(v.hashCode() == m_list.hashCode()); assertFalse(m_list.equals((Object) null)); assertFalse(m_list.equals(3)); assertTrue(m_list.equals(m_list)); }