@@ -0,0 +1,1915 @@
+/*%0A * Copyright (C) 2012 The Android Open Source Project%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A *%0A * Note: This file copied from the Android CTS Tests%0A */%0A%0Apackage com.example.asadkhan.sunshine.utils;%0A%0Aimport junit.framework.Assert;%0A%0Aimport java.util.concurrent.Callable;%0A%0Apublic abstract class PollingCheck %7B%0A    private static final long TIME_SLICE = 50;%0A    private long mTimeout = 3000;%0A%0A    public PollingCheck() %7B%0A    %7D%0A%0A    public PollingCheck(long timeout) %7B%0A        mTimeout = timeout;%0A    %7D%0A%0A    protected abstract boolean check();%0A%0A    public void run() %7B%0A        if (check()) %7B%0A            return;%0A        %7D%0A%0A        long timeout = mTimeout;%0A        while (timeout %3E 0) %7B%0A            try %7B%0A                Thread.sleep(TIME_SLICE);%0A            %7D catch (InterruptedException e) %7B%0A                Assert.fail(%22unexpected InterruptedException%22);%0A            %7D%0A%0A            if (check()) %7B%0A                return;%0A            %7D%0A%0A            timeout -= TIME_SLICE;%0A        %7D%0A%0A        Assert.fail(%22unexpected timeout%22);%0A    %7D%0A%0A    public static void check(CharSequence message, long timeout, Callable%3CBoolean%3E condition)%0A            throws Exception %7B%0A        while (timeout %3E 0) %7B%0A            if (condition.call()) %7B%0A                return;%0A            %7D%0A%0A            Thread.sleep(TIME_SLICE);%0A            timeout -= TIME_SLICE;%0A        %7D%0A%0A        Assert.fail(message.toString());%0A    %7D%0A%7D

Add Android Util Unit Test Classes