package com.hithomelabs.clients.module5;

import com.hithomelabs.princeton1.module5.Insertion;
import com.hithomelabs.princeton1.module5.Apple;
import com.hithomelabs.princeton1.module5.Orange;

public class InsertionClient {

    public static void main(String[] args){

        Apple[] apples = new Apple[3];
        Orange[] oranges = new Orange[3];
        Insertion<Apple> insertion = new Insertion<>();

        apples[0] = new Apple(3);
        apples[1] = new Apple(5);
        apples[2] = new Apple(4);
        insertion.sort(apples);

        //* * Sample output
        for (int i = 0; i < apples.length; i++)
            System.out.println(apples[i]);

        oranges[0] = new Orange(4);
        oranges[1] = new Orange(1);
        // * Should give runtime exception as ClassCastException is a runtime exception
        //insertion.sort(oranges);
        Insertion<Orange> selection2 = new Insertion<>();
        // * Should result in a compile time exception, as casting to Orange will fail
        //selection2.sort(apples);
    }




}
