// Path: app/src/main/java/com/hitherejoe/pickr/ui/activity/DetailActivity.java
// public class DetailActivity extends BaseActivity implements OnMapReadyCallback {
// 
//     @Bind(R.id.toolbar)
//     Toolbar mToolbar;
// 
//     @Bind(R.id.layout_name)
//     LinearLayout mNameLayout;
// 
//     @Bind(R.id.text_name)
//     TextView mNameText;
// 
//     @Bind(R.id.layout_address)
//     LinearLayout mAddressLayout;
// 
//     @Bind(R.id.text_address)
//     TextView mAddressText;
// 
//     @Bind(R.id.layout_phone_number)
//     LinearLayout mPhoneNumberLayout;
// 
//     @Bind(R.id.text_phone_number)
//     TextView mPhoneNumberText;
// 
//     private static final String EXTRA_POI =
//             "com.hitherejoe.pickr.ui.activity.DetailActivity.EXTRA_POI";
// 
//     private PointOfInterest mPointOfInterest;
// 
//     public static Intent getStartIntent(Context context, PointOfInterest pointOfInterest) {
//         Intent intent = new Intent(context, DetailActivity.class);
//         intent.putExtra(EXTRA_POI, pointOfInterest);
//         return intent;
//     }
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.activity_detail);
//         ButterKnife.bind(this);
//         mPointOfInterest = getIntent().getParcelableExtra(EXTRA_POI);
//         if (mPointOfInterest == null) {
//             throw new IllegalArgumentException("DetailActivity requires a Location object!");
//         }
//         ((MapFragment) getFragmentManager().findFragmentById(R.id.fragment_map)).getMapAsync(this);
//         setupToolbar();
//         setupLocationData();
//     }
// 
//     @Override
//     public void onMapReady(final GoogleMap googleMap) {
//         googleMap.setMyLocationEnabled(true);
//         googleMap.getUiSettings().setMyLocationButtonEnabled(true);
//         googleMap.getUiSettings().setMapToolbarEnabled(false);
//         LatLng latLng = mPointOfInterest.latLng;
//         if (latLng != null) {
//             googleMap.addMarker(new MarkerOptions().position(latLng)
//                     .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED)));
//             googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, 16f));
//         }
//     }
// 
//     private void setupToolbar() {
//         setSupportActionBar(mToolbar);
//         ActionBar actionBar = getSupportActionBar();
//         if (actionBar != null) {
//             actionBar.setDisplayHomeAsUpEnabled(true);
//             actionBar.setTitle(mPointOfInterest.name);
//         }
//     }
// 
//     private void setupLocationData() {
//         String placeName = mPointOfInterest.name;
//         if (placeName != null && !placeName.isEmpty()) {
//             mNameText.setText(mPointOfInterest.name);
//         } else {
//             mNameLayout.setVisibility(View.GONE);
//         }
// 
//         String placeAddress = mPointOfInterest.address;
//         if (placeAddress != null && !placeAddress.isEmpty()) {
//             mAddressText.setText(placeAddress);
//         } else {
//             mAddressLayout.setVisibility(View.GONE);
//         }
// 
//         String placePhoneNumber = mPointOfInterest.phoneNumber;
//         if (placePhoneNumber != null && !placePhoneNumber.isEmpty()) {
//             mPhoneNumberText.setText(placePhoneNumber);
//         } else {
//             mPhoneNumberLayout.setVisibility(View.GONE);
//         }
//     }
// 
// }
// 
// Path: app/src/androidTest/java/com/hitherejoe/pickr/injection/TestComponentRule.java
// public class TestComponentRule implements TestRule {
// 
//     private TestComponent mTestComponent;
// 
//     public TestDataManager getDataManager() {
//         return (TestDataManager) mTestComponent.dataManager();
//     }
// 
//     public DatabaseHelper getDatabaseHelper() {
//         return getDataManager().getDatabaseHelper();
//     }
// 
//     private void setupDaggerTestComponentInApplication() {
//         PickrApplication application = PickrApplication
//                 .get(InstrumentationRegistry.getTargetContext());
//         if (application.getComponent() instanceof TestComponent) {
//             mTestComponent = (TestComponent) application.getComponent();
//         } else {
//             mTestComponent = DaggerTestComponent.builder()
//                     .applicationTestModule(new ApplicationTestModule(application))
//                     .build();
//             application.setComponent(mTestComponent);
//         }
//     }
// 
//     @Override
//     public Statement apply(final Statement base, Description description) {
//         return new Statement() {
//             @Override
//             public void evaluate() throws Throwable {
//                 try {
//                     setupDaggerTestComponentInApplication();
//                     base.evaluate();
//                 } finally {
//                     mTestComponent = null;
//                 }
//             }
//         };
//     }
// }


import android.content.Context;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import com.hitherejoe.pickr.ui.activity.DetailActivity;
import com.hitherejoe.pickr.injection.TestComponentRule;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import static android.support.test.InstrumentationRegistry.getTargetContext;
package com.hitherejoe.pickr;






@RunWith(AndroidJUnit4.class)
public class DetailActivityTest {

    private Context mContext;

