// Path: app/src/androidTest/java/com/jachness/blockcalls/AndroidTest.java
// public abstract class AndroidTest {
//     private Context targetContext;
//     private AllComponentTest component;
//     private AppPreferences appPreferences;
//     private Context context;
// 
//     protected void setUp() throws Exception {
//         targetContext = InstrumentationRegistry.getTargetContext();
//         context = InstrumentationRegistry.getContext();
//         component = DaggerAllComponentTest.builder().blockModule(new BlockModule(targetContext))
//                 .appModule(new AppModule(targetContext))
//                 .dAOModule(new DAOModule(targetContext)).build();
//         appPreferences = new AppPreferences(targetContext);
//     }
// 
//     protected Context getTargetContext() {
//         return targetContext;
//     }
// 
//     protected AllComponentTest getComponent() {
//         return component;
//     }
// 
//     protected AppPreferences getAppPreferences() {
//         return appPreferences;
//     }
// 
//     public Context getContext() {
//         return context;
//     }
// }
// 
// Path: app/src/main/java/com/jachness/blockcalls/entities/BlackListNumberEntity.java
// public class BlackListNumberEntity {
//     private Long uid;
//     private String normalizedNumber = "";
//     private String displayNumber = "";
//     private String displayName = "";
//     private boolean beginWith = false;
//     private boolean enabled = true;
// 
//     public BlackListNumberEntity() {
//     }
// 
//     public BlackListNumberEntity(Cursor cur) {
//         for (String colName : cur.getColumnNames()) {
//             int colIndex = cur.getColumnIndex(colName);
// 
//             switch (colName) {
//                 case BlackListTable.NORMALIZED_NUMBER:
//                     this.normalizedNumber = (cur.getString(colIndex));
//                     continue;
//                 case BlackListTable.DISPLAY_NUMBER:
//                     this.displayNumber = (cur.getString(colIndex));
//                     continue;
//                 case BlackListTable.BEGIN_WITH:
//                     this.beginWith = (cur.getInt(colIndex) != 0);
//                     continue;
//                 case BlackListTable.ENABLED:
//                     this.enabled = (cur.getInt(colIndex) != 0);
//                     continue;
//                 case BlackListTable.UID:
//                     this.uid = cur.getLong(colIndex);
//                     continue;
//                 case BlackListTable.DISPLAY_NAME:
//                     this.displayName = cur.getString(colIndex);
//             }
//         }
//     }
// 
//     public boolean isBeginWith() {
//         return beginWith;
//     }
// 
//     public void setBeginWith(boolean beginWith) {
//         this.beginWith = beginWith;
//     }
// 
//     public String getNormalizedNumber() {
//         return normalizedNumber;
//     }
// 
//     public void setNormalizedNumber(String normalizedNumber) {
//         this.normalizedNumber = normalizedNumber;
//     }
// 
//     public String getDisplayNumber() {
//         return displayNumber;
//     }
// 
//     public void setDisplayNumber(String displayNumber) {
//         this.displayNumber = displayNumber;
//     }
// 
//     @SuppressWarnings("unused")
//     public Long getUid() {
//         return uid;
//     }
// 
//     @SuppressWarnings("unused")
//     public void setUid(Long uid) {
//         this.uid = uid;
//     }
// 
//     public boolean isEnabled() {
//         return enabled;
//     }
// 
//     public void setEnabled(boolean enabled) {
//         this.enabled = enabled;
//     }
// 
// 
//     public String getDisplayName() {
//         return displayName;
//     }
// 
//     public void setDisplayName(String displayName) {
//         this.displayName = displayName;
//     }
// 
//     public void toContentValues(@NonNull ContentValues contentValue) {
//         if (uid != null) contentValue.put(BlackListTable.UID, uid);
//         contentValue.put(BlackListTable.BEGIN_WITH, beginWith ? "1" : "0");
//         contentValue.put(BlackListTable.ENABLED, enabled ? "1" : "0");
//         contentValue.put(BlackListTable.DISPLAY_NUMBER, displayNumber);
//         contentValue.put(BlackListTable.DISPLAY_NAME, displayName);
//         contentValue.put(BlackListTable.NORMALIZED_NUMBER, normalizedNumber);
//     }
// 
//     public Uri getUniqueUri() {
//         if (uid == null) {
//             throw new IllegalStateException("uid is null");
//         }
//         return ContentUris.withAppendedId(BlackListTable.CONTENT_URI, uid);
//     }
// 
//     @Override
//     public String toString() {
//         return "BlackListNumberEntity{" +
//                 "beginWith=" + beginWith +
//                 ", uid=" + uid +
//                 ", normalizedNumber='" + normalizedNumber + '\'' +
//                 ", displayNumber='" + displayNumber + '\'' +
//                 ", displayName='" + displayName + '\'' +
//                 ", enabled=" + enabled +
//                 '}';
//     }
// }
// 
// Path: app/src/main/java/com/jachness/blockcalls/exceptions/PhoneNumberException.java
// public class PhoneNumberException extends Exception {
// 
//     public PhoneNumberException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }
// 
// Path: app/src/main/java/com/jachness/blockcalls/exceptions/TooShortNumberException.java
// public class TooShortNumberException extends Exception {
//     public static final int MINIMUM_LENGTH = 3;
// 
//     public TooShortNumberException(String message) {
//         super(message);
//     }
// }


