Skip to content

write some tests that exercise the Collections classes

Notifications You must be signed in to change notification settings

ardcarrion/GetTestieCollections

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GetTestieCollections

write some tests that exercise the Collections classes

create a project where you write 1 or 2 tests for each every one of these Collections classes. Figure out what the most common, most useful methods are, and use them in the test you write for the class. The class should be, say, TestHashMap, and then have a TestHasMap methid which uses the various methods you deem useful.

I've included two classes, Person and Address should you need a concrete class to supply to a generic structure. Feel free to use Integer and/or String as well.

Make tests for each of these:

  • For the Set interface, HashSet is the most commonly used implementation.
  • For the List interface, ArrayList is the most commonly used implementation.
  • For the Map interface, HashMap is the most commonly used implementation.
  • For the Queue interface, LinkedList is the most commonly used implementation.
  • For the Deque interface, ArrayDeque is the most commonly used implementation.

Also include a test for Vector,TreeMap, Stack, TreeSet, Iterator, PriorityQueue and Comparable.

So 12 Test in all, make sure you use the methods that most commonly describe why the data structure exists; e.g. for Stack be sure to use pop, push, peek and isEmpty.

Note: this is really only a series of tests that you are writing. All your code should go only in the Test portion of the project.

Note: import what you need to test all the classes mentions.

You may want/need a collection of code you've written that reminds you how to use a particular class.

About

write some tests that exercise the Collections classes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages