public void testCreationAmbiguous(){
  Instances data;
  ArrayList<Attribute> atts;
  String relName;
  relName="testCreationAmbiguous";
  atts=new ArrayList<Attribute>();
  atts.add(new Attribute("att-numeric_1"));
  atts.add(new Attribute("att-numeric_1"));
  atts.add(new Attribute("att-data_1","yyyy-MM-dd HH:mm"));
  atts.add(new Attribute("att-nominal_1",new ArrayList<String>(Arrays.asList(new String[]{"1","2","3"}))));
  atts.add(new Attribute("att-nominal_1",new ArrayList<String>(Arrays.asList(new String[]{"yes","no"}))));
  atts.add(new Attribute("att-string_1",(ArrayList<String>)null));
  try {
    data=new Instances(relName,atts,0);
  }
 catch (  IllegalArgumentException e) {
    data=null;
  }
  assertNull("dataset created with ambiguous attribute names",data);
}

public void testCreationAmbiguous ( ) { Instances data ; ArrayList < Attribute > atts ; String relName ; relName = "testCreationAmbiguous" ; atts = new ArrayList < Attribute > ( ) ; atts . add ( new Attribute ( "att-numeric_1" ) ) ; atts . add ( new Attribute ( "att-numeric_1" ) ) ; atts . add ( new Attribute ( "att-data_1" , "yyyy-MM-dd HH:mm" ) ) ; atts . add ( new Attribute ( "att-nominal_1" , new ArrayList < String > ( Arrays . asList ( new String [ ] { "1" , "2" , "3" } ) ) ) ) ; atts . add ( new Attribute ( "att-nominal_1" , new ArrayList < String > ( Arrays . asList ( new String [ ] { "yes" , "no" } ) ) ) ) ; atts . add ( new Attribute ( "att-string_1" , ( ArrayList < String > ) null ) ) ; try { data = new Instances ( relName , atts , 0 ) ; } catch ( IllegalArgumentException e ) { data = null ; } assertNull ( "dataset created with ambiguous attribute names" , data ) ; }
tests the creation of a dataset ( ambiguous attribute names ) .
