@Test
public void deviceCanHandleIntent_whenActivityCanResolveIntent_shouldReturnTrue() throws Exception {

    Context context = mock(Context.class);
    PackageManager packageManager = mock(PackageManager.class);
    List<ResolveInfo> resolveInfos = new ArrayList<ResolveInfo>();
    resolveInfos.add(new ResolveInfo());
    stub(context.getPackageManager()).toReturn(packageManager);
    Intent specificIntent = new Intent();
    specificIntent.setData(Uri.parse("specificIntent:"));
    stub(packageManager.queryIntentActivities(eq(specificIntent), eq(0))).toReturn(resolveInfos);
    assertThat(IntentUtils.deviceCanHandleIntent(context, specificIntent)).isTrue();
}