@@ -0,0 +1,3291 @@
+package com.basgeekball.awesomevalidation.validators;%0A%0Aimport android.content.Context;%0Aimport android.view.ViewGroup;%0Aimport android.widget.EditText;%0Aimport android.widget.LinearLayout;%0Aimport android.widget.TextView;%0A%0Aimport com.basgeekball.awesomevalidation.ValidationHolder;%0Aimport com.basgeekball.awesomevalidation.utility.ViewsInfo;%0A%0Aimport junit.framework.TestCase;%0A%0Aimport org.junit.runner.RunWith;%0Aimport org.powermock.api.mockito.PowerMockito;%0Aimport org.powermock.api.support.membermodification.MemberModifier;%0Aimport org.powermock.core.classloader.annotations.PrepareForTest;%0Aimport org.powermock.modules.junit4.PowerMockRunner;%0Aimport org.powermock.reflect.Whitebox;%0A%0Aimport java.util.ArrayList;%0A%0Aimport static com.basgeekball.awesomevalidation.validators.MockValidationHolderHelper.ValidationHolderType.REGEX;%0Aimport static com.basgeekball.awesomevalidation.validators.MockValidationHolderHelper.generate;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.times;%0Aimport static org.mockito.Mockito.verify;%0Aimport static org.mockito.Mockito.when;%0A%0A@RunWith(PowerMockRunner.class)%0A@PrepareForTest(%7BUnderlabelValidator.class, MockValidationHolderHelper.class%7D)%0Apublic class UnderlabelValidatorTest extends TestCase %7B%0A%0A    private UnderlabelValidator mUnderlabelValidator;%0A    private Context mMockedContext = mock(Context.class);%0A%0A    @Override%0A    protected void setUp() throws Exception %7B%0A        super.setUp();%0A        mUnderlabelValidator = new UnderlabelValidator();%0A        mUnderlabelValidator.setContext(mMockedContext);%0A    %7D%0A%0A    public void testReplaceView() throws Exception %7B%0A        UnderlabelValidator spiedUnderlabelValidator = PowerMockito.spy(new UnderlabelValidator());%0A        ArrayList%3CViewsInfo%3E mockedViewsInfos = mock(ArrayList.class);%0A        MemberModifier.field(UnderlabelValidator.class, %22mContext%22).set(spiedUnderlabelValidator, mMockedContext);%0A        MemberModifier.field(UnderlabelValidator.class, %22mViewsInfos%22).set(spiedUnderlabelValidator, mockedViewsInfos);%0A        ValidationHolder mockedValidationHolder = generate(REGEX, false);%0A        EditText mockedEditText = mock(EditText.class);%0A        ViewGroup mockedParent = mock(ViewGroup.class);%0A        LinearLayout mockedContainer = mock(LinearLayout.class);%0A        int index = 128;%0A        ViewsInfo mockedViewsInfo = mock(ViewsInfo.class);%0A        when(mockedValidationHolder.getEditText()).thenReturn(mockedEditText);%0A        when(mockedEditText.getParent()).thenReturn(mockedParent);%0A        when(mockedParent.indexOfChild(mockedEditText)).thenReturn(index);%0A        PowerMockito.whenNew(LinearLayout.class).withArguments(mMockedContext).thenReturn(mockedContainer);%0A        PowerMockito.whenNew(ViewsInfo.class).withArguments(index, mockedParent, mockedContainer, mockedEditText).thenReturn(mockedViewsInfo);%0A        Whitebox.invokeMethod(spiedUnderlabelValidator, %22replaceView%22, mockedValidationHolder);%0A        verify(mockedViewsInfos, times(1)).add(mockedViewsInfo);%0A%0A        TextView mockedTextView = mock(TextView.class);%0A        PowerMockito.whenNew(TextView.class).withArguments(mMockedContext).thenReturn(mockedTextView);%0A        assertEquals(mockedTextView, Whitebox.invokeMethod(spiedUnderlabelValidator, %22replaceView%22, mockedValidationHolder));%0A    %7D%0A%0A%7D%0A

Add testReplaceView for UnderlabelValidator