Question
Write unit tests for the process Method and the getMax method within this Stats class. The Stats class contains these methods: /** * Stats constructor.
Write unit tests for the process Method and the getMax method within this Stats class.
The Stats class contains these methods:
/** * Stats constructor. Creates empty Stats object. Stats maintains an ArrayList of all numbers processed by the object.
*/ Stats(){...} /**
* @param numbers should be a String with zero or more whitespace-delimited integers. (Whitespace includes spaces, newline, and tabs.) This method iterates over all integers in the string and adds their values to the arrayList that holds all of the numbers that have been processed. @throws IllegalArgumentException if @param numbers is not a *whitespace-delimited list of zero or more integers (i.e., if any non-integer token exists).
*/ void process(String numbers) /**
* @return the maximum number processed in this object, or Integer. MIN_VALUE if no numbers have been processed.
*/ int getMax(){...} /**
* @return The number of integers processed by this object
*/ int getNumProcessed(){...}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started