// ***********************************************************************
//
// Test1 -- An example test : Tests get() value in set
//
// ***********************************************************************
// Computer Science 102: Data Structures
// New York University, Fall 2013,
//
// Lecturers: Eric Koskinen and Daniel Schwartz-Narbonne
//
// ***********************************************************************

public class Test2 extends TestHarness {

    public Test2(String s) { super(s); }

    public boolean test() { 
	Map<Integer, Integer> m = new HashTable<Integer,Integer>
	    (100, new GenericHasher<Integer>());

	try {
	    m.put(1, 1);
	    Integer test1 = m.get(1);
	    Integer test2 = m.get(2);
	    m.put(1, 2);
	    Integer test3 = m.get(1);
	    
	    if(test1!=1 || test2!=null || test3!=2){
	    	return false;
	    }
	    return true;
	}  catch (Exception e){
		//if we catch an Exception, threw incorrect exception
		return false;
	}
    }
}
