sdk/src/main/java/com/bugsnag/android/ThreadState.java
private Thread[] sanitiseThreads(long currentThreadId,
                                     Map<Thread, StackTraceElement[]> liveThreads) {
        Set<Thread> threadSet = liveThreads.keySet();

        // remove current thread
        for (Iterator<Thread> iterator = threadSet.iterator(); iterator.hasNext(); ) {
            Thread thread = iterator.next();
            if (thread.getId() == currentThreadId) {
                iterator.remove();
            }
        }

        Thread[] threads = threadSet.toArray(new Thread[threadSet.size()]);
        Arrays.sort(threads, new Comparator<Thread>() {
            public int compare(@NonNull Thread lhs, @NonNull Thread rhs) {
                return Long.valueOf(lhs.getId()).compareTo(rhs.getId());
            }
        });
        return threads;
    }
/**
     * Returns an array of threads excluding the current thread, sorted by thread id
     *
     * @param currentThreadId the current thread id
     * @param liveThreads     all live threads
     */
Returns an array of threads excluding the current thread, sorted by thread id
@param currentThreadId the current thread id
@param liveThreads     all live threads
Returns an array of threads excluding the current thread sorted by thread id @param currentThreadId the current thread id @param liveThreads all live threads
private Thread[] sanitiseThreads(long currentThreadId,
                                     Map<Thread, StackTraceElement[]> liveThreads) {
        Set<Thread> threadSet = liveThreads.keySet();
        for (Iterator<Thread> iterator = threadSet.iterator(); iterator.hasNext(); ) {
            Thread thread = iterator.next();
            if (thread.getId() == currentThreadId) {
                iterator.remove();
            }
        }
        Thread[] threads = threadSet.toArray(new Thread[threadSet.size()]);
        Arrays.sort(threads, new Comparator<Thread>() {
            public int compare(@NonNull Thread lhs, @NonNull Thread rhs) {
                return Long.valueOf(lhs.getId()).compareTo(rhs.getId());
            }
        });
        return threads;
    }
private Thread [ ] sanitiseThreads ( long currentThreadId , Map < Thread , StackTraceElement [ ] > liveThreads ) { Set < Thread > threadSet = liveThreads . keySet ( ) ; for ( Iterator < Thread > iterator = threadSet . iterator ( ) ; iterator . hasNext ( ) ; ) { Thread thread = iterator . next ( ) ; if ( thread . getId ( ) == currentThreadId ) { iterator . remove ( ) ; } } Thread [ ] threads = threadSet . toArray ( new Thread [ threadSet . size ( ) ] ) ; Arrays . sort ( threads , new Comparator < Thread > ( ) { public int compare ( @ NonNull Thread lhs , @ NonNull Thread rhs ) { return Long . valueOf ( lhs . getId ( ) ) . compareTo ( rhs . getId ( ) ) ; } } ) ; return threads ; }
Returns an array of threads excluding the current thread, sorted by thread id
 @param currentThreadId the current thread id
 @param liveThreads     all live threads
Returns an array of threads excluding the current thread sorted by thread id @param currentThreadId the current thread id @param liveThreads all live threads
// remove current thread