class QuadraticRootFinder {

    public static ImmutableList<Complex> find(double a, double b, double c) {
        if (a == 0) {
            Preconditions.checkArgument(b != 0, "No solutions can be found for an equation of the form c = 0");
            return ImmutableList.of(new Complex(-c / b, 0));
        }

        double discriminant = Math.pow(b, 2) - 4 * a * c;

        if (discriminant < 0) {
            Complex rootOne = new Complex(-b / (2 * a), Math.sqrt(-discriminant) / (2 * a));
            Complex rootTwo = new Complex(rootOne.getReal(), -rootOne.getImaginary());
            return ImmutableList.of(rootOne, rootTwo);
        }

        Complex rootOne =  new Complex((-b + Math.sqrt(discriminant)) / (2 * a), 0d);
        Complex rootTwo =  new Complex((-b - Math.sqrt(discriminant)) / (2 * a), 0d);
        return ImmutableList.of(rootOne, rootTwo);
    }

    private  QuadraticRootFinder();

}