public static void sort(final List<Artifact> targets) {
        int n = targets.size();
        while(n != 0){
            int newn = 0;

            for(int i = 1 ; i <= n-1 ; i++){
                if (targets.get(i-1).toString().compareTo(targets.get(i).toString()) > 0){
                    Collections.swap(targets, i - 1, i);
                    newn = i;
                }
            }

            n = newn;
        }
    }
public static void sort ( final List < Artifact > targets ) { int n = targets . size ( ) ; while ( n != 0 ) { int newn = 0 ; for ( int i = 1 ; i <= n - 1 ; i ++ ) { if ( targets . get ( i - 1 ) . toString ( ) . compareTo ( targets . get ( i ) . toString ( ) ) > 0 ) { Collections . swap ( targets , i - 1 , i ) ; newn = i ; } } n = newn ; } }
Bubble sort

@param targets