I'm seeking a review of correct design practices.import java.math.BigDecimal;public class Statistician {    //instance variables    private int length;    private double sum;    private double last;    private double max;    private double min;    //choosing to use public b/c they are constants    public static final BigDecimal doubleMax = BigDecimal.valueOf(Double.MAX_VALUE);    //using -Double.Max_Value b/c Double.Min_Value will return the lowest value greater than zero.     //Since Double values are symmetrical about zero we can use the opposite of Double.Max_Value to get an accurate bound for the lower range.    public static final BigDecimal doubleMin = BigDecimal.valueOf(-Double.MAX_VALUE);    /**     * Constructor Method; Initialize a new Statistician.     *     * @param - none     * <dt><b>Postcondition:</b><dd>     * This Statistician is newly initialized and has not yet been given any     * numbers.     *     */    public Statistician() {        length = 0;        sum = 0;    }    /**     * Give a new number to this Statistician.     *     * @param <CODE>number</CODE> the new number that is being given the this     * Statistician     * <dt><b>Postcondition:</b><dd>     * The specified number has been given to this Statistician and it will be     * included in any subsequent statistics.     *     */    public void nextNumber(double number) {        length++;        sum += number;        last = number;        if (length == 1) {            max = number;            min = number;        }         else {            if (number > max) {                max = number;            }        }            if (number < min) {                min = number;        }    }    /**     * Determine how many numbers have been given to this Statistician.     *     * @param - none     * @return the count of how many numbers have been given to this     * Statistician     * <dt><b>Note:</b><dd>     * Giving a Statistician more than <CODE>Integer.MAX_VALUE</CODE> numbers,     * will cause failure with an arithmetic overflow.     *     */    public int getLength() {        // The student's code will replace this return statement: and so it came to pass        if (length > Integer.MAX_VALUE) {                throw new RuntimeException(Arthmetic Overflow Occured);            }        else {            return length;        }    }    /**     * Determine the largest number that has been given to this Statistician.     *     * @param - none     * @return the largest number that has been given to this Statistician     * <dt><b>Note:</b><dd>     * If <CODE>length()</CODE> is zero, then the answer from this method is     * <CODE>Double.NaN</CODE>.     *     */    public double getMaximum() {        // The student's code will replace this return statement: indeed        if (length == 0){            return Double.NaN;        }        else {            return max;        }    }    /**     * Determine the arithmetic average of all the numbers that have been given     * to this Statistician.     *     * @param - none     * @return the arithmetic mean of all the number that have been given to     * this Statistician     * <dt><b>Note:</b><dd>     * If this Statistician has been given more than     * <CODE>Integer.MAX_VALUE</CODE> numbers, then this method fails because of     * arithmetic overflow. If <CODE>length()</CODE> is zero, then the answer     * from this method is <CODE>Double.NaN</CODE>. If <CODE>sum()</CODE>     * exceeds the bounds of double numbers, then the answer from this method     * may be <CODE>Double.POSITIVE_INFINITY</CODE> or     * <CODE>Double.NEGATIVE_INFINITY</CODE>.     *     */    public double getMean() {        // The student's code will replace this return statement: And on the 7th day it was so        if (length == 0) {            return Double.NaN;        }         else {            if (doubleMin.compareTo(new BigDecimal(sum)) <= 0) {                return Double.NEGATIVE_INFINITY;            }            if (doubleMax.compareTo(new BigDecimal(sum)) >= 0) {                return Double.POSITIVE_INFINITY;            }            if (length > Integer.MAX_VALUE) {                throw new RuntimeException(Arthmetic Overflow Occured);            }        }        return sum / length;    }    /**     * Determine the sum of all the numbers that have been given to this     * Statistician.     *     * @param - none     * @return the sum of all the number that have been given to this     * Statistician     * <dt><b>Note:</b><dd>     * If the sum exceeds the bounds of double numbers, then the answer from     * this method may be <CODE>Double.POSITIVE_INFINITY</CODE> or     * <CODE>Double.NEGATIVE_INFINITY</CODE>.     *     */    public double getSum() {        // The student's code will replace this return statement: the prodigal sum         if (doubleMin.compareTo(new BigDecimal(sum)) <= 0) {                return Double.NEGATIVE_INFINITY;            }            if (doubleMax.compareTo(new BigDecimal(sum)) >= 0) {                return Double.POSITIVE_INFINITY;            }            else {                return sum;            }    }    /**     * Get the last number in the sequence of numbers Statistician.     *     * @param - none     * @return the last number that was placed in the sequence     *     */    public double getLastNum() {        // The student's code will replace this return statement: last but not least        return last;    }}
Checking for a double parameter using Big Decimal
java;floating point