public static int antallUlikeSortert(int[] a){ 
        
        int[] array = a;
        
        erSortert(array);
        
        boolean sortert = erSortert(array);
        int forekomster=0;

        if(!sortert)
            throw new IllegalStateException("Tabellen er ikke sortert");
        if(sortert){
            if(a.length == 0){
                forekomster = 0;
            }
            if(a.length > 0){
                forekomster=1;
                for(int i = 0;i<a.length-1;i++){
                    if(a[i]!=a[i+1]){
                        forekomster++;
                    }
                }
            }
        }
        return forekomster;
    }