import android.annotation.SuppressLint;
import android.preference.PreferenceManager;
import android.support.test.runner.AndroidJUnit4;
import android.util.Log;
import com.jachness.blockcalls.AndroidTest;
import com.jachness.blockcalls.entities.BlackListNumberEntity;
import com.jachness.blockcalls.exceptions.PhoneNumberException;
import com.jachness.blockcalls.exceptions.TooShortNumberException;
import junit.framework.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import javax.inject.Inject;
package com.jachness.blockcalls.services;






/**
 * Created by jachness on 12/11/2016.
 */
@SuppressWarnings({"TryWithIdenticalCatches", "ConstantConditions"})
@RunWith(AndroidJUnit4.class)
// Path: app/src/androidTest/java/com/jachness/blockcalls/AndroidTest.java
// public abstract class AndroidTest {
//     private Context targetContext;
//     private AllComponentTest component;
//     private AppPreferences appPreferences;
//     private Context context;
// 
//     protected void setUp() throws Exception {
//         targetContext = InstrumentationRegistry.getTargetContext();
//         context = InstrumentationRegistry.getContext();
//         component = DaggerAllComponentTest.builder().blockModule(new BlockModule(targetContext))
//                 .appModule(new AppModule(targetContext))
//                 .dAOModule(new DAOModule(targetContext)).build();
//         appPreferences = new AppPreferences(targetContext);
//     }
// 
//     protected Context getTargetContext() {
//         return targetContext;
//     }
// 
//     protected AllComponentTest getComponent() {
//         return component;
//     }
// 
//     protected AppPreferences getAppPreferences() {
//         return appPreferences;
//     }
// 
//     public Context getContext() {
//         return context;
//     }
// }
// 
// Path: app/src/main/java/com/jachness/blockcalls/entities/BlackListNumberEntity.java
// public class BlackListNumberEntity {
//     private Long uid;
//     private String normalizedNumber = "";
//     private String displayNumber = "";
//     private String displayName = "";
//     private boolean beginWith = false;
//     private boolean enabled = true;
// 
//     public BlackListNumberEntity() {
//     }
// 
//     public BlackListNumberEntity(Cursor cur) {
//         for (String colName : cur.getColumnNames()) {
//             int colIndex = cur.getColumnIndex(colName);
// 
//             switch (colName) {
//                 case BlackListTable.NORMALIZED_NUMBER:
//                     this.normalizedNumber = (cur.getString(colIndex));
//                     continue;
//                 case BlackListTable.DISPLAY_NUMBER:
//                     this.displayNumber = (cur.getString(colIndex));
//                     continue;
//                 case BlackListTable.BEGIN_WITH:
//                     this.beginWith = (cur.getInt(colIndex) != 0);
//                     continue;
//                 case BlackListTable.ENABLED:
//                     this.enabled = (cur.getInt(colIndex) != 0);
//                     continue;
//                 case BlackListTable.UID:
//                     this.uid = cur.getLong(colIndex);
//                     continue;
//                 case BlackListTable.DISPLAY_NAME:
//                     this.displayName = cur.getString(colIndex);
//             }
//         }
//     }
// 
//     public boolean isBeginWith() {
//         return beginWith;
//     }
// 
//     public void setBeginWith(boolean beginWith) {
//         this.beginWith = beginWith;
//     }
// 
//     public String getNormalizedNumber() {
//         return normalizedNumber;
//     }
// 
//     public void setNormalizedNumber(String normalizedNumber) {
//         this.normalizedNumber = normalizedNumber;
//     }
// 
//     public String getDisplayNumber() {
//         return displayNumber;
//     }
// 
//     public void setDisplayNumber(String displayNumber) {
//         this.displayNumber = displayNumber;
//     }
// 
//     @SuppressWarnings("unused")
//     public Long getUid() {
//         return uid;
//     }
// 
//     @SuppressWarnings("unused")
//     public void setUid(Long uid) {
//         this.uid = uid;
//     }
// 
//     public boolean isEnabled() {
//         return enabled;
//     }
// 
//     public void setEnabled(boolean enabled) {
//         this.enabled = enabled;
//     }
// 
// 
//     public String getDisplayName() {
//         return displayName;
//     }
// 
//     public void setDisplayName(String displayName) {
//         this.displayName = displayName;
//     }
// 
//     public void toContentValues(@NonNull ContentValues contentValue) {
//         if (uid != null) contentValue.put(BlackListTable.UID, uid);
//         contentValue.put(BlackListTable.BEGIN_WITH, beginWith ? "1" : "0");
//         contentValue.put(BlackListTable.ENABLED, enabled ? "1" : "0");
//         contentValue.put(BlackListTable.DISPLAY_NUMBER, displayNumber);
//         contentValue.put(BlackListTable.DISPLAY_NAME, displayName);
//         contentValue.put(BlackListTable.NORMALIZED_NUMBER, normalizedNumber);
//     }
// 
//     public Uri getUniqueUri() {
//         if (uid == null) {
//             throw new IllegalStateException("uid is null");
//         }
//         return ContentUris.withAppendedId(BlackListTable.CONTENT_URI, uid);
//     }
// 
//     @Override
//     public String toString() {
//         return "BlackListNumberEntity{" +
//                 "beginWith=" + beginWith +
//                 ", uid=" + uid +
//                 ", normalizedNumber='" + normalizedNumber + '\'' +
//                 ", displayNumber='" + displayNumber + '\'' +
//                 ", displayName='" + displayName + '\'' +
//                 ", enabled=" + enabled +
//                 '}';
//     }
// }
// 
// Path: app/src/main/java/com/jachness/blockcalls/exceptions/PhoneNumberException.java
// public class PhoneNumberException extends Exception {
// 
//     public PhoneNumberException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }
// 
// Path: app/src/main/java/com/jachness/blockcalls/exceptions/TooShortNumberException.java
// public class TooShortNumberException extends Exception {
//     public static final int MINIMUM_LENGTH = 3;
// 
//     public TooShortNumberException(String message) {
//         super(message);
//     }
// }


// Path: app/src/androidTest/java/com/jachness/blockcalls/services/MatcherServiceTest.java
import android.annotation.SuppressLint;
import android.preference.PreferenceManager;
import android.support.test.runner.AndroidJUnit4;
import android.util.Log;
import com.jachness.blockcalls.AndroidTest;
import com.jachness.blockcalls.entities.BlackListNumberEntity;
import com.jachness.blockcalls.exceptions.PhoneNumberException;
import com.jachness.blockcalls.exceptions.TooShortNumberException;
import junit.framework.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import javax.inject.Inject;

package com.jachness.blockcalls.services;






/**
 * Created by jachness on 12/11/2016.
 */
@SuppressWarnings({"TryWithIdenticalCatches", "ConstantConditions"})
@RunWith(AndroidJUnit4.class)
public final class MatcherServiceTest extends AndroidTest {