// 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;
            for (int leftOrRight = 0; leftOrRight < 2; leftOrRight++) {
                final int minute = leftOrRight == 0 ? 0 : 30;
                if (hour <= 9) {
                    // These times can be inputted both as 3-digits or as 4-digits, so test both.
                    System.out.println("Testing time as 3-digits: " + String.format("%d:%02d", hour, minute));
                    createNewViewAndPresenter(MODE_24HR);
                    mPresenters[MODE_24HR].onNumberKeyClick(text(hour));
                    mPresenters[MODE_24HR].onAltKeyClick(altText(leftOrRight, MODE_24HR));
                    confirmTimeSelection(mPresenters[MODE_24HR], MODE_24HR, hour, minute);

                    System.out.println("Testing time as 4-digits: " + String.format("%02d:%02d", hour, minute));
                    createNewViewAndPresenter(MODE_24HR);
                    mPresenters[MODE_24HR].onNumberKeyClick(text(hour / 10));
                    mPresenters[MODE_24HR].onNumberKeyClick(text(hour % 10));
                    mPresenters[MODE_24HR].onAltKeyClick(altText(leftOrRight, MODE_24HR));
                    confirmTimeSelection(mPresenters[MODE_24HR], MODE_24HR, hour, minute);
                } else {
                    System.out.println("Testing time: " + String.format("%02d:%02d", hour, minute));
                    createNewViewAndPresenter(MODE_24HR);
                    mPresenters[MODE_24HR].onNumberKeyClick(text(hour / 10));
                    mPresenters[MODE_24HR].onNumberKeyClick(text(hour % 10));
                    mPresenters[MODE_24HR].onAltKeyClick(altText(leftOrRight, MODE_24HR));
                    confirmTimeSelection(mPresenters[MODE_24HR], MODE_24HR, hour, minute);
                }
            }
        }
    }

    @Test
    public void rotateDevice_savesAndRestoresInstanceState() {
// 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;

            for (int leftOrRight = 0; leftOrRight < 2; leftOrRight++) {
                final int minute = leftOrRight == 0 ? 0 : 30;
                if (hour <= 9) {
                    // These times can be inputted both as 3-digits or as 4-digits, so test both.
                    System.out.println("Testing time as 3-digits: " + String.format("%d:%02d", hour, minute));
                    createNewViewAndPresenter(MODE_24HR);
                    mPresenters[MODE_24HR].onNumberKeyClick(text(hour));
                    mPresenters[MODE_24HR].onAltKeyClick(altText(leftOrRight, MODE_24HR));
                    confirmTimeSelection(mPresenters[MODE_24HR], MODE_24HR, hour, minute);

                    System.out.println("Testing time as 4-digits: " + String.format("%02d:%02d", hour, minute));
                    createNewViewAndPresenter(MODE_24HR);
                    mPresenters[MODE_24HR].onNumberKeyClick(text(hour / 10));
                    mPresenters[MODE_24HR].onNumberKeyClick(text(hour % 10));
                    mPresenters[MODE_24HR].onAltKeyClick(altText(leftOrRight, MODE_24HR));
                    confirmTimeSelection(mPresenters[MODE_24HR], MODE_24HR, hour, minute);
                } else {
                    System.out.println("Testing time: " + String.format("%02d:%02d", hour, minute));
                    createNewViewAndPresenter(MODE_24HR);
                    mPresenters[MODE_24HR].onNumberKeyClick(text(hour / 10));
                    mPresenters[MODE_24HR].onNumberKeyClick(text(hour % 10));
                    mPresenters[MODE_24HR].onAltKeyClick(altText(leftOrRight, MODE_24HR));
                    confirmTimeSelection(mPresenters[MODE_24HR], MODE_24HR, hour, minute);
                }
            }
        }
    }

    @Test
    public void rotateDevice_savesAndRestoresInstanceState() {
        for (int mode = MODE_12HR; mode <= MODE_24HR; mode++) {