1e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey/*
2e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey * Copyright (C) 2009 The Android Open Source Project
3e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey *
4e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey * Licensed under the Apache License, Version 2.0 (the "License");
5e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey * you may not use this file except in compliance with the License.
6e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey * You may obtain a copy of the License at
7e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey *
8e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey *      http://www.apache.org/licenses/LICENSE-2.0
9e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey *
10e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey * Unless required by applicable law or agreed to in writing, software
11e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey * distributed under the License is distributed on an "AS IS" BASIS,
12e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey * See the License for the specific language governing permissions and
14e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey * limitations under the License.
15e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey */
16e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey
17e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkeypackage com.android.contacts;
18e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey
19e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkeyimport android.content.ContentValues;
20e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkeyimport android.content.Intent;
21e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkeyimport android.net.Uri;
22e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkeyimport android.provider.ContactsContract.CommonDataKinds.Email;
23e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkeyimport android.provider.ContactsContract.CommonDataKinds.Im;
24c710b0e7a7932288763d7e3d08a882ac188303a8Makoto Onukiimport android.provider.ContactsContract.CommonDataKinds.Phone;
25e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkeyimport android.test.AndroidTestCase;
26e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkeyimport android.test.suitebuilder.annotation.LargeTest;
27e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey
28e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey/**
29e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey * Tests for {@link ContactsUtils}.
30e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey */
31e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey@LargeTest
32e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkeypublic class ContactsUtilsTests extends AndroidTestCase {
33e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey    private static final String TEST_ADDRESS = "user@example.org";
34e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey    private static final String TEST_PROTOCOL = "prot%col";
35e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey
36e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey    public void testImIntent() throws Exception {
37e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        // Normal IM is appended as path
38e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        final ContentValues values = new ContentValues();
39e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        values.put(Im.MIMETYPE, Im.CONTENT_ITEM_TYPE);
40e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        values.put(Im.TYPE, Im.TYPE_HOME);
41e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        values.put(Im.PROTOCOL, Im.PROTOCOL_GOOGLE_TALK);
42e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        values.put(Im.DATA, TEST_ADDRESS);
43e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey
44e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        final Intent intent = ContactsUtils.buildImIntent(values);
45e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        assertEquals(Intent.ACTION_SENDTO, intent.getAction());
46e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey
47e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        final Uri data = intent.getData();
48e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        assertEquals("imto", data.getScheme());
49e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        assertEquals("gtalk", data.getAuthority());
50e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        assertEquals(TEST_ADDRESS, data.getPathSegments().get(0));
51e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey    }
52e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey
53e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey    public void testImIntentCustom() throws Exception {
54e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        // Custom IM types have encoded authority
55e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        final ContentValues values = new ContentValues();
56e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        values.put(Im.MIMETYPE, Im.CONTENT_ITEM_TYPE);
57e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        values.put(Im.TYPE, Im.TYPE_HOME);
58e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        values.put(Im.PROTOCOL, Im.PROTOCOL_CUSTOM);
59e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        values.put(Im.CUSTOM_PROTOCOL, TEST_PROTOCOL);
60e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        values.put(Im.DATA, TEST_ADDRESS);
61e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey
62e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        final Intent intent = ContactsUtils.buildImIntent(values);
63e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        assertEquals(Intent.ACTION_SENDTO, intent.getAction());
64e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey
65e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        final Uri data = intent.getData();
66e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        assertEquals("imto", data.getScheme());
67e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        assertEquals(TEST_PROTOCOL, data.getAuthority());
68e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        assertEquals(TEST_ADDRESS, data.getPathSegments().get(0));
69e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey    }
70e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey
71e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey    public void testImEmailIntent() throws Exception {
72e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        // Email addresses are treated as Google Talk entries
73e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        final ContentValues values = new ContentValues();
74e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        values.put(Email.MIMETYPE, Email.CONTENT_ITEM_TYPE);
75e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        values.put(Email.TYPE, Email.TYPE_HOME);
76e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        values.put(Email.DATA, TEST_ADDRESS);
77e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey
78e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        final Intent intent = ContactsUtils.buildImIntent(values);
79e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        assertEquals(Intent.ACTION_SENDTO, intent.getAction());
80e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey
81e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        final Uri data = intent.getData();
82e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        assertEquals("imto", data.getScheme());
83e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        assertEquals("gtalk", data.getAuthority());
84e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        assertEquals(TEST_ADDRESS, data.getPathSegments().get(0));
85e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey    }
86e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey
87e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey    public void testIsGraphicNull() throws Exception {
88e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        assertFalse(ContactsUtils.isGraphic(null));
89e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey    }
90e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey
91e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey    public void testIsGraphicEmpty() throws Exception {
92e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        assertFalse(ContactsUtils.isGraphic(""));
93e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey    }
94e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey
95e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey    public void testIsGraphicSpaces() throws Exception {
96e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        assertFalse(ContactsUtils.isGraphic("  "));
97e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey    }
98e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey
99e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey    public void testIsGraphicPunctuation() throws Exception {
100e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey        assertTrue(ContactsUtils.isGraphic("."));
101e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey    }
102c710b0e7a7932288763d7e3d08a882ac188303a8Makoto Onuki
103c710b0e7a7932288763d7e3d08a882ac188303a8Makoto Onuki    public void testAreObjectsEqual() throws Exception {
104c710b0e7a7932288763d7e3d08a882ac188303a8Makoto Onuki        assertTrue("null:null", ContactsUtils.areObjectsEqual(null, null));
105c710b0e7a7932288763d7e3d08a882ac188303a8Makoto Onuki        assertTrue("1:1", ContactsUtils.areObjectsEqual(1, 1));
106c710b0e7a7932288763d7e3d08a882ac188303a8Makoto Onuki
107c710b0e7a7932288763d7e3d08a882ac188303a8Makoto Onuki        assertFalse("null:1", ContactsUtils.areObjectsEqual(null, 1));
108c710b0e7a7932288763d7e3d08a882ac188303a8Makoto Onuki        assertFalse("1:null", ContactsUtils.areObjectsEqual(1, null));
109c710b0e7a7932288763d7e3d08a882ac188303a8Makoto Onuki        assertFalse("1:2", ContactsUtils.areObjectsEqual(1, 2));
110c710b0e7a7932288763d7e3d08a882ac188303a8Makoto Onuki    }
111c710b0e7a7932288763d7e3d08a882ac188303a8Makoto Onuki
112d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann    public void testShouldCollapse() throws Exception {
113d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann        checkShouldCollapse("1", true, null, null, null, null);
114d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann        checkShouldCollapse("2", true, "a", "b", "a", "b");
115d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann
116d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann        checkShouldCollapse("11", false, "a", null, null, null);
117d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann        checkShouldCollapse("12", false, null, "a", null, null);
118d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann        checkShouldCollapse("13", false, null, null, "a", null);
119d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann        checkShouldCollapse("14", false, null, null, null, "a");
120d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann
121d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann        checkShouldCollapse("21", false, "a", "b", null, null);
122d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann        checkShouldCollapse("22", false, "a", "b", "a", null);
123d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann        checkShouldCollapse("23", false, "a", "b", null, "b");
124d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann        checkShouldCollapse("24", false, "a", "b", "a", "x");
125d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann        checkShouldCollapse("25", false, "a", "b", "x", "b");
126d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann
127d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann        checkShouldCollapse("31", false, null, null, "a", "b");
128d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann        checkShouldCollapse("32", false, "a", null, "a", "b");
129d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann        checkShouldCollapse("33", false, null, "b", "a", "b");
130d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann        checkShouldCollapse("34", false, "a", "x", "a", "b");
131d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann        checkShouldCollapse("35", false, "x", "b", "a", "b");
132d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann
133d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann        checkShouldCollapse("41", true, Phone.CONTENT_ITEM_TYPE, null, Phone.CONTENT_ITEM_TYPE,
134c710b0e7a7932288763d7e3d08a882ac188303a8Makoto Onuki                null);
135d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann        checkShouldCollapse("42", true, Phone.CONTENT_ITEM_TYPE, "1", Phone.CONTENT_ITEM_TYPE, "1");
136c710b0e7a7932288763d7e3d08a882ac188303a8Makoto Onuki
137d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann        checkShouldCollapse("51", false, Phone.CONTENT_ITEM_TYPE, "1", Phone.CONTENT_ITEM_TYPE,
138d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann                "2");
139d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann        checkShouldCollapse("52", false, Phone.CONTENT_ITEM_TYPE, "1", Phone.CONTENT_ITEM_TYPE,
140d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann                null);
141d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann        checkShouldCollapse("53", false, Phone.CONTENT_ITEM_TYPE, null, Phone.CONTENT_ITEM_TYPE,
142d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann                "2");
143d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann
144d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann        // Test phone numbers
145d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann        checkShouldCollapse("60", true,
146d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann                Phone.CONTENT_ITEM_TYPE, "1234567",
147d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann                Phone.CONTENT_ITEM_TYPE, "1234567");
148d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann        checkShouldCollapse("61", false,
149d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann                Phone.CONTENT_ITEM_TYPE, "1234567",
150d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann                Phone.CONTENT_ITEM_TYPE, "1234568");
151d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann        checkShouldCollapse("62", true,
152d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann                Phone.CONTENT_ITEM_TYPE, "1234567;0",
153d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann                Phone.CONTENT_ITEM_TYPE, "1234567;0");
154d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann        checkShouldCollapse("63", false,
155d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann                Phone.CONTENT_ITEM_TYPE, "1234567;89321",
156d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann                Phone.CONTENT_ITEM_TYPE, "1234567;321");
157d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann        checkShouldCollapse("64", true,
158d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann                Phone.CONTENT_ITEM_TYPE, "1234567;89321",
159d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann                Phone.CONTENT_ITEM_TYPE, "1234567;89321");
160d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann        checkShouldCollapse("65", false,
161d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann                Phone.CONTENT_ITEM_TYPE, "1234567;0111111111",
162d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann                Phone.CONTENT_ITEM_TYPE, "1234567;");
163d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann        checkShouldCollapse("66", false,
164d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann                Phone.CONTENT_ITEM_TYPE, "12345675426;91970xxxxx",
165d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann                Phone.CONTENT_ITEM_TYPE, "12345675426");
166d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann        checkShouldCollapse("67", false,
167d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann                Phone.CONTENT_ITEM_TYPE, "12345675426;23456xxxxx",
168d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann                Phone.CONTENT_ITEM_TYPE, "12345675426;234567xxxx");
169d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann        checkShouldCollapse("68", true,
170d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann                Phone.CONTENT_ITEM_TYPE, "1234567;1234567;1234567",
171d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann                Phone.CONTENT_ITEM_TYPE, "1234567;1234567;1234567");
172d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann        checkShouldCollapse("69", false,
173d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann                Phone.CONTENT_ITEM_TYPE, "1234567;1234567;1234567",
174d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann                Phone.CONTENT_ITEM_TYPE, "1234567;1234567");
175c710b0e7a7932288763d7e3d08a882ac188303a8Makoto Onuki    }
176c710b0e7a7932288763d7e3d08a882ac188303a8Makoto Onuki
177d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann    private void checkShouldCollapse(String message, boolean expected, CharSequence mimetype1,
178c710b0e7a7932288763d7e3d08a882ac188303a8Makoto Onuki            CharSequence data1, CharSequence mimetype2, CharSequence data2) {
179c710b0e7a7932288763d7e3d08a882ac188303a8Makoto Onuki        assertEquals(message, expected,
180d8b0a05f88099a734b75ed6b4628660feb00445fDaniel Lehmann                ContactsUtils.shouldCollapse(mContext, mimetype1, data1, mimetype2, data2));
181c710b0e7a7932288763d7e3d08a882ac188303a8Makoto Onuki    }
182c710b0e7a7932288763d7e3d08a882ac188303a8Makoto Onuki
183c710b0e7a7932288763d7e3d08a882ac188303a8Makoto Onuki    public void testAreIntentActionEqual() throws Exception {
184c710b0e7a7932288763d7e3d08a882ac188303a8Makoto Onuki        assertTrue("1", ContactsUtils.areIntentActionEqual(null, null));
185c710b0e7a7932288763d7e3d08a882ac188303a8Makoto Onuki        assertTrue("1", ContactsUtils.areIntentActionEqual(new Intent("a"), new Intent("a")));
186c710b0e7a7932288763d7e3d08a882ac188303a8Makoto Onuki
187c710b0e7a7932288763d7e3d08a882ac188303a8Makoto Onuki        assertFalse("11", ContactsUtils.areIntentActionEqual(new Intent("a"), null));
188c710b0e7a7932288763d7e3d08a882ac188303a8Makoto Onuki        assertFalse("12", ContactsUtils.areIntentActionEqual(null, new Intent("a")));
189c710b0e7a7932288763d7e3d08a882ac188303a8Makoto Onuki
190c710b0e7a7932288763d7e3d08a882ac188303a8Makoto Onuki        assertFalse("21", ContactsUtils.areIntentActionEqual(new Intent("a"), new Intent()));
191c710b0e7a7932288763d7e3d08a882ac188303a8Makoto Onuki        assertFalse("22", ContactsUtils.areIntentActionEqual(new Intent(), new Intent("b")));
192c710b0e7a7932288763d7e3d08a882ac188303a8Makoto Onuki        assertFalse("23", ContactsUtils.areIntentActionEqual(new Intent("a"), new Intent("b")));
193c710b0e7a7932288763d7e3d08a882ac188303a8Makoto Onuki    }
194e31dac84479a4c7b356edfc062a447cdfb5efc69Jeff Sharkey}
195