Package aima.test.core.unit.logic.propositional.parsing

Source Code of aima.test.core.unit.logic.propositional.parsing.ListTest

package aima.test.core.unit.logic.propositional.parsing;

import java.util.ArrayList;
import java.util.List;

import org.junit.Assert;
import org.junit.Test;

import aima.core.logic.propositional.parsing.ast.Symbol;

/**
* @author Ravi Mohan
*
*/
public class ListTest {

  @Test
  public void testListOfSymbolsClone() {
    ArrayList<Symbol> l = new ArrayList<Symbol>();
    l.add(new Symbol("A"));
    l.add(new Symbol("B"));
    l.add(new Symbol("C"));
    List<Symbol> l2 = new ArrayList<Symbol>(l);
    l2.remove(new Symbol("B"));
    Assert.assertEquals(3, l.size());
    Assert.assertEquals(2, l2.size());
  }

  @Test
  public void testListRemove() {
    List<Integer> one = new ArrayList<Integer>();
    one.add(new Integer(1));
    Assert.assertEquals(1, one.size());
    one.remove(0);
    Assert.assertEquals(0, one.size());
  }
}
TOP

Related Classes of aima.test.core.unit.logic.propositional.parsing.ListTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.