// Path: library/src/main/java/com/philliphsu/numberpadtimepicker/INumberPadTimePicker.java
// interface Presenter {
//     void onNumberKeyClick(CharSequence numberKeyText);
//     void onAltKeyClick(CharSequence altKeyText);
//     void onBackspaceClick();
//     boolean onBackspaceLongClick();
//     boolean onOkButtonClick();
//     void onShow();
//     void onSetOkButtonCallbacks();
//     /**
//      * @param state The state to initialize the time picker with.
//      */
//     void presentState(@NonNull State state);
//     void detachView();
//     State getState();
// }
// 
// Path: library/src/main/java/com/philliphsu/numberpadtimepicker/ButtonTextModel.java
// static String text(int digit) {
//     return NUMBERS_TEXTS[digit];
// }


import com.philliphsu.numberpadtimepicker.INumberPadTimePicker.Presenter;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import java.util.Arrays;
import java.util.List;
import static com.philliphsu.numberpadtimepicker.ButtonTextModel.text;
import static org.mockito.Matchers.anyBoolean;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
    @Test
    public void mode12Hr_VerifyOnTimeSetCallback() {
        for (int time = 100; time <= 1259; time++) {
            if (time % 100 > 59) {
                System.out.println("Skipping invalid time " + time);
                continue;
            }
            System.out.println("Testing time " + time);
            for (int amOrPm = 0; amOrPm < 2; amOrPm++) {
                createNewViewAndPresenter(MODE_12HR);
                if (time <= 959) {
                    inputThreeDigitTime(time, MODE_12HR);
                } else {
                    inputFourDigitTime(time, MODE_12HR);
                }
                mPresenters[MODE_12HR].onAltKeyClick(altText(amOrPm, MODE_12HR));
                final int hour = (time >= 1200 ? 0 : time / 100) + (amOrPm == 1 ? 12 : 0);
                final int minute = time % 100;
                confirmTimeSelection(mPresenters[MODE_12HR], MODE_12HR, hour, minute);
            }
        }
    }

    @Test
    public void mode12Hr_VerifyOnTimeSetCallback_UsingAltButtons() {
        for (int hour = 1; hour <= 12; hour++) {
            System.out.println("Testing time " + String.format("%d:00", hour));
            for (int amOrPm = 0; amOrPm < 2; amOrPm++) {
                createNewViewAndPresenter(MODE_12HR);
                if (hour <= 9) {
// Path: library/src/main/java/com/philliphsu/numberpadtimepicker/INumberPadTimePicker.java
// interface Presenter {
//     void onNumberKeyClick(CharSequence numberKeyText);
//     void onAltKeyClick(CharSequence altKeyText);
//     void onBackspaceClick();
//     boolean onBackspaceLongClick();
//     boolean onOkButtonClick();
//     void onShow();
//     void onSetOkButtonCallbacks();
//     /**
//      * @param state The state to initialize the time picker with.
//      */
//     void presentState(@NonNull State state);
//     void detachView();
//     State getState();
// }
// 
// Path: library/src/main/java/com/philliphsu/numberpadtimepicker/ButtonTextModel.java
// static String text(int digit) {
//     return NUMBERS_TEXTS[digit];
// }


// Path: library/src/test/java/com/philliphsu/numberpadtimepicker/NumberPadTimePickerPresenterTest.java
import com.philliphsu.numberpadtimepicker.INumberPadTimePicker.Presenter;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import java.util.Arrays;
import java.util.List;
import static com.philliphsu.numberpadtimepicker.ButtonTextModel.text;
import static org.mockito.Matchers.anyBoolean;
import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

    @Test
    public void mode12Hr_VerifyOnTimeSetCallback() {
        for (int time = 100; time <= 1259; time++) {
            if (time % 100 > 59) {
                System.out.println("Skipping invalid time " + time);
                continue;
            }
            System.out.println("Testing time " + time);
            for (int amOrPm = 0; amOrPm < 2; amOrPm++) {
                createNewViewAndPresenter(MODE_12HR);
                if (time <= 959) {
                    inputThreeDigitTime(time, MODE_12HR);
                } else {
                    inputFourDigitTime(time, MODE_12HR);
                }
                mPresenters[MODE_12HR].onAltKeyClick(altText(amOrPm, MODE_12HR));
                final int hour = (time >= 1200 ? 0 : time / 100) + (amOrPm == 1 ? 12 : 0);
                final int minute = time % 100;
                confirmTimeSelection(mPresenters[MODE_12HR], MODE_12HR, hour, minute);
            }
        }
    }

    @Test
    public void mode12Hr_VerifyOnTimeSetCallback_UsingAltButtons() {
        for (int hour = 1; hour <= 12; hour++) {
            System.out.println("Testing time " + String.format("%d:00", hour));
            for (int amOrPm = 0; amOrPm < 2; amOrPm++) {
                createNewViewAndPresenter(MODE_12HR);
                if (hour <= 9) {
                    mPresenters[MODE_12HR].onNumberKeyClick(text(hour));