@@ -0,0 +1,1365 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public%0A * License, v. 2.0. If a copy of the MPL was not distributed with this%0A * file, You can obtain one at http://mozilla.org/MPL/2.0/. */%0A%0Apackage org.mozilla.util;%0A%0Aimport android.support.annotation.CheckResult;%0Aimport android.support.annotation.NonNull;%0Aimport android.support.annotation.Nullable;%0A%0A/**%0A * Utility functions for %7B@link Throwable%7D.%0A */%0Apublic class ThrowableUtils %7B%0A    private ThrowableUtils() %7B%7D%0A%0A    /**%0A     * Returns the Throwable at the bottom of the %7B@link Throwable#getCause()%7D chain. If the first %7B@code getCause%7D%0A     * returns null, returns the parameter throwable.%0A     *%0A     * @param throwableToGetRootCauseOf The Throwable to find the root cause of.%0A     * @return The Throwable at the bottom of the %7B@code getCause%7D chain, or the parameter if the first getCause is null.%0A     */%0A    @CheckResult%0A    public static Throwable getRootCause(@NonNull final Throwable throwableToGetRootCauseOf) %7B%0A        Throwable bottommostCause = throwableToGetRootCauseOf.getCause();%0A        if (bottommostCause == null) %7B return throwableToGetRootCauseOf; %7D%0A%0A        Throwable nonNullCause;%0A        do %7B%0A            nonNullCause = bottommostCause;%0A            bottommostCause = nonNullCause.getCause();%0A        %7D while (bottommostCause != null);%0A        return nonNullCause;%0A    %7D%0A%7D%0A

Add ThrowableUtils.