    @Rule
// Path: app/src/main/java/com/hitherejoe/pickr/ui/activity/DetailActivity.java
// public class DetailActivity extends BaseActivity implements OnMapReadyCallback {
// 
//     @Bind(R.id.toolbar)
//     Toolbar mToolbar;
// 
//     @Bind(R.id.layout_name)
//     LinearLayout mNameLayout;
// 
//     @Bind(R.id.text_name)
//     TextView mNameText;
// 
//     @Bind(R.id.layout_address)
//     LinearLayout mAddressLayout;
// 
//     @Bind(R.id.text_address)
//     TextView mAddressText;
// 
//     @Bind(R.id.layout_phone_number)
//     LinearLayout mPhoneNumberLayout;
// 
//     @Bind(R.id.text_phone_number)
//     TextView mPhoneNumberText;
// 
//     private static final String EXTRA_POI =
//             "com.hitherejoe.pickr.ui.activity.DetailActivity.EXTRA_POI";
// 
//     private PointOfInterest mPointOfInterest;
// 
//     public static Intent getStartIntent(Context context, PointOfInterest pointOfInterest) {
//         Intent intent = new Intent(context, DetailActivity.class);
//         intent.putExtra(EXTRA_POI, pointOfInterest);
//         return intent;
//     }
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.activity_detail);
//         ButterKnife.bind(this);
//         mPointOfInterest = getIntent().getParcelableExtra(EXTRA_POI);
//         if (mPointOfInterest == null) {
//             throw new IllegalArgumentException("DetailActivity requires a Location object!");
//         }
//         ((MapFragment) getFragmentManager().findFragmentById(R.id.fragment_map)).getMapAsync(this);
//         setupToolbar();
//         setupLocationData();
//     }
// 
//     @Override
//     public void onMapReady(final GoogleMap googleMap) {
//         googleMap.setMyLocationEnabled(true);
//         googleMap.getUiSettings().setMyLocationButtonEnabled(true);
//         googleMap.getUiSettings().setMapToolbarEnabled(false);
//         LatLng latLng = mPointOfInterest.latLng;
//         if (latLng != null) {
//             googleMap.addMarker(new MarkerOptions().position(latLng)
//                     .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED)));
//             googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, 16f));
//         }
//     }
// 
//     private void setupToolbar() {
//         setSupportActionBar(mToolbar);
//         ActionBar actionBar = getSupportActionBar();
//         if (actionBar != null) {
//             actionBar.setDisplayHomeAsUpEnabled(true);
//             actionBar.setTitle(mPointOfInterest.name);
//         }
//     }
// 
//     private void setupLocationData() {
//         String placeName = mPointOfInterest.name;
//         if (placeName != null && !placeName.isEmpty()) {
//             mNameText.setText(mPointOfInterest.name);
//         } else {
//             mNameLayout.setVisibility(View.GONE);
//         }
// 
//         String placeAddress = mPointOfInterest.address;
//         if (placeAddress != null && !placeAddress.isEmpty()) {
//             mAddressText.setText(placeAddress);
//         } else {
//             mAddressLayout.setVisibility(View.GONE);
//         }
// 
//         String placePhoneNumber = mPointOfInterest.phoneNumber;
//         if (placePhoneNumber != null && !placePhoneNumber.isEmpty()) {
//             mPhoneNumberText.setText(placePhoneNumber);
//         } else {
//             mPhoneNumberLayout.setVisibility(View.GONE);
//         }
//     }
// 
// }
// 
// Path: app/src/androidTest/java/com/hitherejoe/pickr/injection/TestComponentRule.java
// public class TestComponentRule implements TestRule {
// 
//     private TestComponent mTestComponent;
// 
//     public TestDataManager getDataManager() {
//         return (TestDataManager) mTestComponent.dataManager();
//     }
// 
//     public DatabaseHelper getDatabaseHelper() {
//         return getDataManager().getDatabaseHelper();
//     }
// 
//     private void setupDaggerTestComponentInApplication() {
//         PickrApplication application = PickrApplication
//                 .get(InstrumentationRegistry.getTargetContext());
//         if (application.getComponent() instanceof TestComponent) {
//             mTestComponent = (TestComponent) application.getComponent();
//         } else {
//             mTestComponent = DaggerTestComponent.builder()
//                     .applicationTestModule(new ApplicationTestModule(application))
//                     .build();
//             application.setComponent(mTestComponent);
//         }
//     }
// 
//     @Override
//     public Statement apply(final Statement base, Description description) {
//         return new Statement() {
//             @Override
//             public void evaluate() throws Throwable {
//                 try {
//                     setupDaggerTestComponentInApplication();
//                     base.evaluate();
//                 } finally {
//                     mTestComponent = null;
//                 }
//             }
//         };
//     }
// }


// Path: app/src/androidTest/java/com/hitherejoe/pickr/DetailActivityTest.java
import android.content.Context;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import com.hitherejoe.pickr.ui.activity.DetailActivity;
import com.hitherejoe.pickr.injection.TestComponentRule;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import static android.support.test.InstrumentationRegistry.getTargetContext;

package com.hitherejoe.pickr;






@RunWith(AndroidJUnit4.class)
public class DetailActivityTest {

    private Context mContext;

    @Rule
    public final ActivityTestRule<DetailActivity> main =