OSDN Git Service

Introduce ContentValuesBuilder and make tests easier to read.
authorDaisuke Miyakawa <dmiyakawa@google.com>
Tue, 3 Nov 2009 23:15:55 +0000 (08:15 +0900)
committerDaisuke Miyakawa <dmiyakawa@google.com>
Tue, 3 Nov 2009 23:35:41 +0000 (08:35 +0900)
Internal Issue number: 2195990

tests/AndroidTests/src/com/android/unit_tests/vcard/VCardExporterTests.java
tests/AndroidTests/src/com/android/unit_tests/vcard/VCardImporterTests.java
tests/AndroidTests/src/com/android/unit_tests/vcard/VCardTestsBase.java

index e6a7a51..b2cc008 100644 (file)
@@ -63,14 +63,14 @@ public class VCardExporterTests extends VCardTestsBase {
 
     public void testSimpleV21() {
         ExportTestResolver resolver = new ExportTestResolver();
-        ContentValues contentValues = resolver.buildData(StructuredName.CONTENT_ITEM_TYPE);
-        contentValues.put(StructuredName.FAMILY_NAME, "Ando");
-        contentValues.put(StructuredName.GIVEN_NAME, "Roid");
+        resolver.buildInput(StructuredName.CONTENT_ITEM_TYPE)
+                .put(StructuredName.FAMILY_NAME, "Ando")
+                .put(StructuredName.GIVEN_NAME, "Roid");
 
         VCardVerificationHandler handler = new VCardVerificationHandler(this, V21);
-        handler.addNewVerifier()
-            .addNodeWithoutOrder("FN", "Roid Ando")
-            .addNodeWithoutOrder("N", "Ando;Roid;;;", Arrays.asList("Ando", "Roid", "", "", ""));
+        handler.addPropertyNodesVerifier()
+                .addNodeWithoutOrder("FN", "Roid Ando")
+                .addNodeWithoutOrder("N", "Ando;Roid;;;", Arrays.asList("Ando", "Roid", "", "", ""));
 
         verifyOneComposition(resolver, handler, V21);
     }
@@ -79,29 +79,29 @@ public class VCardExporterTests extends VCardTestsBase {
         final boolean isV30 = (version == V30);
         ExportTestResolver resolver = new ExportTestResolver();
 
-        ContentValues contentValues = resolver.buildData(StructuredName.CONTENT_ITEM_TYPE);
-        contentValues.put(StructuredName.FAMILY_NAME, "AppropriateFamilyName");
-        contentValues.put(StructuredName.GIVEN_NAME, "AppropriateGivenName");
-        contentValues.put(StructuredName.MIDDLE_NAME, "AppropriateMiddleName");
-        contentValues.put(StructuredName.PREFIX, "AppropriatePrefix");
-        contentValues.put(StructuredName.SUFFIX, "AppropriateSuffix");
-        contentValues.put(StructuredName.PHONETIC_FAMILY_NAME, "AppropriatePhoneticFamily");
-        contentValues.put(StructuredName.PHONETIC_GIVEN_NAME, "AppropriatePhoneticGiven");
-        contentValues.put(StructuredName.PHONETIC_MIDDLE_NAME, "AppropriatePhoneticMiddle");
+        resolver.buildInput(StructuredName.CONTENT_ITEM_TYPE)
+                .put(StructuredName.FAMILY_NAME, "AppropriateFamilyName")
+                .put(StructuredName.GIVEN_NAME, "AppropriateGivenName")
+                .put(StructuredName.MIDDLE_NAME, "AppropriateMiddleName")
+                .put(StructuredName.PREFIX, "AppropriatePrefix")
+                .put(StructuredName.SUFFIX, "AppropriateSuffix")
+                .put(StructuredName.PHONETIC_FAMILY_NAME, "AppropriatePhoneticFamily")
+                .put(StructuredName.PHONETIC_GIVEN_NAME, "AppropriatePhoneticGiven")
+                .put(StructuredName.PHONETIC_MIDDLE_NAME, "AppropriatePhoneticMiddle");
 
         VCardVerificationHandler handler = new VCardVerificationHandler(this, version);
-        PropertyNodesVerifier verifier = handler.addNewVerifier()
-            .addNodeWithOrder("N",
-                    "AppropriateFamilyName;AppropriateGivenName;AppropriateMiddleName;"
-                    + "AppropriatePrefix;AppropriateSuffix",
-                    Arrays.asList("AppropriateFamilyName", "AppropriateGivenName",
-                            "AppropriateMiddleName", "AppropriatePrefix", "AppropriateSuffix"))
-            .addNodeWithOrder("FN",
-                    "AppropriatePrefix AppropriateGivenName "
-                    + "AppropriateMiddleName AppropriateFamilyName AppropriateSuffix")
-            .addNodeWithoutOrder("X-PHONETIC-FIRST-NAME", "AppropriatePhoneticGiven")
-            .addNodeWithoutOrder("X-PHONETIC-MIDDLE-NAME", "AppropriatePhoneticMiddle")
-            .addNodeWithoutOrder("X-PHONETIC-LAST-NAME", "AppropriatePhoneticFamily");
+        PropertyNodesVerifier verifier = handler.addPropertyNodesVerifier()
+                .addNodeWithOrder("N",
+                        "AppropriateFamilyName;AppropriateGivenName;AppropriateMiddleName;"
+                        + "AppropriatePrefix;AppropriateSuffix",
+                        Arrays.asList("AppropriateFamilyName", "AppropriateGivenName",
+                                "AppropriateMiddleName", "AppropriatePrefix", "AppropriateSuffix"))
+                .addNodeWithOrder("FN",
+                        "AppropriatePrefix AppropriateGivenName "
+                        + "AppropriateMiddleName AppropriateFamilyName AppropriateSuffix")
+                .addNodeWithoutOrder("X-PHONETIC-FIRST-NAME", "AppropriatePhoneticGiven")
+                .addNodeWithoutOrder("X-PHONETIC-MIDDLE-NAME", "AppropriatePhoneticMiddle")
+                .addNodeWithoutOrder("X-PHONETIC-LAST-NAME", "AppropriatePhoneticFamily");
 
         if (isV30) {
             verifier.addNodeWithoutOrder("SORT-STRING",
@@ -130,53 +130,53 @@ public class VCardExporterTests extends VCardTestsBase {
         final boolean isV30 = (version == V30);
         ExportTestResolver resolver = new ExportTestResolver();
 
-        ContentValues contentValues = resolver.buildData(StructuredName.CONTENT_ITEM_TYPE);
-        contentValues.put(StructuredName.FAMILY_NAME, "DoNotEmitFamilyName1");
-        contentValues.put(StructuredName.GIVEN_NAME, "DoNotEmitGivenName1");
-        contentValues.put(StructuredName.MIDDLE_NAME, "DoNotEmitMiddleName1");
-        contentValues.put(StructuredName.PREFIX, "DoNotEmitPrefix1");
-        contentValues.put(StructuredName.SUFFIX, "DoNotEmitSuffix1");
-        contentValues.put(StructuredName.PHONETIC_FAMILY_NAME, "DoNotEmitPhoneticFamily1");
-        contentValues.put(StructuredName.PHONETIC_GIVEN_NAME, "DoNotEmitPhoneticGiven1");
-        contentValues.put(StructuredName.PHONETIC_MIDDLE_NAME, "DoNotEmitPhoneticMiddle1");
+        resolver.buildInput(StructuredName.CONTENT_ITEM_TYPE)
+                .put(StructuredName.FAMILY_NAME, "DoNotEmitFamilyName1")
+                .put(StructuredName.GIVEN_NAME, "DoNotEmitGivenName1")
+                .put(StructuredName.MIDDLE_NAME, "DoNotEmitMiddleName1")
+                .put(StructuredName.PREFIX, "DoNotEmitPrefix1")
+                .put(StructuredName.SUFFIX, "DoNotEmitSuffix1")
+                .put(StructuredName.PHONETIC_FAMILY_NAME, "DoNotEmitPhoneticFamily1")
+                .put(StructuredName.PHONETIC_GIVEN_NAME, "DoNotEmitPhoneticGiven1")
+                .put(StructuredName.PHONETIC_MIDDLE_NAME, "DoNotEmitPhoneticMiddle1");
 
         // With "IS_PRIMARY=1". This is what we should use.
-        contentValues = resolver.buildData(StructuredName.CONTENT_ITEM_TYPE);
-        contentValues.put(StructuredName.FAMILY_NAME, "AppropriateFamilyName");
-        contentValues.put(StructuredName.GIVEN_NAME, "AppropriateGivenName");
-        contentValues.put(StructuredName.MIDDLE_NAME, "AppropriateMiddleName");
-        contentValues.put(StructuredName.PREFIX, "AppropriatePrefix");
-        contentValues.put(StructuredName.SUFFIX, "AppropriateSuffix");
-        contentValues.put(StructuredName.PHONETIC_FAMILY_NAME, "AppropriatePhoneticFamily");
-        contentValues.put(StructuredName.PHONETIC_GIVEN_NAME, "AppropriatePhoneticGiven");
-        contentValues.put(StructuredName.PHONETIC_MIDDLE_NAME, "AppropriatePhoneticMiddle");
-        contentValues.put(StructuredName.IS_PRIMARY, 1);
+        resolver.buildInput(StructuredName.CONTENT_ITEM_TYPE)
+                .put(StructuredName.FAMILY_NAME, "AppropriateFamilyName")
+                .put(StructuredName.GIVEN_NAME, "AppropriateGivenName")
+                .put(StructuredName.MIDDLE_NAME, "AppropriateMiddleName")
+                .put(StructuredName.PREFIX, "AppropriatePrefix")
+                .put(StructuredName.SUFFIX, "AppropriateSuffix")
+                .put(StructuredName.PHONETIC_FAMILY_NAME, "AppropriatePhoneticFamily")
+                .put(StructuredName.PHONETIC_GIVEN_NAME, "AppropriatePhoneticGiven")
+                .put(StructuredName.PHONETIC_MIDDLE_NAME, "AppropriatePhoneticMiddle")
+                .put(StructuredName.IS_PRIMARY, 1);
 
         // With "IS_PRIMARY=1", but we should ignore this time, since this is second, not first.
-        contentValues = resolver.buildData(StructuredName.CONTENT_ITEM_TYPE);
-        contentValues.put(StructuredName.FAMILY_NAME, "DoNotEmitFamilyName2");
-        contentValues.put(StructuredName.GIVEN_NAME, "DoNotEmitGivenName2");
-        contentValues.put(StructuredName.MIDDLE_NAME, "DoNotEmitMiddleName2");
-        contentValues.put(StructuredName.PREFIX, "DoNotEmitPrefix2");
-        contentValues.put(StructuredName.SUFFIX, "DoNotEmitSuffix2");
-        contentValues.put(StructuredName.PHONETIC_FAMILY_NAME, "DoNotEmitPhoneticFamily2");
-        contentValues.put(StructuredName.PHONETIC_GIVEN_NAME, "DoNotEmitPhoneticGiven2");
-        contentValues.put(StructuredName.PHONETIC_MIDDLE_NAME, "DoNotEmitPhoneticMiddle2");
-        contentValues.put(StructuredName.IS_PRIMARY, 1);
+        resolver.buildInput(StructuredName.CONTENT_ITEM_TYPE)
+                .put(StructuredName.FAMILY_NAME, "DoNotEmitFamilyName2")
+                .put(StructuredName.GIVEN_NAME, "DoNotEmitGivenName2")
+                .put(StructuredName.MIDDLE_NAME, "DoNotEmitMiddleName2")
+                .put(StructuredName.PREFIX, "DoNotEmitPrefix2")
+                .put(StructuredName.SUFFIX, "DoNotEmitSuffix2")
+                .put(StructuredName.PHONETIC_FAMILY_NAME, "DoNotEmitPhoneticFamily2")
+                .put(StructuredName.PHONETIC_GIVEN_NAME, "DoNotEmitPhoneticGiven2")
+                .put(StructuredName.PHONETIC_MIDDLE_NAME, "DoNotEmitPhoneticMiddle2")
+                .put(StructuredName.IS_PRIMARY, 1);
 
         VCardVerificationHandler handler = new VCardVerificationHandler(this, version);
-        PropertyNodesVerifier verifier = handler.addNewVerifier()
-            .addNodeWithOrder("N",
-                    "AppropriateFamilyName;AppropriateGivenName;AppropriateMiddleName;"
-                    + "AppropriatePrefix;AppropriateSuffix",
-                    Arrays.asList("AppropriateFamilyName", "AppropriateGivenName",
-                            "AppropriateMiddleName", "AppropriatePrefix", "AppropriateSuffix"))
-            .addNodeWithOrder("FN",
-                    "AppropriatePrefix AppropriateGivenName "
-                    + "AppropriateMiddleName AppropriateFamilyName AppropriateSuffix")
-            .addNodeWithoutOrder("X-PHONETIC-FIRST-NAME", "AppropriatePhoneticGiven")
-            .addNodeWithoutOrder("X-PHONETIC-MIDDLE-NAME", "AppropriatePhoneticMiddle")
-            .addNodeWithoutOrder("X-PHONETIC-LAST-NAME", "AppropriatePhoneticFamily");
+        PropertyNodesVerifier verifier = handler.addPropertyNodesVerifier()
+                .addNodeWithOrder("N",
+                        "AppropriateFamilyName;AppropriateGivenName;AppropriateMiddleName;"
+                        + "AppropriatePrefix;AppropriateSuffix",
+                        Arrays.asList("AppropriateFamilyName", "AppropriateGivenName",
+                                "AppropriateMiddleName", "AppropriatePrefix", "AppropriateSuffix"))
+                .addNodeWithOrder("FN",
+                        "AppropriatePrefix AppropriateGivenName "
+                        + "AppropriateMiddleName AppropriateFamilyName AppropriateSuffix")
+                .addNodeWithoutOrder("X-PHONETIC-FIRST-NAME", "AppropriatePhoneticGiven")
+                .addNodeWithoutOrder("X-PHONETIC-MIDDLE-NAME", "AppropriatePhoneticMiddle")
+                .addNodeWithoutOrder("X-PHONETIC-LAST-NAME", "AppropriatePhoneticFamily");
 
         if (isV30) {
             verifier.addNodeWithoutOrder("SORT-STRING",
@@ -203,64 +203,64 @@ public class VCardExporterTests extends VCardTestsBase {
         final boolean isV30 = (version == V30);
         ExportTestResolver resolver = new ExportTestResolver();
 
-        ContentValues contentValues = resolver.buildData(StructuredName.CONTENT_ITEM_TYPE);
-        contentValues.put(StructuredName.FAMILY_NAME, "DoNotEmitFamilyName1");
-        contentValues.put(StructuredName.GIVEN_NAME, "DoNotEmitGivenName1");
-        contentValues.put(StructuredName.MIDDLE_NAME, "DoNotEmitMiddleName1");
-        contentValues.put(StructuredName.PREFIX, "DoNotEmitPrefix1");
-        contentValues.put(StructuredName.SUFFIX, "DoNotEmitSuffix1");
-        contentValues.put(StructuredName.PHONETIC_FAMILY_NAME, "DoNotEmitPhoneticFamily1");
-        contentValues.put(StructuredName.PHONETIC_GIVEN_NAME, "DoNotEmitPhoneticGiven1");
-        contentValues.put(StructuredName.PHONETIC_MIDDLE_NAME, "DoNotEmitPhoneticMiddle1");
+        resolver.buildInput(StructuredName.CONTENT_ITEM_TYPE)
+                .put(StructuredName.FAMILY_NAME, "DoNotEmitFamilyName1")
+                .put(StructuredName.GIVEN_NAME, "DoNotEmitGivenName1")
+                .put(StructuredName.MIDDLE_NAME, "DoNotEmitMiddleName1")
+                .put(StructuredName.PREFIX, "DoNotEmitPrefix1")
+                .put(StructuredName.SUFFIX, "DoNotEmitSuffix1")
+                .put(StructuredName.PHONETIC_FAMILY_NAME, "DoNotEmitPhoneticFamily1")
+                .put(StructuredName.PHONETIC_GIVEN_NAME, "DoNotEmitPhoneticGiven1")
+                .put(StructuredName.PHONETIC_MIDDLE_NAME, "DoNotEmitPhoneticMiddle1");
 
         // With "IS_PRIMARY=1", but we should ignore this time.
-        contentValues = resolver.buildData(StructuredName.CONTENT_ITEM_TYPE);
-        contentValues.put(StructuredName.FAMILY_NAME, "DoNotEmitFamilyName2");
-        contentValues.put(StructuredName.GIVEN_NAME, "DoNotEmitGivenName2");
-        contentValues.put(StructuredName.MIDDLE_NAME, "DoNotEmitMiddleName2");
-        contentValues.put(StructuredName.PREFIX, "DoNotEmitPrefix2");
-        contentValues.put(StructuredName.SUFFIX, "DoNotEmitSuffix2");
-        contentValues.put(StructuredName.PHONETIC_FAMILY_NAME, "DoNotEmitPhoneticFamily2");
-        contentValues.put(StructuredName.PHONETIC_GIVEN_NAME, "DoNotEmitPhoneticGiven2");
-        contentValues.put(StructuredName.PHONETIC_MIDDLE_NAME, "DoNotEmitPhoneticMiddle2");
-        contentValues.put(StructuredName.IS_PRIMARY, 1);
+        resolver.buildInput(StructuredName.CONTENT_ITEM_TYPE)
+                .put(StructuredName.FAMILY_NAME, "DoNotEmitFamilyName2")
+                .put(StructuredName.GIVEN_NAME, "DoNotEmitGivenName2")
+                .put(StructuredName.MIDDLE_NAME, "DoNotEmitMiddleName2")
+                .put(StructuredName.PREFIX, "DoNotEmitPrefix2")
+                .put(StructuredName.SUFFIX, "DoNotEmitSuffix2")
+                .put(StructuredName.PHONETIC_FAMILY_NAME, "DoNotEmitPhoneticFamily2")
+                .put(StructuredName.PHONETIC_GIVEN_NAME, "DoNotEmitPhoneticGiven2")
+                .put(StructuredName.PHONETIC_MIDDLE_NAME, "DoNotEmitPhoneticMiddle2")
+                .put(StructuredName.IS_PRIMARY, 1);
 
         // With "IS_SUPER_PRIMARY=1". This is what we should use.
-        contentValues = resolver.buildData(StructuredName.CONTENT_ITEM_TYPE);
-        contentValues.put(StructuredName.FAMILY_NAME, "AppropriateFamilyName");
-        contentValues.put(StructuredName.GIVEN_NAME, "AppropriateGivenName");
-        contentValues.put(StructuredName.MIDDLE_NAME, "AppropriateMiddleName");
-        contentValues.put(StructuredName.PREFIX, "AppropriatePrefix");
-        contentValues.put(StructuredName.SUFFIX, "AppropriateSuffix");
-        contentValues.put(StructuredName.PHONETIC_FAMILY_NAME, "AppropriatePhoneticFamily");
-        contentValues.put(StructuredName.PHONETIC_GIVEN_NAME, "AppropriatePhoneticGiven");
-        contentValues.put(StructuredName.PHONETIC_MIDDLE_NAME, "AppropriatePhoneticMiddle");
-        contentValues.put(StructuredName.IS_SUPER_PRIMARY, 1);
-
-        contentValues = resolver.buildData(StructuredName.CONTENT_ITEM_TYPE);
-        contentValues.put(StructuredName.FAMILY_NAME, "DoNotEmitFamilyName3");
-        contentValues.put(StructuredName.GIVEN_NAME, "DoNotEmitGivenName3");
-        contentValues.put(StructuredName.MIDDLE_NAME, "DoNotEmitMiddleName3");
-        contentValues.put(StructuredName.PREFIX, "DoNotEmitPrefix3");
-        contentValues.put(StructuredName.SUFFIX, "DoNotEmitSuffix3");
-        contentValues.put(StructuredName.PHONETIC_FAMILY_NAME, "DoNotEmitPhoneticFamily3");
-        contentValues.put(StructuredName.PHONETIC_GIVEN_NAME, "DoNotEmitPhoneticGiven3");
-        contentValues.put(StructuredName.PHONETIC_MIDDLE_NAME, "DoNotEmitPhoneticMiddle3");
-        contentValues.put(StructuredName.IS_PRIMARY, 1);
+        resolver.buildInput(StructuredName.CONTENT_ITEM_TYPE)
+                .put(StructuredName.FAMILY_NAME, "AppropriateFamilyName")
+                .put(StructuredName.GIVEN_NAME, "AppropriateGivenName")
+                .put(StructuredName.MIDDLE_NAME, "AppropriateMiddleName")
+                .put(StructuredName.PREFIX, "AppropriatePrefix")
+                .put(StructuredName.SUFFIX, "AppropriateSuffix")
+                .put(StructuredName.PHONETIC_FAMILY_NAME, "AppropriatePhoneticFamily")
+                .put(StructuredName.PHONETIC_GIVEN_NAME, "AppropriatePhoneticGiven")
+                .put(StructuredName.PHONETIC_MIDDLE_NAME, "AppropriatePhoneticMiddle")
+                .put(StructuredName.IS_SUPER_PRIMARY, 1);
+
+        resolver.buildInput(StructuredName.CONTENT_ITEM_TYPE)
+                .put(StructuredName.FAMILY_NAME, "DoNotEmitFamilyName3")
+                .put(StructuredName.GIVEN_NAME, "DoNotEmitGivenName3")
+                .put(StructuredName.MIDDLE_NAME, "DoNotEmitMiddleName3")
+                .put(StructuredName.PREFIX, "DoNotEmitPrefix3")
+                .put(StructuredName.SUFFIX, "DoNotEmitSuffix3")
+                .put(StructuredName.PHONETIC_FAMILY_NAME, "DoNotEmitPhoneticFamily3")
+                .put(StructuredName.PHONETIC_GIVEN_NAME, "DoNotEmitPhoneticGiven3")
+                .put(StructuredName.PHONETIC_MIDDLE_NAME, "DoNotEmitPhoneticMiddle3")
+                .put(StructuredName.IS_PRIMARY, 1);
 
         VCardVerificationHandler handler = new VCardVerificationHandler(this, version);
-        PropertyNodesVerifier verifier = handler.addNewVerifier()
-            .addNodeWithOrder("N",
-                    "AppropriateFamilyName;AppropriateGivenName;AppropriateMiddleName;"
-                    + "AppropriatePrefix;AppropriateSuffix",
-                    Arrays.asList("AppropriateFamilyName", "AppropriateGivenName",
-                            "AppropriateMiddleName", "AppropriatePrefix", "AppropriateSuffix"))
-            .addNodeWithOrder("FN",
-                    "AppropriatePrefix AppropriateGivenName "
-                    + "AppropriateMiddleName AppropriateFamilyName AppropriateSuffix")
-            .addNodeWithoutOrder("X-PHONETIC-FIRST-NAME", "AppropriatePhoneticGiven")
-            .addNodeWithoutOrder("X-PHONETIC-MIDDLE-NAME", "AppropriatePhoneticMiddle")
-            .addNodeWithoutOrder("X-PHONETIC-LAST-NAME", "AppropriatePhoneticFamily");
+        PropertyNodesVerifier verifier = handler.addPropertyNodesVerifier()
+                .addNodeWithOrder("N",
+                        "AppropriateFamilyName;AppropriateGivenName;AppropriateMiddleName;"
+                        + "AppropriatePrefix;AppropriateSuffix",
+                        Arrays.asList("AppropriateFamilyName", "AppropriateGivenName",
+                                "AppropriateMiddleName", "AppropriatePrefix", "AppropriateSuffix"))
+                .addNodeWithOrder("FN",
+                        "AppropriatePrefix AppropriateGivenName "
+                        + "AppropriateMiddleName AppropriateFamilyName AppropriateSuffix")
+                .addNodeWithoutOrder("X-PHONETIC-FIRST-NAME", "AppropriatePhoneticGiven")
+                .addNodeWithoutOrder("X-PHONETIC-MIDDLE-NAME", "AppropriatePhoneticMiddle")
+                .addNodeWithoutOrder("X-PHONETIC-LAST-NAME", "AppropriatePhoneticFamily");
 
         if (isV30) {
             verifier.addNodeWithoutOrder("SORT-STRING",
@@ -281,11 +281,11 @@ public class VCardExporterTests extends VCardTestsBase {
 
     public void testNickNameV30() {
         ExportTestResolver resolver = new ExportTestResolver();
-        ContentValues contentValues = resolver.buildData(Nickname.CONTENT_ITEM_TYPE);
-        contentValues.put(Nickname.NAME, "Nicky");
+        resolver.buildInput(Nickname.CONTENT_ITEM_TYPE)
+                .put(Nickname.NAME, "Nicky");
 
         VCardVerificationHandler handler = new VCardVerificationHandler(this, V30);
-        handler.addNewVerifierWithEmptyName()
+        handler.addPropertyVerifierWithEmptyName()
             .addNodeWithOrder("NICKNAME", "Nicky");
 
         verifyOneComposition(resolver, handler, V30);
@@ -294,13 +294,13 @@ public class VCardExporterTests extends VCardTestsBase {
     private void testPhoneBasicCommon(int version) {
         ExportTestResolver resolver = new ExportTestResolver();
 
-        ContentValues contentValues = resolver.buildData(Phone.CONTENT_ITEM_TYPE);
-        contentValues.put(Phone.NUMBER, "1");
-        contentValues.put(Phone.TYPE, Phone.TYPE_HOME);
+        resolver.buildInput(Phone.CONTENT_ITEM_TYPE)
+                .put(Phone.NUMBER, "1")
+                .put(Phone.TYPE, Phone.TYPE_HOME);
 
         VCardVerificationHandler handler = new VCardVerificationHandler(this, version);
-        handler.addNewVerifierWithEmptyName()
-            .addNodeWithoutOrder("TEL", "1", new TypeSet("HOME", "VOICE"));
+        handler.addPropertyVerifierWithEmptyName()
+                .addNodeWithoutOrder("TEL", "1", new TypeSet("HOME", "VOICE"));
 
         verifyOneComposition(resolver, handler, version);
     }
@@ -319,88 +319,88 @@ public class VCardExporterTests extends VCardTestsBase {
     private void testPhoneVariousTypeSupport(int version) {
         ExportTestResolver resolver = new ExportTestResolver();
 
-        ContentValues contentValues = resolver.buildData(Phone.CONTENT_ITEM_TYPE);
-        contentValues.put(Phone.NUMBER, "10");
-        contentValues.put(Phone.TYPE, Phone.TYPE_HOME);
+        resolver.buildInput(Phone.CONTENT_ITEM_TYPE)
+                .put(Phone.NUMBER, "10")
+                .put(Phone.TYPE, Phone.TYPE_HOME);
 
-        contentValues = resolver.buildData(Phone.CONTENT_ITEM_TYPE);
-        contentValues.put(Phone.NUMBER, "20");
-        contentValues.put(Phone.TYPE, Phone.TYPE_WORK);
+        resolver.buildInput(Phone.CONTENT_ITEM_TYPE)
+                .put(Phone.NUMBER, "20")
+                .put(Phone.TYPE, Phone.TYPE_WORK);
 
-        contentValues = resolver.buildData(Phone.CONTENT_ITEM_TYPE);
-        contentValues.put(Phone.NUMBER, "30");
-        contentValues.put(Phone.TYPE, Phone.TYPE_FAX_HOME);
+        resolver.buildInput(Phone.CONTENT_ITEM_TYPE)
+                .put(Phone.NUMBER, "30")
+                .put(Phone.TYPE, Phone.TYPE_FAX_HOME);
 
-        contentValues = resolver.buildData(Phone.CONTENT_ITEM_TYPE);
-        contentValues.put(Phone.NUMBER, "40");
-        contentValues.put(Phone.TYPE, Phone.TYPE_FAX_WORK);
+        resolver.buildInput(Phone.CONTENT_ITEM_TYPE)
+                .put(Phone.NUMBER, "40")
+                .put(Phone.TYPE, Phone.TYPE_FAX_WORK);
 
-        contentValues = resolver.buildData(Phone.CONTENT_ITEM_TYPE);
-        contentValues.put(Phone.NUMBER, "50");
-        contentValues.put(Phone.TYPE, Phone.TYPE_MOBILE);
+        resolver.buildInput(Phone.CONTENT_ITEM_TYPE)
+                .put(Phone.NUMBER, "50")
+                .put(Phone.TYPE, Phone.TYPE_MOBILE);
 
-        contentValues = resolver.buildData(Phone.CONTENT_ITEM_TYPE);
-        contentValues.put(Phone.NUMBER, "60");
-        contentValues.put(Phone.TYPE, Phone.TYPE_PAGER);
+        resolver.buildInput(Phone.CONTENT_ITEM_TYPE)
+                .put(Phone.NUMBER, "60")
+                .put(Phone.TYPE, Phone.TYPE_PAGER);
 
-        contentValues = resolver.buildData(Phone.CONTENT_ITEM_TYPE);
-        contentValues.put(Phone.NUMBER, "70");
-        contentValues.put(Phone.TYPE, Phone.TYPE_OTHER);
+        resolver.buildInput(Phone.CONTENT_ITEM_TYPE)
+                .put(Phone.NUMBER, "70")
+                .put(Phone.TYPE, Phone.TYPE_OTHER);
 
-        contentValues = resolver.buildData(Phone.CONTENT_ITEM_TYPE);
-        contentValues.put(Phone.NUMBER, "80");
-        contentValues.put(Phone.TYPE, Phone.TYPE_CAR);
+        resolver.buildInput(Phone.CONTENT_ITEM_TYPE)
+                .put(Phone.NUMBER, "80")
+                .put(Phone.TYPE, Phone.TYPE_CAR);
 
-        contentValues = resolver.buildData(Phone.CONTENT_ITEM_TYPE);
-        contentValues.put(Phone.NUMBER, "90");
-        contentValues.put(Phone.TYPE, Phone.TYPE_COMPANY_MAIN);
+        resolver.buildInput(Phone.CONTENT_ITEM_TYPE)
+                .put(Phone.NUMBER, "90")
+                .put(Phone.TYPE, Phone.TYPE_COMPANY_MAIN);
 
-        contentValues = resolver.buildData(Phone.CONTENT_ITEM_TYPE);
-        contentValues.put(Phone.NUMBER, "100");
-        contentValues.put(Phone.TYPE, Phone.TYPE_ISDN);
+        resolver.buildInput(Phone.CONTENT_ITEM_TYPE)
+                .put(Phone.NUMBER, "100")
+                .put(Phone.TYPE, Phone.TYPE_ISDN);
 
-        contentValues = resolver.buildData(Phone.CONTENT_ITEM_TYPE);
-        contentValues.put(Phone.NUMBER, "110");
-        contentValues.put(Phone.TYPE, Phone.TYPE_MAIN);
+        resolver.buildInput(Phone.CONTENT_ITEM_TYPE)
+                .put(Phone.NUMBER, "110")
+                .put(Phone.TYPE, Phone.TYPE_MAIN);
 
-        contentValues = resolver.buildData(Phone.CONTENT_ITEM_TYPE);
-        contentValues.put(Phone.NUMBER, "120");
-        contentValues.put(Phone.TYPE, Phone.TYPE_OTHER_FAX);
+        resolver.buildInput(Phone.CONTENT_ITEM_TYPE)
+                .put(Phone.NUMBER, "120")
+                .put(Phone.TYPE, Phone.TYPE_OTHER_FAX);
 
-        contentValues = resolver.buildData(Phone.CONTENT_ITEM_TYPE);
-        contentValues.put(Phone.NUMBER, "130");
-        contentValues.put(Phone.TYPE, Phone.TYPE_TELEX);
+        resolver.buildInput(Phone.CONTENT_ITEM_TYPE)
+                .put(Phone.NUMBER, "130")
+                .put(Phone.TYPE, Phone.TYPE_TELEX);
 
-        contentValues = resolver.buildData(Phone.CONTENT_ITEM_TYPE);
-        contentValues.put(Phone.NUMBER, "140");
-        contentValues.put(Phone.TYPE, Phone.TYPE_WORK_MOBILE);
+        resolver.buildInput(Phone.CONTENT_ITEM_TYPE)
+                .put(Phone.NUMBER, "140")
+                .put(Phone.TYPE, Phone.TYPE_WORK_MOBILE);
 
-        contentValues = resolver.buildData(Phone.CONTENT_ITEM_TYPE);
-        contentValues.put(Phone.NUMBER, "150");
-        contentValues.put(Phone.TYPE, Phone.TYPE_WORK_PAGER);
+        resolver.buildInput(Phone.CONTENT_ITEM_TYPE)
+                .put(Phone.NUMBER, "150")
+                .put(Phone.TYPE, Phone.TYPE_WORK_PAGER);
 
-        contentValues = resolver.buildData(Phone.CONTENT_ITEM_TYPE);
-        contentValues.put(Phone.NUMBER, "160");
-        contentValues.put(Phone.TYPE, Phone.TYPE_MMS);
+        resolver.buildInput(Phone.CONTENT_ITEM_TYPE)
+                .put(Phone.NUMBER, "160")
+                .put(Phone.TYPE, Phone.TYPE_MMS);
 
         VCardVerificationHandler handler = new VCardVerificationHandler(this, version);
-        handler.addNewVerifierWithEmptyName()
-            .addNodeWithoutOrder("TEL", "10", new TypeSet("HOME"))
-            .addNodeWithoutOrder("TEL", "20", new TypeSet("WORK"))
-            .addNodeWithoutOrder("TEL", "30", new TypeSet("HOME", "FAX"))
-            .addNodeWithoutOrder("TEL", "40", new TypeSet("WORK", "FAX"))
-            .addNodeWithoutOrder("TEL", "50", new TypeSet("CELL"))
-            .addNodeWithoutOrder("TEL", "60", new TypeSet("PAGER"))
-            .addNodeWithoutOrder("TEL", "70", new TypeSet("VOICE"))
-            .addNodeWithoutOrder("TEL", "80", new TypeSet("CAR"))
-            .addNodeWithoutOrder("TEL", "90", new TypeSet("WORK", "PREF"))
-            .addNodeWithoutOrder("TEL", "100", new TypeSet("ISDN"))
-            .addNodeWithoutOrder("TEL", "110", new TypeSet("PREF"))
-            .addNodeWithoutOrder("TEL", "120", new TypeSet("FAX"))
-            .addNodeWithoutOrder("TEL", "130", new TypeSet("TLX"))
-            .addNodeWithoutOrder("TEL", "140", new TypeSet("WORK", "MOBILE"))
-            .addNodeWithoutOrder("TEL", "150", new TypeSet("WORK", "PAGER"))
-            .addNodeWithoutOrder("TEL", "160", new TypeSet("MSG"));
+        handler.addPropertyVerifierWithEmptyName()
+                .addNodeWithoutOrder("TEL", "10", new TypeSet("HOME"))
+                .addNodeWithoutOrder("TEL", "20", new TypeSet("WORK"))
+                .addNodeWithoutOrder("TEL", "30", new TypeSet("HOME", "FAX"))
+                .addNodeWithoutOrder("TEL", "40", new TypeSet("WORK", "FAX"))
+                .addNodeWithoutOrder("TEL", "50", new TypeSet("CELL"))
+                .addNodeWithoutOrder("TEL", "60", new TypeSet("PAGER"))
+                .addNodeWithoutOrder("TEL", "70", new TypeSet("VOICE"))
+                .addNodeWithoutOrder("TEL", "80", new TypeSet("CAR"))
+                .addNodeWithoutOrder("TEL", "90", new TypeSet("WORK", "PREF"))
+                .addNodeWithoutOrder("TEL", "100", new TypeSet("ISDN"))
+                .addNodeWithoutOrder("TEL", "110", new TypeSet("PREF"))
+                .addNodeWithoutOrder("TEL", "120", new TypeSet("FAX"))
+                .addNodeWithoutOrder("TEL", "130", new TypeSet("TLX"))
+                .addNodeWithoutOrder("TEL", "140", new TypeSet("WORK", "MOBILE"))
+                .addNodeWithoutOrder("TEL", "150", new TypeSet("WORK", "PAGER"))
+                .addNodeWithoutOrder("TEL", "160", new TypeSet("MSG"));
     }
 
     public void testPhoneVariousTypeSupportV21() {
@@ -417,30 +417,30 @@ public class VCardExporterTests extends VCardTestsBase {
     private void testPhonePrefHandlingCommon(int version) {
         ExportTestResolver resolver = new ExportTestResolver();
 
-        ContentValues contentValues = resolver.buildData(Phone.CONTENT_ITEM_TYPE);
-        contentValues.put(Phone.NUMBER, "1");
-        contentValues.put(Phone.TYPE, Phone.TYPE_HOME);
+        resolver.buildInput(Phone.CONTENT_ITEM_TYPE)
+                .put(Phone.NUMBER, "1")
+                .put(Phone.TYPE, Phone.TYPE_HOME);
 
-        contentValues = resolver.buildData(Phone.CONTENT_ITEM_TYPE);
-        contentValues.put(Phone.NUMBER, "2");
-        contentValues.put(Phone.TYPE, Phone.TYPE_WORK);
-        contentValues.put(Phone.IS_PRIMARY, 1);
+        resolver.buildInput(Phone.CONTENT_ITEM_TYPE)
+                .put(Phone.NUMBER, "2")
+                .put(Phone.TYPE, Phone.TYPE_WORK)
+                .put(Phone.IS_PRIMARY, 1);
 
-        contentValues = resolver.buildData(Phone.CONTENT_ITEM_TYPE);
-        contentValues.put(Phone.NUMBER, "3");
-        contentValues.put(Phone.TYPE, Phone.TYPE_FAX_HOME);
-        contentValues.put(Phone.IS_PRIMARY, 1);
+        resolver.buildInput(Phone.CONTENT_ITEM_TYPE)
+                .put(Phone.NUMBER, "3")
+                .put(Phone.TYPE, Phone.TYPE_FAX_HOME)
+                .put(Phone.IS_PRIMARY, 1);
 
-        contentValues = resolver.buildData(Phone.CONTENT_ITEM_TYPE);
-        contentValues.put(Phone.NUMBER, "4");
-        contentValues.put(Phone.TYPE, Phone.TYPE_FAX_WORK);
+        resolver.buildInput(Phone.CONTENT_ITEM_TYPE)
+                .put(Phone.NUMBER, "4")
+                .put(Phone.TYPE, Phone.TYPE_FAX_WORK);
 
         VCardVerificationHandler handler = new VCardVerificationHandler(this, version);
-        handler.addNewVerifierWithEmptyName()
-            .addNodeWithoutOrder("TEL", "4", new TypeSet("WORK", "FAX"))
-            .addNodeWithoutOrder("TEL", "3", new TypeSet("HOME", "FAX", "PREF"))
-            .addNodeWithoutOrder("TEL", "2", new TypeSet("WORK", "VOICE", "PREF"))
-            .addNodeWithoutOrder("TEL", "1", new TypeSet("HOME", "VOICE"));
+        handler.addPropertyVerifierWithEmptyName()
+                .addNodeWithoutOrder("TEL", "4", new TypeSet("WORK", "FAX"))
+                .addNodeWithoutOrder("TEL", "3", new TypeSet("HOME", "FAX", "PREF"))
+                .addNodeWithoutOrder("TEL", "2", new TypeSet("WORK", "VOICE", "PREF"))
+                .addNodeWithoutOrder("TEL", "1", new TypeSet("HOME", "VOICE"));
 
         verifyOneComposition(resolver, handler, version);
     }
@@ -455,12 +455,12 @@ public class VCardExporterTests extends VCardTestsBase {
 
     private void testEmailBasicCommon(int version) {
         ExportTestResolver resolver = new ExportTestResolver();
-        ContentValues contentValues = resolver.buildData(Email.CONTENT_ITEM_TYPE);
-        contentValues.put(Email.DATA, "sample@example.com");
+        resolver.buildInput(Email.CONTENT_ITEM_TYPE)
+                .put(Email.DATA, "sample@example.com");
 
         VCardVerificationHandler handler = new VCardVerificationHandler(this, version);
 
-        handler.addNewVerifierWithEmptyName()
+        handler.addPropertyVerifierWithEmptyName()
             .addNodeWithoutOrder("EMAIL", "sample@example.com");
 
         verifyOneComposition(resolver, handler, version);
@@ -477,29 +477,29 @@ public class VCardExporterTests extends VCardTestsBase {
     private void testEmailVariousTypeSupportCommon(int version) {
         ExportTestResolver resolver = new ExportTestResolver();
 
-        ContentValues contentValues = resolver.buildData(Email.CONTENT_ITEM_TYPE);
-        contentValues.put(Email.DATA, "type_home@example.com");
-        contentValues.put(Email.TYPE, Email.TYPE_HOME);
+        resolver.buildInput(Email.CONTENT_ITEM_TYPE)
+                .put(Email.DATA, "type_home@example.com")
+                .put(Email.TYPE, Email.TYPE_HOME);
 
-        contentValues = resolver.buildData(Email.CONTENT_ITEM_TYPE);
-        contentValues.put(Email.DATA, "type_work@example.com");
-        contentValues.put(Email.TYPE, Email.TYPE_WORK);
+        resolver.buildInput(Email.CONTENT_ITEM_TYPE)
+                .put(Email.DATA, "type_work@example.com")
+                .put(Email.TYPE, Email.TYPE_WORK);
 
-        contentValues = resolver.buildData(Email.CONTENT_ITEM_TYPE);
-        contentValues.put(Email.DATA, "type_mobile@example.com");
-        contentValues.put(Email.TYPE, Email.TYPE_MOBILE);
+        resolver.buildInput(Email.CONTENT_ITEM_TYPE)
+                .put(Email.DATA, "type_mobile@example.com")
+                .put(Email.TYPE, Email.TYPE_MOBILE);
 
-        contentValues = resolver.buildData(Email.CONTENT_ITEM_TYPE);
-        contentValues.put(Email.DATA, "type_other@example.com");
-        contentValues.put(Email.TYPE, Email.TYPE_OTHER);
+        resolver.buildInput(Email.CONTENT_ITEM_TYPE)
+                .put(Email.DATA, "type_other@example.com")
+                .put(Email.TYPE, Email.TYPE_OTHER);
 
         VCardVerificationHandler handler = new VCardVerificationHandler(this, version);
 
-        handler.addNewVerifierWithEmptyName()
-            .addNodeWithoutOrder("EMAIL", "type_home@example.com", new TypeSet("HOME"))
-            .addNodeWithoutOrder("EMAIL", "type_work@example.com", new TypeSet("WORK"))
-            .addNodeWithoutOrder("EMAIL", "type_mobile@example.com", new TypeSet("CELL"))
-            .addNodeWithoutOrder("EMAIL", "type_other@example.com");
+        handler.addPropertyVerifierWithEmptyName()
+                .addNodeWithoutOrder("EMAIL", "type_home@example.com", new TypeSet("HOME"))
+                .addNodeWithoutOrder("EMAIL", "type_work@example.com", new TypeSet("WORK"))
+                .addNodeWithoutOrder("EMAIL", "type_mobile@example.com", new TypeSet("CELL"))
+                .addNodeWithoutOrder("EMAIL", "type_other@example.com");
 
         verifyOneComposition(resolver, handler, version);
     }
@@ -515,20 +515,20 @@ public class VCardExporterTests extends VCardTestsBase {
     private void testEmailPrefHandlingCommon(int version) {
         ExportTestResolver resolver = new ExportTestResolver();
 
-        ContentValues contentValues = resolver.buildData(Email.CONTENT_ITEM_TYPE);
-        contentValues.put(Email.DATA, "type_home@example.com");
-        contentValues.put(Email.TYPE, Email.TYPE_HOME);
-        contentValues.put(Email.IS_PRIMARY, 1);
+        resolver.buildInput(Email.CONTENT_ITEM_TYPE)
+                .put(Email.DATA, "type_home@example.com")
+                .put(Email.TYPE, Email.TYPE_HOME)
+                .put(Email.IS_PRIMARY, 1);
 
-        contentValues = resolver.buildData(Email.CONTENT_ITEM_TYPE);
-        contentValues.put(Email.DATA, "type_notype@example.com");
-        contentValues.put(Email.IS_PRIMARY, 1);
+        resolver.buildInput(Email.CONTENT_ITEM_TYPE)
+                .put(Email.DATA, "type_notype@example.com")
+                .put(Email.IS_PRIMARY, 1);
 
         VCardVerificationHandler handler = new VCardVerificationHandler(this, version);
 
-        handler.addNewVerifierWithEmptyName()
-            .addNodeWithoutOrder("EMAIL", "type_notype@example.com", new TypeSet("PREF"))
-            .addNodeWithoutOrder("EMAIL", "type_home@example.com", new TypeSet("HOME", "PREF"));
+        handler.addPropertyVerifierWithEmptyName()
+                .addNodeWithoutOrder("EMAIL", "type_notype@example.com", new TypeSet("PREF"))
+                .addNodeWithoutOrder("EMAIL", "type_home@example.com", new TypeSet("HOME", "PREF"));
 
         verifyOneComposition(resolver, handler, version);
     }
@@ -547,19 +547,19 @@ public class VCardExporterTests extends VCardTestsBase {
         // adr-value    = 0*6(text-value ";") text-value
         //              ; PO Box, Extended Address, Street, Locality, Region, Postal Code,
         //              ; Country Name
-        ContentValues contentValues = resolver.buildData(StructuredPostal.CONTENT_ITEM_TYPE);
-        contentValues.put(StructuredPostal.POBOX, "Pobox");
-        contentValues.put(StructuredPostal.NEIGHBORHOOD, "Neighborhood");
-        contentValues.put(StructuredPostal.STREET, "Street");
-        contentValues.put(StructuredPostal.CITY, "City");
-        contentValues.put(StructuredPostal.REGION, "Region");
-        contentValues.put(StructuredPostal.POSTCODE, "100");
-        contentValues.put(StructuredPostal.COUNTRY, "Country");
+        resolver.buildInput(StructuredPostal.CONTENT_ITEM_TYPE)
+                .put(StructuredPostal.POBOX, "Pobox")
+                .put(StructuredPostal.NEIGHBORHOOD, "Neighborhood")
+                .put(StructuredPostal.STREET, "Street")
+                .put(StructuredPostal.CITY, "City")
+                .put(StructuredPostal.REGION, "Region")
+                .put(StructuredPostal.POSTCODE, "100")
+                .put(StructuredPostal.COUNTRY, "Country");
         VCardVerificationHandler handler = new VCardVerificationHandler(this, version);
-        handler.addNewVerifierWithEmptyName()
-            .addNodeWithoutOrder("ADR", "Pobox;Neighborhood;Street;City;Region;100;Country",
-                    Arrays.asList("Pobox", "Neighborhood", "Street", "City",
-                            "Region", "100", "Country"), new TypeSet("HOME"));
+        handler.addPropertyVerifierWithEmptyName()
+                .addNodeWithoutOrder("ADR", "Pobox;Neighborhood;Street;City;Region;100;Country",
+                        Arrays.asList("Pobox", "Neighborhood", "Street", "City",
+                                "Region", "100", "Country"), new TypeSet("HOME"));
 
         verifyOneComposition(resolver, handler, version);
     }
@@ -575,15 +575,15 @@ public class VCardExporterTests extends VCardTestsBase {
     private void testPostalOnlyWithFormattedAddressCommon(int version) {
         ExportTestResolver resolver = new ExportTestResolver();
 
-        ContentValues contentValues = resolver.buildData(StructuredPostal.CONTENT_ITEM_TYPE);
-        contentValues.put(StructuredPostal.FORMATTED_ADDRESS,
+        resolver.buildInput(StructuredPostal.CONTENT_ITEM_TYPE)
+                .put(StructuredPostal.FORMATTED_ADDRESS,
                 "Formatted address CA 123-334 United Statue");
 
         VCardVerificationHandler handler = new VCardVerificationHandler(this, version);
-        handler.addNewVerifierWithEmptyName()
-            .addNodeWithOrder("ADR", ";Formatted address CA 123-334 United Statue;;;;;",
-                    Arrays.asList("", "Formatted address CA 123-334 United Statue",
-                            "", "", "", "", ""), new TypeSet("HOME"));
+        handler.addPropertyVerifierWithEmptyName()
+                .addNodeWithOrder("ADR", ";Formatted address CA 123-334 United Statue;;;;;",
+                        Arrays.asList("", "Formatted address CA 123-334 United Statue",
+                                "", "", "", "", ""), new TypeSet("HOME"));
 
         verifyOneComposition(resolver, handler, version);
     }
@@ -603,16 +603,17 @@ public class VCardExporterTests extends VCardTestsBase {
     private void testPostalWithBothStructuredAndFormattedCommon(int version) {
         ExportTestResolver resolver = new ExportTestResolver();
 
-        ContentValues contentValues = resolver.buildData(StructuredPostal.CONTENT_ITEM_TYPE);
-        contentValues.put(StructuredPostal.POBOX, "Pobox");
-        contentValues.put(StructuredPostal.COUNTRY, "Country");
-        contentValues.put(StructuredPostal.FORMATTED_ADDRESS,
-                "Formatted address CA 123-334 United Statue");  // Should be ignored
+        resolver.buildInput(StructuredPostal.CONTENT_ITEM_TYPE)
+                .put(StructuredPostal.POBOX, "Pobox")
+                .put(StructuredPostal.COUNTRY, "Country")
+                .put(StructuredPostal.FORMATTED_ADDRESS,
+                        "Formatted address CA 123-334 United Statue");  // Should be ignored
 
         VCardVerificationHandler handler = new VCardVerificationHandler(this, version);
-        handler.addNewVerifierWithEmptyName()
-            .addNodeWithoutOrder("ADR", "Pobox;;;;;;Country",
-                    Arrays.asList("Pobox", "", "", "", "", "", "Country"), new TypeSet("HOME"));
+        handler.addPropertyVerifierWithEmptyName()
+                .addNodeWithoutOrder("ADR", "Pobox;;;;;;Country",
+                        Arrays.asList("Pobox", "", "", "", "", "", "Country"),
+                        new TypeSet("HOME"));
 
         verifyOneComposition(resolver, handler, version);
     }
@@ -627,35 +628,35 @@ public class VCardExporterTests extends VCardTestsBase {
 
     private void testOrganizationCommon(int version) {
         ExportTestResolver resolver = new ExportTestResolver();
-        ContentValues contentValues = resolver.buildData(Organization.CONTENT_ITEM_TYPE);
-        contentValues.put(Organization.COMPANY, "CompanyX");
-        contentValues.put(Organization.DEPARTMENT, "DepartmentY");
-        contentValues.put(Organization.TITLE, "TitleZ");
-        contentValues.put(Organization.JOB_DESCRIPTION, "Description Rambda");  // Ignored.
-        contentValues.put(Organization.OFFICE_LOCATION, "Mountain View");  // Ignored.
-        contentValues.put(Organization.PHONETIC_NAME, "PhoneticName!");  // Ignored
-        contentValues.put(Organization.SYMBOL, "(^o^)/~~");  // Ignore him (her).
-
-        contentValues = resolver.buildData(Organization.CONTENT_ITEM_TYPE);
-        contentValues.putNull(Organization.COMPANY);
-        contentValues.put(Organization.DEPARTMENT, "DepartmentXX");
-        contentValues.putNull(Organization.TITLE);
-
-        contentValues = resolver.buildData(Organization.CONTENT_ITEM_TYPE);
-        contentValues.put(Organization.COMPANY, "CompanyXYZ");
-        contentValues.putNull(Organization.DEPARTMENT);
-        contentValues.put(Organization.TITLE, "TitleXYZYX");
+        resolver.buildInput(Organization.CONTENT_ITEM_TYPE)
+                .put(Organization.COMPANY, "CompanyX")
+                .put(Organization.DEPARTMENT, "DepartmentY")
+                .put(Organization.TITLE, "TitleZ")
+                .put(Organization.JOB_DESCRIPTION, "Description Rambda")  // Ignored.
+                .put(Organization.OFFICE_LOCATION, "Mountain View")  // Ignored.
+                .put(Organization.PHONETIC_NAME, "PhoneticName!")  // Ignored
+                .put(Organization.SYMBOL, "(^o^)/~~");  // Ignore him (her).
+
+        resolver.buildInput(Organization.CONTENT_ITEM_TYPE)
+                .putNull(Organization.COMPANY)
+                .put(Organization.DEPARTMENT, "DepartmentXX")
+                .putNull(Organization.TITLE);
+
+        resolver.buildInput(Organization.CONTENT_ITEM_TYPE)
+                .put(Organization.COMPANY, "CompanyXYZ")
+                .putNull(Organization.DEPARTMENT)
+                .put(Organization.TITLE, "TitleXYZYX");
 
         VCardVerificationHandler handler = new VCardVerificationHandler(this, version);
 
         // Currently we do not use group but depend on the order.
-        handler.addNewVerifierWithEmptyName()
-            .addNodeWithOrder("ORG", "CompanyX;DepartmentY",
-                    Arrays.asList("CompanyX", "DepartmentY"))
-            .addNodeWithOrder("TITLE", "TitleZ")
-            .addNodeWithOrder("ORG", "DepartmentXX")
-            .addNodeWithOrder("ORG", "CompanyXYZ")
-            .addNodeWithOrder("TITLE", "TitleXYZYX");
+        handler.addPropertyVerifierWithEmptyName()
+                .addNodeWithOrder("ORG", "CompanyX;DepartmentY",
+                        Arrays.asList("CompanyX", "DepartmentY"))
+                .addNodeWithOrder("TITLE", "TitleZ")
+                .addNodeWithOrder("ORG", "DepartmentXX")
+                .addNodeWithOrder("ORG", "CompanyXYZ")
+                .addNodeWithOrder("TITLE", "TitleXYZYX");
 
         verifyOneComposition(resolver, handler, version);
     }
@@ -671,55 +672,55 @@ public class VCardExporterTests extends VCardTestsBase {
     private void testImVariousTypeSupportCommon(int version) {
         ExportTestResolver resolver = new ExportTestResolver();
 
-        ContentValues contentValues = resolver.buildData(Im.CONTENT_ITEM_TYPE);
-        contentValues.put(Im.PROTOCOL, Im.PROTOCOL_AIM);
-        contentValues.put(Im.DATA, "aim");
+        resolver.buildInput(Im.CONTENT_ITEM_TYPE)
+                .put(Im.PROTOCOL, Im.PROTOCOL_AIM)
+                .put(Im.DATA, "aim");
 
-        contentValues = resolver.buildData(Im.CONTENT_ITEM_TYPE);
-        contentValues.put(Im.PROTOCOL, Im.PROTOCOL_MSN);
-        contentValues.put(Im.DATA, "msn");
+        resolver.buildInput(Im.CONTENT_ITEM_TYPE)
+                .put(Im.PROTOCOL, Im.PROTOCOL_MSN)
+                .put(Im.DATA, "msn");
 
-        contentValues = resolver.buildData(Im.CONTENT_ITEM_TYPE);
-        contentValues.put(Im.PROTOCOL, Im.PROTOCOL_YAHOO);
-        contentValues.put(Im.DATA, "yahoo");
+        resolver.buildInput(Im.CONTENT_ITEM_TYPE)
+                .put(Im.PROTOCOL, Im.PROTOCOL_YAHOO)
+                .put(Im.DATA, "yahoo");
 
-        contentValues = resolver.buildData(Im.CONTENT_ITEM_TYPE);
-        contentValues.put(Im.PROTOCOL, Im.PROTOCOL_SKYPE);
-        contentValues.put(Im.DATA, "skype");
+        resolver.buildInput(Im.CONTENT_ITEM_TYPE)
+                .put(Im.PROTOCOL, Im.PROTOCOL_SKYPE)
+                .put(Im.DATA, "skype");
 
-        contentValues = resolver.buildData(Im.CONTENT_ITEM_TYPE);
-        contentValues.put(Im.PROTOCOL, Im.PROTOCOL_QQ);
-        contentValues.put(Im.DATA, "qq");
+        resolver.buildInput(Im.CONTENT_ITEM_TYPE)
+                .put(Im.PROTOCOL, Im.PROTOCOL_QQ)
+                .put(Im.DATA, "qq");
 
-        contentValues = resolver.buildData(Im.CONTENT_ITEM_TYPE);
-        contentValues.put(Im.PROTOCOL, Im.PROTOCOL_GOOGLE_TALK);
-        contentValues.put(Im.DATA, "google talk");
+        resolver.buildInput(Im.CONTENT_ITEM_TYPE)
+                .put(Im.PROTOCOL, Im.PROTOCOL_GOOGLE_TALK)
+                .put(Im.DATA, "google talk");
 
-        contentValues = resolver.buildData(Im.CONTENT_ITEM_TYPE);
-        contentValues.put(Im.PROTOCOL, Im.PROTOCOL_ICQ);
-        contentValues.put(Im.DATA, "icq");
+        resolver.buildInput(Im.CONTENT_ITEM_TYPE)
+                .put(Im.PROTOCOL, Im.PROTOCOL_ICQ)
+                .put(Im.DATA, "icq");
 
-        contentValues = resolver.buildData(Im.CONTENT_ITEM_TYPE);
-        contentValues.put(Im.PROTOCOL, Im.PROTOCOL_JABBER);
-        contentValues.put(Im.DATA, "jabber");
+        resolver.buildInput(Im.CONTENT_ITEM_TYPE)
+                .put(Im.PROTOCOL, Im.PROTOCOL_JABBER)
+                .put(Im.DATA, "jabber");
 
-        contentValues = resolver.buildData(Im.CONTENT_ITEM_TYPE);
-        contentValues.put(Im.PROTOCOL, Im.PROTOCOL_NETMEETING);
-        contentValues.put(Im.DATA, "netmeeting");
+        resolver.buildInput(Im.CONTENT_ITEM_TYPE)
+                .put(Im.PROTOCOL, Im.PROTOCOL_NETMEETING)
+                .put(Im.DATA, "netmeeting");
 
         // No determined way to express unknown type...
 
         VCardVerificationHandler handler = new VCardVerificationHandler(this, version);
-        handler.addNewVerifierWithEmptyName()
-            .addNodeWithoutOrder("X-JABBER", "jabber")
-            .addNodeWithoutOrder("X-ICQ", "icq")
-            .addNodeWithoutOrder("X-GOOGLE-TALK", "google talk")
-            .addNodeWithoutOrder("X-QQ", "qq")
-            .addNodeWithoutOrder("X-SKYPE-USERNAME", "skype")
-            .addNodeWithoutOrder("X-YAHOO", "yahoo")
-            .addNodeWithoutOrder("X-MSN", "msn")
-            .addNodeWithoutOrder("X-NETMEETING", "netmeeting")
-            .addNodeWithoutOrder("X-AIM", "aim");
+        handler.addPropertyVerifierWithEmptyName()
+                .addNodeWithoutOrder("X-JABBER", "jabber")
+                .addNodeWithoutOrder("X-ICQ", "icq")
+                .addNodeWithoutOrder("X-GOOGLE-TALK", "google talk")
+                .addNodeWithoutOrder("X-QQ", "qq")
+                .addNodeWithoutOrder("X-SKYPE-USERNAME", "skype")
+                .addNodeWithoutOrder("X-YAHOO", "yahoo")
+                .addNodeWithoutOrder("X-MSN", "msn")
+                .addNodeWithoutOrder("X-NETMEETING", "netmeeting")
+                .addNodeWithoutOrder("X-AIM", "aim");
 
         verifyOneComposition(resolver, handler, version);
     }
@@ -735,20 +736,20 @@ public class VCardExporterTests extends VCardTestsBase {
     private void testImPrefHandlingCommon(int version) {
         ExportTestResolver resolver = new ExportTestResolver();
 
-        ContentValues contentValues = resolver.buildData(Im.CONTENT_ITEM_TYPE);
-        contentValues.put(Im.PROTOCOL, Im.PROTOCOL_AIM);
-        contentValues.put(Im.DATA, "aim1");
+        resolver.buildInput(Im.CONTENT_ITEM_TYPE)
+                .put(Im.PROTOCOL, Im.PROTOCOL_AIM)
+                .put(Im.DATA, "aim1");
 
-        contentValues = resolver.buildData(Im.CONTENT_ITEM_TYPE);
-        contentValues.put(Im.PROTOCOL, Im.PROTOCOL_AIM);
-        contentValues.put(Im.DATA, "aim2");
-        contentValues.put(Im.TYPE, Im.TYPE_HOME);
-        contentValues.put(Im.IS_PRIMARY, 1);
+        resolver.buildInput(Im.CONTENT_ITEM_TYPE)
+                .put(Im.PROTOCOL, Im.PROTOCOL_AIM)
+                .put(Im.DATA, "aim2")
+                .put(Im.TYPE, Im.TYPE_HOME)
+                .put(Im.IS_PRIMARY, 1);
 
         VCardVerificationHandler handler = new VCardVerificationHandler(this, version);
-        handler.addNewVerifierWithEmptyName()
-            .addNodeWithoutOrder("X-AIM", "aim1")
-            .addNodeWithoutOrder("X-AIM", "aim2", new TypeSet("HOME", "PREF"));
+        handler.addPropertyVerifierWithEmptyName()
+                .addNodeWithoutOrder("X-AIM", "aim1")
+                .addNodeWithoutOrder("X-AIM", "aim2", new TypeSet("HOME", "PREF"));
 
         verifyOneComposition(resolver, handler, version);
     }
@@ -764,19 +765,19 @@ public class VCardExporterTests extends VCardTestsBase {
     private void testWebsiteCommon(int version) {
         ExportTestResolver resolver = new ExportTestResolver();
 
-        ContentValues contentValues = resolver.buildData(Website.CONTENT_ITEM_TYPE);
-        contentValues.put(Website.URL, "http://website.example.android.com/index.html");
-        contentValues.put(Website.TYPE, Website.TYPE_BLOG);
+        resolver.buildInput(Website.CONTENT_ITEM_TYPE)
+                .put(Website.URL, "http://website.example.android.com/index.html")
+                .put(Website.TYPE, Website.TYPE_BLOG);
 
-        contentValues = resolver.buildData(Website.CONTENT_ITEM_TYPE);
-        contentValues.put(Website.URL, "ftp://ftp.example.android.com/index.html");
-        contentValues.put(Website.TYPE, Website.TYPE_FTP);
+        resolver.buildInput(Website.CONTENT_ITEM_TYPE)
+                .put(Website.URL, "ftp://ftp.example.android.com/index.html")
+                .put(Website.TYPE, Website.TYPE_FTP);
 
         // We drop TYPE information since vCard (especially 3.0) does not allow us to emit it.
         VCardVerificationHandler handler = new VCardVerificationHandler(this, version);
-        handler.addNewVerifierWithEmptyName()
-            .addNodeWithoutOrder("URL", "ftp://ftp.example.android.com/index.html")
-            .addNodeWithoutOrder("URL", "http://website.example.android.com/index.html");
+        handler.addPropertyVerifierWithEmptyName()
+                .addNodeWithoutOrder("URL", "ftp://ftp.example.android.com/index.html")
+                .addNodeWithoutOrder("URL", "http://website.example.android.com/index.html");
 
         verifyOneComposition(resolver, handler, version);
     }
@@ -792,30 +793,30 @@ public class VCardExporterTests extends VCardTestsBase {
     private void testEventCommon(int version) {
         ExportTestResolver resolver = new ExportTestResolver();
 
-        ContentValues contentValues = resolver.buildData(Event.CONTENT_ITEM_TYPE);
-        contentValues.put(Event.TYPE, Event.TYPE_ANNIVERSARY);
-        contentValues.put(Event.START_DATE, "1982-06-16");
+        resolver.buildInput(Event.CONTENT_ITEM_TYPE)
+                .put(Event.TYPE, Event.TYPE_ANNIVERSARY)
+                .put(Event.START_DATE, "1982-06-16");
 
-        contentValues = resolver.buildData(Event.CONTENT_ITEM_TYPE);
-        contentValues.put(Event.TYPE, Event.TYPE_BIRTHDAY);
-        contentValues.put(Event.START_DATE, "2008-10-22");
+        resolver.buildInput(Event.CONTENT_ITEM_TYPE)
+                .put(Event.TYPE, Event.TYPE_BIRTHDAY)
+                .put(Event.START_DATE, "2008-10-22");
 
-        contentValues = resolver.buildData(Event.CONTENT_ITEM_TYPE);
-        contentValues.put(Event.TYPE, Event.TYPE_OTHER);
-        contentValues.put(Event.START_DATE, "2018-03-12");
+        resolver.buildInput(Event.CONTENT_ITEM_TYPE)
+                .put(Event.TYPE, Event.TYPE_OTHER)
+                .put(Event.START_DATE, "2018-03-12");
 
-        contentValues = resolver.buildData(Event.CONTENT_ITEM_TYPE);
-        contentValues.put(Event.TYPE, Event.TYPE_CUSTOM);
-        contentValues.put(Event.LABEL, "The last day");
-        contentValues.put(Event.START_DATE, "When the Tower of Hanoi with 64 rings is completed.");
+        resolver.buildInput(Event.CONTENT_ITEM_TYPE)
+                .put(Event.TYPE, Event.TYPE_CUSTOM)
+                .put(Event.LABEL, "The last day")
+                .put(Event.START_DATE, "When the Tower of Hanoi with 64 rings is completed.");
 
-        contentValues = resolver.buildData(Event.CONTENT_ITEM_TYPE);
-        contentValues.put(Event.TYPE, Event.TYPE_BIRTHDAY);
-        contentValues.put(Event.START_DATE, "2009-05-19");
+        resolver.buildInput(Event.CONTENT_ITEM_TYPE)
+                .put(Event.TYPE, Event.TYPE_BIRTHDAY)
+                .put(Event.START_DATE, "2009-05-19");
 
         VCardVerificationHandler handler = new VCardVerificationHandler(this, version);
-        handler.addNewVerifierWithEmptyName()
-            .addNodeWithoutOrder("BDAY", "2008-10-22");
+        handler.addPropertyVerifierWithEmptyName()
+                .addNodeWithoutOrder("BDAY", "2008-10-22");
 
         verifyOneComposition(resolver, handler, version);
     }
@@ -831,17 +832,17 @@ public class VCardExporterTests extends VCardTestsBase {
     private void testNoteCommon(int version) {
         ExportTestResolver resolver = new ExportTestResolver();
 
-        ContentValues contentValues = resolver.buildData(Note.CONTENT_ITEM_TYPE);
-        contentValues.put(Note.NOTE, "note1");
+        resolver.buildInput(Note.CONTENT_ITEM_TYPE)
+                .put(Note.NOTE, "note1");
 
-        contentValues = resolver.buildData(Note.CONTENT_ITEM_TYPE);
-        contentValues.put(Note.NOTE, "note2");
-        contentValues.put(Note.IS_PRIMARY, 1);  // Just ignored.
+        resolver.buildInput(Note.CONTENT_ITEM_TYPE)
+                .put(Note.NOTE, "note2")
+                .put(Note.IS_PRIMARY, 1);  // Just ignored.
 
         VCardVerificationHandler handler = new VCardVerificationHandler(this, version);
-        handler.addNewVerifierWithEmptyName()
-            .addNodeWithOrder("NOTE", "note1")
-            .addNodeWithOrder("NOTE", "note2");
+        handler.addPropertyVerifierWithEmptyName()
+                .addNodeWithOrder("NOTE", "note1")
+                .addNodeWithOrder("NOTE", "note2");
 
         verifyOneComposition(resolver, handler, version);
     }
@@ -857,20 +858,21 @@ public class VCardExporterTests extends VCardTestsBase {
     private void testPhotoCommon(int version) {
         final boolean isV30 = version == V30;
         ExportTestResolver resolver = new ExportTestResolver();
-        ContentValues contentValues = resolver.buildData(StructuredName.CONTENT_ITEM_TYPE);
-        contentValues.put(StructuredName.FAMILY_NAME, "PhotoTest");
+        resolver.buildInput(StructuredName.CONTENT_ITEM_TYPE)
+                .put(StructuredName.FAMILY_NAME, "PhotoTest");
 
-        contentValues = resolver.buildData(Photo.CONTENT_ITEM_TYPE);
-        contentValues.put(Photo.PHOTO, sPhotoByteArray);
+        resolver.buildInput(Photo.CONTENT_ITEM_TYPE)
+                .put(Photo.PHOTO, sPhotoByteArray);
 
         ContentValues contentValuesForPhoto = new ContentValues();
         contentValuesForPhoto.put("ENCODING", (isV30 ? "b" : "BASE64"));
         VCardVerificationHandler handler = new VCardVerificationHandler(this, version);
-        handler.addNewVerifier()
-            .addNodeWithoutOrder("FN", "PhotoTest")
-            .addNodeWithoutOrder("N", "PhotoTest;;;;", Arrays.asList("PhotoTest", "", "", "", ""))
-            .addNodeWithOrder("PHOTO", null, null, sPhotoByteArray,
-                    contentValuesForPhoto, new TypeSet("JPEG"), null);
+        handler.addPropertyNodesVerifier()
+                .addNodeWithoutOrder("FN", "PhotoTest")
+                .addNodeWithoutOrder("N", "PhotoTest;;;;",
+                        Arrays.asList("PhotoTest", "", "", "", ""))
+                .addNodeWithOrder("PHOTO", null, null, sPhotoByteArray,
+                        contentValuesForPhoto, new TypeSet("JPEG"), null);
 
         verifyOneComposition(resolver, handler, version);
     }
@@ -886,19 +888,19 @@ public class VCardExporterTests extends VCardTestsBase {
     public void testV30HandleEscape() {
         final int version = V30;
         ExportTestResolver resolver = new ExportTestResolver();
-        ContentValues contentValues = resolver.buildData(StructuredName.CONTENT_ITEM_TYPE);
-        contentValues.put(StructuredName.FAMILY_NAME, "\\");
-        contentValues.put(StructuredName.GIVEN_NAME, ";");
-        contentValues.put(StructuredName.MIDDLE_NAME, ",");
-        contentValues.put(StructuredName.PREFIX, "\n");
-        contentValues.put(StructuredName.DISPLAY_NAME, "[<{Unescaped:Asciis}>]");
+        resolver.buildInput(StructuredName.CONTENT_ITEM_TYPE)
+                .put(StructuredName.FAMILY_NAME, "\\")
+                .put(StructuredName.GIVEN_NAME, ";")
+                .put(StructuredName.MIDDLE_NAME, ",")
+                .put(StructuredName.PREFIX, "\n")
+                .put(StructuredName.DISPLAY_NAME, "[<{Unescaped:Asciis}>]");
         VCardVerificationHandler handler = new VCardVerificationHandler(this, version);
         // Verifies the vCard String correctly escapes each character which must be escaped.
         handler.addExpectedLine("N:\\\\;\\;;\\,;\\n;")
-            .addExpectedLine("FN:[<{Unescaped:Asciis}>]");
-        handler.addNewVerifier()
-            .addNodeWithoutOrder("FN", "[<{Unescaped:Asciis}>]")
-            .addNodeWithoutOrder("N", Arrays.asList("\\", ";", ",", "\n", ""));
+                .addExpectedLine("FN:[<{Unescaped:Asciis}>]");
+        handler.addPropertyNodesVerifier()
+                .addNodeWithoutOrder("FN", "[<{Unescaped:Asciis}>]")
+                .addNodeWithoutOrder("N", Arrays.asList("\\", ";", ",", "\n", ""));
 
         verifyOneComposition(resolver, handler, version);
     }
@@ -910,17 +912,17 @@ public class VCardExporterTests extends VCardTestsBase {
      */
     public void testNickNameV21() {
         ExportTestResolver resolver = new ExportTestResolver();
-        ContentValues contentValues = resolver.buildData(Nickname.CONTENT_ITEM_TYPE);
-        contentValues.put(Nickname.NAME, "Nicky");
+        resolver.buildInput(Nickname.CONTENT_ITEM_TYPE)
+                .put(Nickname.NAME, "Nicky");
 
-        ContactStructVerifier verifier = new ContactStructVerifier();
-        contentValues = verifier.createExpected(Nickname.CONTENT_ITEM_TYPE);
-        contentValues.put(Nickname.NAME, "Nicky");
+        VCardVerificationHandler handler = new VCardVerificationHandler(this, V21);
+        handler.addPropertyVerifierWithEmptyName()
+                .addNodeWithOrder("X-ANDROID-CUSTOM",
+                        Nickname.CONTENT_ITEM_TYPE + ";Nicky;;;;;;;;;;;;;;");
 
-        VCardVerificationHandler handler = new VCardVerificationHandler(this, verifier, V21);
-        handler.addNewVerifierWithEmptyName()
-            .addNodeWithOrder("X-ANDROID-CUSTOM",
-                    Nickname.CONTENT_ITEM_TYPE + ";Nicky;;;;;;;;;;;;;;");
+        handler.addContentValuesVerifier()
+                .buildExpected(Nickname.CONTENT_ITEM_TYPE)
+                        .put(Nickname.NAME, "Nicky");
 
         verifyOneComposition(resolver, handler, V21);
     }
index 4f2fa0a..0a20310 100644 (file)
@@ -417,49 +417,46 @@ public class VCardImporterTests extends VCardTestsBase {
         is.close();
         assertEquals(1, builder.vNodeList.size());
         PropertyNodesVerifier verifier = new PropertyNodesVerifier(this)
-            .addNodeWithOrder("N", "Ando;Roid;", Arrays.asList("Ando", "Roid", ""));
+                .addNodeWithOrder("N", "Ando;Roid;", Arrays.asList("Ando", "Roid", ""));
         verifier.verify(builder.vNodeList.get(0));
     }
 
     public void testV21SimpleCase1_Type_Generic() throws IOException, VCardException {
-        ContactStructVerifier verifier = new ContactStructVerifier();
-        ContentValues contentValues =
-            verifier.createExpected(StructuredName.CONTENT_ITEM_TYPE);
-        contentValues.put(StructuredName.FAMILY_NAME, "Ando");
-        contentValues.put(StructuredName.GIVEN_NAME, "Roid");
-        contentValues.put(StructuredName.DISPLAY_NAME, "Roid Ando");
+        ContentValuesVerifier verifier = new ContentValuesVerifier();
+        verifier.buildExpected(StructuredName.CONTENT_ITEM_TYPE)
+                .put(StructuredName.FAMILY_NAME, "Ando")
+                .put(StructuredName.GIVEN_NAME, "Roid")
+                .put(StructuredName.DISPLAY_NAME, "Roid Ando");
         verifier.verify(R.raw.v21_simple_1, VCardConfig.VCARD_TYPE_V21_GENERIC_UTF8);
     }
 
     public void testV21SimpleCase1_Type_Japanese() throws IOException, VCardException {
-        ContactStructVerifier verifier = new ContactStructVerifier();
-        ContentValues contentValues =
-            verifier.createExpected(StructuredName.CONTENT_ITEM_TYPE);
-        contentValues.put(StructuredName.FAMILY_NAME, "Ando");
-        contentValues.put(StructuredName.GIVEN_NAME, "Roid");
-        // If name-related strings only contains printable Ascii, the order is remained to be US's:
-        // "Prefix Given Middle Family Suffix"
-        contentValues.put(StructuredName.DISPLAY_NAME, "Roid Ando");
+        ContentValuesVerifier verifier = new ContentValuesVerifier();
+        verifier.buildExpected(StructuredName.CONTENT_ITEM_TYPE)
+                .put(StructuredName.FAMILY_NAME, "Ando")
+                .put(StructuredName.GIVEN_NAME, "Roid")
+                // If name-related strings only contains printable Ascii,
+                // the order is remained to be US's:
+                // "Prefix Given Middle Family Suffix"
+                .put(StructuredName.DISPLAY_NAME, "Roid Ando");
         verifier.verify(R.raw.v21_simple_1, VCardConfig.VCARD_TYPE_V21_JAPANESE_SJIS);
     }
 
     public void testV21SimpleCase2() throws IOException, VCardException {
-        ContactStructVerifier verifier = new ContactStructVerifier();
-        ContentValues contentValues =
-            verifier.createExpected(StructuredName.CONTENT_ITEM_TYPE);
-        contentValues.put(StructuredName.DISPLAY_NAME, "Ando Roid");
+        ContentValuesVerifier verifier = new ContentValuesVerifier();
+        verifier.buildExpected(StructuredName.CONTENT_ITEM_TYPE)
+                .put(StructuredName.DISPLAY_NAME, "Ando Roid");
         verifier.verify(R.raw.v21_simple_2, VCardConfig.VCARD_TYPE_V21_GENERIC_UTF8);
     }
 
     public void testV21SimpleCase3() throws IOException, VCardException {
-        ContactStructVerifier verifier = new ContactStructVerifier();
-        ContentValues contentValues =
-            verifier.createExpected(StructuredName.CONTENT_ITEM_TYPE);
-        contentValues.put(StructuredName.FAMILY_NAME, "Ando");
-        contentValues.put(StructuredName.GIVEN_NAME, "Roid");
-        // "FN" field should be prefered since it should contain the original order intended by
-        // the author of the file.
-        contentValues.put(StructuredName.DISPLAY_NAME, "Ando Roid");
+        ContentValuesVerifier verifier = new ContentValuesVerifier();
+        verifier.buildExpected(StructuredName.CONTENT_ITEM_TYPE)
+                .put(StructuredName.FAMILY_NAME, "Ando")
+                .put(StructuredName.GIVEN_NAME, "Roid")
+                // "FN" field should be prefered since it should contain the original order
+                // intended by the author of the file.
+                .put(StructuredName.DISPLAY_NAME, "Ando Roid");
         verifier.verify(R.raw.v21_simple_3, VCardConfig.VCARD_TYPE_V21_GENERIC_UTF8);
     }
 
@@ -474,10 +471,10 @@ public class VCardImporterTests extends VCardTestsBase {
         is.close();
         assertEquals(1, builder.vNodeList.size());
         PropertyNodesVerifier verifier = new PropertyNodesVerifier(this)
-            .addNodeWithOrder("VERSION", "2.1")
-            .addNodeWithOrder("N", ";A;B\\;C\\;;D;:E;\\\\;",
-                    Arrays.asList("", "A;B\\", "C\\;", "D", ":E", "\\\\", ""))
-            .addNodeWithOrder("FN", "A;B\\C\\;D:E\\\\");
+                .addNodeWithOrder("VERSION", "2.1")
+                .addNodeWithOrder("N", ";A;B\\;C\\;;D;:E;\\\\;",
+                        Arrays.asList("", "A;B\\", "C\\;", "D", ":E", "\\\\", ""))
+                .addNodeWithOrder("FN", "A;B\\C\\;D:E\\\\");
         verifier.verify(builder.vNodeList.get(0));
     }
 
@@ -486,43 +483,40 @@ public class VCardImporterTests extends VCardTestsBase {
      * inserts name related data.
      */
     public void testV21BackslashCase() throws IOException, VCardException {
-        ContactStructVerifier verifier = new ContactStructVerifier();
-        ContentValues contentValues =
-            verifier.createExpected(StructuredName.CONTENT_ITEM_TYPE);
-        // FAMILY_NAME is empty and removed in this test...
-        contentValues.put(StructuredName.GIVEN_NAME, "A;B\\");
-        contentValues.put(StructuredName.MIDDLE_NAME, "C\\;");
-        contentValues.put(StructuredName.PREFIX, "D");
-        contentValues.put(StructuredName.SUFFIX, ":E");
-        contentValues.put(StructuredName.DISPLAY_NAME, "A;B\\C\\;D:E\\\\");
+        ContentValuesVerifier verifier = new ContentValuesVerifier();
+        verifier.buildExpected(StructuredName.CONTENT_ITEM_TYPE)
+                // FAMILY_NAME is empty and removed in this test...
+                .put(StructuredName.GIVEN_NAME, "A;B\\")
+                .put(StructuredName.MIDDLE_NAME, "C\\;")
+                .put(StructuredName.PREFIX, "D")
+                .put(StructuredName.SUFFIX, ":E")
+                .put(StructuredName.DISPLAY_NAME, "A;B\\C\\;D:E\\\\");
         verifier.verify(R.raw.v21_backslash, VCardConfig.VCARD_TYPE_V21_GENERIC_UTF8);
     }
 
     public void testOrgBeforTitle() throws IOException, VCardException {
-        ContactStructVerifier verifier = new ContactStructVerifier();
-        ContentValues contentValues =
-            verifier.createExpected(StructuredName.CONTENT_ITEM_TYPE);
-        contentValues.put(StructuredName.DISPLAY_NAME, "Normal Guy");
-
-        contentValues = verifier.createExpected(Organization.CONTENT_ITEM_TYPE);
-        contentValues.put(Organization.COMPANY, "Company");
-        contentValues.put(Organization.DEPARTMENT, "Organization Devision Room Sheet No.");
-        contentValues.put(Organization.TITLE, "Excellent Janitor");
-        contentValues.put(Organization.TYPE, Organization.TYPE_WORK);
+        ContentValuesVerifier verifier = new ContentValuesVerifier();
+        verifier.buildExpected(StructuredName.CONTENT_ITEM_TYPE)
+                .put(StructuredName.DISPLAY_NAME, "Normal Guy");
+
+        verifier.buildExpected(Organization.CONTENT_ITEM_TYPE)
+                .put(Organization.COMPANY, "Company")
+                .put(Organization.DEPARTMENT, "Organization Devision Room Sheet No.")
+                .put(Organization.TITLE, "Excellent Janitor")
+                .put(Organization.TYPE, Organization.TYPE_WORK);
         verifier.verify(R.raw.v21_org_before_title, VCardConfig.VCARD_TYPE_V21_GENERIC_UTF8);
     }
 
     public void testTitleBeforOrg() throws IOException, VCardException {
-        ContactStructVerifier verifier = new ContactStructVerifier();
-        ContentValues contentValues =
-            verifier.createExpected(StructuredName.CONTENT_ITEM_TYPE);
-        contentValues.put(StructuredName.DISPLAY_NAME, "Nice Guy");
-
-        contentValues = verifier.createExpected(Organization.CONTENT_ITEM_TYPE);
-        contentValues.put(Organization.COMPANY, "Marverous");
-        contentValues.put(Organization.DEPARTMENT, "Perfect Great Good Bad Poor");
-        contentValues.put(Organization.TITLE, "Cool Title");
-        contentValues.put(Organization.TYPE, Organization.TYPE_WORK);
+        ContentValuesVerifier verifier = new ContentValuesVerifier();
+        verifier.buildExpected(StructuredName.CONTENT_ITEM_TYPE)
+                .put(StructuredName.DISPLAY_NAME, "Nice Guy");
+
+        verifier.buildExpected(Organization.CONTENT_ITEM_TYPE)
+                .put(Organization.COMPANY, "Marverous")
+                .put(Organization.DEPARTMENT, "Perfect Great Good Bad Poor")
+                .put(Organization.TITLE, "Cool Title")
+                .put(Organization.TYPE, Organization.TYPE_WORK);
         verifier.verify(R.raw.v21_title_before_org, VCardConfig.VCARD_TYPE_V21_GENERIC_UTF8);
     }
 
@@ -531,49 +525,48 @@ public class VCardImporterTests extends VCardTestsBase {
      * The data contain three cases: one "PREF", no "PREF" and multiple "PREF", in each type.
      */
     public void testV21PrefToIsPrimary() throws IOException, VCardException {
-        ContactStructVerifier verifier = new ContactStructVerifier();
-        ContentValues contentValues =
-            verifier.createExpected(StructuredName.CONTENT_ITEM_TYPE);
-        contentValues.put(Data.MIMETYPE, StructuredName.CONTENT_ITEM_TYPE);
-        contentValues.put(StructuredName.DISPLAY_NAME, "Smith");
-
-        contentValues = verifier.createExpected(Phone.CONTENT_ITEM_TYPE);
-        contentValues.put(Phone.NUMBER, "1");
-        contentValues.put(Phone.TYPE, Phone.TYPE_HOME);
-
-        contentValues = verifier.createExpected(Phone.CONTENT_ITEM_TYPE);
-        contentValues.put(Phone.NUMBER, "2");
-        contentValues.put(Phone.TYPE, Phone.TYPE_WORK);
-        contentValues.put(Phone.IS_PRIMARY, 1);
-
-        contentValues = verifier.createExpected(Phone.CONTENT_ITEM_TYPE);
-        contentValues.put(Phone.NUMBER, "3");
-        contentValues.put(Phone.TYPE, Phone.TYPE_ISDN);
-
-        contentValues = verifier.createExpected(Email.CONTENT_ITEM_TYPE);
-        contentValues.put(Email.DATA, "test@example.com");
-        contentValues.put(Email.TYPE, Email.TYPE_HOME);
-        contentValues.put(Email.IS_PRIMARY, 1);
-
-        contentValues = verifier.createExpected(Email.CONTENT_ITEM_TYPE);
-        contentValues.put(Email.DATA, "test2@examination.com");
-        contentValues.put(Email.TYPE, Email.TYPE_MOBILE);
-        contentValues.put(Email.IS_PRIMARY, 1);
-
-        contentValues = verifier.createExpected(Organization.CONTENT_ITEM_TYPE);
-        contentValues.put(Organization.COMPANY, "Company");
-        contentValues.put(Organization.TITLE, "Engineer");
-        contentValues.put(Organization.TYPE, Organization.TYPE_WORK);
-
-        contentValues = verifier.createExpected(Organization.CONTENT_ITEM_TYPE);
-        contentValues.put(Organization.COMPANY, "Mystery");
-        contentValues.put(Organization.TITLE, "Blogger");
-        contentValues.put(Organization.TYPE, Organization.TYPE_WORK);
-
-        contentValues = verifier.createExpected(Organization.CONTENT_ITEM_TYPE);
-        contentValues.put(Organization.COMPANY, "Poetry");
-        contentValues.put(Organization.TITLE, "Poet");
-        contentValues.put(Organization.TYPE, Organization.TYPE_WORK);
+        ContentValuesVerifier verifier = new ContentValuesVerifier();
+        verifier.buildExpected(StructuredName.CONTENT_ITEM_TYPE)
+                .put(Data.MIMETYPE, StructuredName.CONTENT_ITEM_TYPE)
+                .put(StructuredName.DISPLAY_NAME, "Smith");
+
+        verifier.buildExpected(Phone.CONTENT_ITEM_TYPE)
+                .put(Phone.NUMBER, "1")
+                .put(Phone.TYPE, Phone.TYPE_HOME);
+
+        verifier.buildExpected(Phone.CONTENT_ITEM_TYPE)
+                .put(Phone.NUMBER, "2")
+                .put(Phone.TYPE, Phone.TYPE_WORK)
+                .put(Phone.IS_PRIMARY, 1);
+
+        verifier.buildExpected(Phone.CONTENT_ITEM_TYPE)
+                .put(Phone.NUMBER, "3")
+                .put(Phone.TYPE, Phone.TYPE_ISDN);
+
+        verifier.buildExpected(Email.CONTENT_ITEM_TYPE)
+                .put(Email.DATA, "test@example.com")
+                .put(Email.TYPE, Email.TYPE_HOME)
+                .put(Email.IS_PRIMARY, 1);
+
+        verifier.buildExpected(Email.CONTENT_ITEM_TYPE)
+                .put(Email.DATA, "test2@examination.com")
+                .put(Email.TYPE, Email.TYPE_MOBILE)
+                .put(Email.IS_PRIMARY, 1);
+
+        verifier.buildExpected(Organization.CONTENT_ITEM_TYPE)
+                .put(Organization.COMPANY, "Company")
+                .put(Organization.TITLE, "Engineer")
+                .put(Organization.TYPE, Organization.TYPE_WORK);
+
+        verifier.buildExpected(Organization.CONTENT_ITEM_TYPE)
+                .put(Organization.COMPANY, "Mystery")
+                .put(Organization.TITLE, "Blogger")
+                .put(Organization.TYPE, Organization.TYPE_WORK);
+
+        verifier.buildExpected(Organization.CONTENT_ITEM_TYPE)
+                .put(Organization.COMPANY, "Poetry")
+                .put(Organization.TITLE, "Poet")
+                .put(Organization.TYPE, Organization.TYPE_WORK);
         verifier.verify(R.raw.v21_pref_handling, VCardConfig.VCARD_TYPE_V21_GENERIC_UTF8);
     }
 
@@ -592,50 +585,52 @@ public class VCardImporterTests extends VCardTestsBase {
         ContentValues contentValuesForPhoto = new ContentValues();
         contentValuesForPhoto.put("ENCODING", "BASE64");
         PropertyNodesVerifier verifier = new PropertyNodesVerifier(this)
-            .addNodeWithOrder("VERSION", "2.1")
-            .addNodeWithOrder("N", "Gump;Forrest;Hoge;Pos;Tao",
-                    Arrays.asList("Gump", "Forrest", "Hoge", "Pos", "Tao"))
-            .addNodeWithOrder("FN", "Joe Due")
-            .addNodeWithOrder("ORG", "Gump Shrimp Co.;Sales Dept.;Manager;Fish keeper",
-                    Arrays.asList("Gump Shrimp Co.", "Sales Dept.;Manager", "Fish keeper"))
-            .addNodeWithOrder("ROLE", "Fish Cake Keeper!")
-            .addNodeWithOrder("TITLE", "Shrimp Man")
-            .addNodeWithOrder("X-CLASS", "PUBLIC")
-            .addNodeWithOrder("TEL", "(111) 555-1212", new TypeSet("WORK", "VOICE"))
-            .addNodeWithOrder("TEL", "(404) 555-1212", new TypeSet("HOME", "VOICE"))
-            .addNodeWithOrder("TEL", "0311111111", new TypeSet("CELL"))
-            .addNodeWithOrder("TEL", "0322222222", new TypeSet("VIDEO"))
-            .addNodeWithOrder("TEL", "0333333333", new TypeSet("VOICE"))
-            .addNodeWithOrder("ADR", ";;100 Waters Edge;Baytown;LA;30314;United States of America",
-                    Arrays.asList("", "", "100 Waters Edge", "Baytown",
-                            "LA", "30314", "United States of America"),
-                            null, null, new TypeSet("WORK"), null)
-            .addNodeWithOrder("LABEL",
-                    "100 Waters Edge\r\nBaytown, LA 30314\r\nUnited  States of America",
-                    null, null, contentValuesForQP, new TypeSet("WORK"), null)
-            .addNodeWithOrder("ADR",
-                    ";;42 Plantation St.;Baytown;LA;30314;United States of America",
-                    Arrays.asList("", "", "42 Plantation St.", "Baytown",
-                            "LA", "30314", "United States of America"), null, null,
-                    new TypeSet("HOME"), null)
-            .addNodeWithOrder("LABEL",
-                    "42 Plantation St.\r\nBaytown, LA 30314\r\nUnited  States of America",
-                    null, null, contentValuesForQP,
-                    new TypeSet("HOME"), null)
-            .addNodeWithOrder("EMAIL", "forrestgump@walladalla.com", new TypeSet("PREF", "INTERNET"))
-            .addNodeWithOrder("EMAIL", "cell@example.com", new TypeSet("CELL"))
-            .addNodeWithOrder("NOTE", "The following note is the example from RFC 2045.")
-            .addNodeWithOrder("NOTE",
-                    "Now's the time for all folk to come to the aid of their country.",
-                    null, null, contentValuesForQP, null, null)
-            .addNodeWithOrder("PHOTO", null,
-                    null, sPhotoByteArrayForComplicatedCase, contentValuesForPhoto,
-                    new TypeSet("JPEG"), null)
-            .addNodeWithOrder("X-ATTRIBUTE", "Some String")
-            .addNodeWithOrder("BDAY", "19800101")
-            .addNodeWithOrder("GEO", "35.6563854,139.6994233")
-            .addNodeWithOrder("URL", "http://www.example.com/")
-            .addNodeWithOrder("REV", "20080424T195243Z");
+                .addNodeWithOrder("VERSION", "2.1")
+                .addNodeWithOrder("N", "Gump;Forrest;Hoge;Pos;Tao",
+                        Arrays.asList("Gump", "Forrest", "Hoge", "Pos", "Tao"))
+                .addNodeWithOrder("FN", "Joe Due")
+                .addNodeWithOrder("ORG", "Gump Shrimp Co.;Sales Dept.;Manager;Fish keeper",
+                        Arrays.asList("Gump Shrimp Co.", "Sales Dept.;Manager", "Fish keeper"))
+                .addNodeWithOrder("ROLE", "Fish Cake Keeper!")
+                .addNodeWithOrder("TITLE", "Shrimp Man")
+                .addNodeWithOrder("X-CLASS", "PUBLIC")
+                .addNodeWithOrder("TEL", "(111) 555-1212", new TypeSet("WORK", "VOICE"))
+                .addNodeWithOrder("TEL", "(404) 555-1212", new TypeSet("HOME", "VOICE"))
+                .addNodeWithOrder("TEL", "0311111111", new TypeSet("CELL"))
+                .addNodeWithOrder("TEL", "0322222222", new TypeSet("VIDEO"))
+                .addNodeWithOrder("TEL", "0333333333", new TypeSet("VOICE"))
+                .addNodeWithOrder("ADR",
+                        ";;100 Waters Edge;Baytown;LA;30314;United States of America",
+                        Arrays.asList("", "", "100 Waters Edge", "Baytown",
+                                "LA", "30314", "United States of America"),
+                                null, null, new TypeSet("WORK"), null)
+                .addNodeWithOrder("LABEL",
+                        "100 Waters Edge\r\nBaytown, LA 30314\r\nUnited  States of America",
+                        null, null, contentValuesForQP, new TypeSet("WORK"), null)
+                .addNodeWithOrder("ADR",
+                        ";;42 Plantation St.;Baytown;LA;30314;United States of America",
+                        Arrays.asList("", "", "42 Plantation St.", "Baytown",
+                                "LA", "30314", "United States of America"), null, null,
+                                new TypeSet("HOME"), null)
+                .addNodeWithOrder("LABEL",
+                        "42 Plantation St.\r\nBaytown, LA 30314\r\nUnited  States of America",
+                        null, null, contentValuesForQP,
+                        new TypeSet("HOME"), null)
+                .addNodeWithOrder("EMAIL", "forrestgump@walladalla.com",
+                        new TypeSet("PREF", "INTERNET"))
+                .addNodeWithOrder("EMAIL", "cell@example.com", new TypeSet("CELL"))
+                .addNodeWithOrder("NOTE", "The following note is the example from RFC 2045.")
+                .addNodeWithOrder("NOTE",
+                        "Now's the time for all folk to come to the aid of their country.",
+                        null, null, contentValuesForQP, null, null)
+                .addNodeWithOrder("PHOTO", null,
+                        null, sPhotoByteArrayForComplicatedCase, contentValuesForPhoto,
+                        new TypeSet("JPEG"), null)
+                .addNodeWithOrder("X-ATTRIBUTE", "Some String")
+                .addNodeWithOrder("BDAY", "19800101")
+                .addNodeWithOrder("GEO", "35.6563854,139.6994233")
+                .addNodeWithOrder("URL", "http://www.example.com/")
+                .addNodeWithOrder("REV", "20080424T195243Z");
         verifier.verify(builder.vNodeList.get(0));
     }
 
@@ -644,94 +639,93 @@ public class VCardImporterTests extends VCardTestsBase {
      * into ContentResolver.
      */
     public void testV21ComplicatedCase() throws IOException, VCardException {
-        ContactStructVerifier verifier = new ContactStructVerifier();
-        ContentValues contentValues =
-            verifier.createExpected(StructuredName.CONTENT_ITEM_TYPE);
-        contentValues.put(StructuredName.FAMILY_NAME, "Gump");
-        contentValues.put(StructuredName.GIVEN_NAME, "Forrest");
-        contentValues.put(StructuredName.MIDDLE_NAME, "Hoge");
-        contentValues.put(StructuredName.PREFIX, "Pos");
-        contentValues.put(StructuredName.SUFFIX, "Tao");
-        contentValues.put(StructuredName.DISPLAY_NAME, "Joe Due");
+        ContentValuesVerifier verifier = new ContentValuesVerifier();
+        verifier.buildExpected(StructuredName.CONTENT_ITEM_TYPE)
+                .put(StructuredName.FAMILY_NAME, "Gump")
+                .put(StructuredName.GIVEN_NAME, "Forrest")
+                .put(StructuredName.MIDDLE_NAME, "Hoge")
+                .put(StructuredName.PREFIX, "Pos")
+                .put(StructuredName.SUFFIX, "Tao")
+                .put(StructuredName.DISPLAY_NAME, "Joe Due");
         
-        contentValues = verifier.createExpected(Organization.CONTENT_ITEM_TYPE);
-        contentValues.put(Organization.TYPE, Organization.TYPE_WORK);
-        contentValues.put(Organization.COMPANY, "Gump Shrimp Co.");
-        contentValues.put(Organization.DEPARTMENT, "Sales Dept.;Manager Fish keeper");
-        contentValues.put(Organization.TITLE, "Shrimp Man");
-
-        contentValues = verifier.createExpected(Phone.CONTENT_ITEM_TYPE);
-        contentValues.put(Phone.TYPE, Phone.TYPE_WORK);
-        // Phone number is expected to be formated with NAMP format in default.
-        contentValues.put(Phone.NUMBER, "111-555-1212");
-
-        contentValues = verifier.createExpected(Phone.CONTENT_ITEM_TYPE);
-        contentValues.put(Phone.TYPE, Phone.TYPE_HOME);
-        contentValues.put(Phone.NUMBER, "404-555-1212");
-
-        contentValues = verifier.createExpected(Phone.CONTENT_ITEM_TYPE);
-        contentValues.put(Phone.TYPE, Phone.TYPE_MOBILE);
-        contentValues.put(Phone.NUMBER, "031-111-1111");
-
-        contentValues = verifier.createExpected(Phone.CONTENT_ITEM_TYPE);
-        contentValues.put(Phone.TYPE, Phone.TYPE_CUSTOM);
-        contentValues.put(Phone.LABEL, "VIDEO");
-        contentValues.put(Phone.NUMBER, "032-222-2222");
-
-        contentValues = verifier.createExpected(Phone.CONTENT_ITEM_TYPE);
-        contentValues.put(Phone.TYPE, Phone.TYPE_CUSTOM);
-        contentValues.put(Phone.LABEL, "VOICE");
-        contentValues.put(Phone.NUMBER, "033-333-3333");
-
-        contentValues = verifier.createExpected(StructuredPostal.CONTENT_ITEM_TYPE);
-        contentValues.put(StructuredPostal.TYPE, StructuredPostal.TYPE_WORK);
-        contentValues.put(StructuredPostal.COUNTRY, "United States of America");
-        contentValues.put(StructuredPostal.POSTCODE, "30314");
-        contentValues.put(StructuredPostal.REGION, "LA");
-        contentValues.put(StructuredPostal.CITY, "Baytown");
-        contentValues.put(StructuredPostal.STREET, "100 Waters Edge");
-        contentValues.put(StructuredPostal.FORMATTED_ADDRESS,
-                "100 Waters Edge Baytown LA 30314 United States of America");
-
-        contentValues = verifier.createExpected(StructuredPostal.CONTENT_ITEM_TYPE);
-        contentValues.put(StructuredPostal.TYPE, StructuredPostal.TYPE_HOME);
-        contentValues.put(StructuredPostal.COUNTRY, "United States of America");
-        contentValues.put(StructuredPostal.POSTCODE, "30314");
-        contentValues.put(StructuredPostal.REGION, "LA");
-        contentValues.put(StructuredPostal.CITY, "Baytown");
-        contentValues.put(StructuredPostal.STREET, "42 Plantation St.");
-        contentValues.put(StructuredPostal.FORMATTED_ADDRESS,
-                "42 Plantation St. Baytown LA 30314 United States of America");
-
-        contentValues = verifier.createExpected(Email.CONTENT_ITEM_TYPE);
-        // "TYPE=INTERNET" -> TYPE_CUSTOM + the label "INTERNET"
-        contentValues.put(Email.TYPE, Email.TYPE_CUSTOM);
-        contentValues.put(Email.LABEL, "INTERNET");
-        contentValues.put(Email.DATA, "forrestgump@walladalla.com");
-        contentValues.put(Email.IS_PRIMARY, 1);
-
-        contentValues = verifier.createExpected(Email.CONTENT_ITEM_TYPE);
-        contentValues.put(Email.TYPE, Email.TYPE_MOBILE);
-        contentValues.put(Email.DATA, "cell@example.com");
-
-        contentValues = verifier.createExpected(Note.CONTENT_ITEM_TYPE);
-        contentValues.put(Note.NOTE, "The following note is the example from RFC 2045.");
-
-        contentValues = verifier.createExpected(Note.CONTENT_ITEM_TYPE);
-        contentValues.put(Note.NOTE,
-                "Now's the time for all folk to come to the aid of their country.");
-
-        contentValues = verifier.createExpected(Photo.CONTENT_ITEM_TYPE);
-        // No information about its image format can be inserted.
-        contentValues.put(Photo.PHOTO, sPhotoByteArrayForComplicatedCase);
-
-        contentValues = verifier.createExpected(Event.CONTENT_ITEM_TYPE);
-        contentValues.put(Event.START_DATE, "19800101");
-        contentValues.put(Event.TYPE, Event.TYPE_BIRTHDAY);
-
-        contentValues = verifier.createExpected(Website.CONTENT_ITEM_TYPE);
-        contentValues.put(Website.URL, "http://www.example.com/");
-        contentValues.put(Website.TYPE, Website.TYPE_HOMEPAGE);
+        verifier.buildExpected(Organization.CONTENT_ITEM_TYPE)
+                .put(Organization.TYPE, Organization.TYPE_WORK)
+                .put(Organization.COMPANY, "Gump Shrimp Co.")
+                .put(Organization.DEPARTMENT, "Sales Dept.;Manager Fish keeper")
+                .put(Organization.TITLE, "Shrimp Man");
+
+        verifier.buildExpected(Phone.CONTENT_ITEM_TYPE)
+                .put(Phone.TYPE, Phone.TYPE_WORK)
+                // Phone number is expected to be formated with NAMP format in default.
+                .put(Phone.NUMBER, "111-555-1212");
+
+        verifier.buildExpected(Phone.CONTENT_ITEM_TYPE)
+                .put(Phone.TYPE, Phone.TYPE_HOME)
+                .put(Phone.NUMBER, "404-555-1212");
+
+        verifier.buildExpected(Phone.CONTENT_ITEM_TYPE)
+                .put(Phone.TYPE, Phone.TYPE_MOBILE)
+                .put(Phone.NUMBER, "031-111-1111");
+
+        verifier.buildExpected(Phone.CONTENT_ITEM_TYPE)
+                .put(Phone.TYPE, Phone.TYPE_CUSTOM)
+                .put(Phone.LABEL, "VIDEO")
+                .put(Phone.NUMBER, "032-222-2222");
+
+        verifier.buildExpected(Phone.CONTENT_ITEM_TYPE)
+                .put(Phone.TYPE, Phone.TYPE_CUSTOM)
+                .put(Phone.LABEL, "VOICE")
+                .put(Phone.NUMBER, "033-333-3333");
+
+        verifier.buildExpected(StructuredPostal.CONTENT_ITEM_TYPE)
+                .put(StructuredPostal.TYPE, StructuredPostal.TYPE_WORK)
+                .put(StructuredPostal.COUNTRY, "United States of America")
+                .put(StructuredPostal.POSTCODE, "30314")
+                .put(StructuredPostal.REGION, "LA")
+                .put(StructuredPostal.CITY, "Baytown")
+                .put(StructuredPostal.STREET, "100 Waters Edge")
+                .put(StructuredPostal.FORMATTED_ADDRESS,
+                        "100 Waters Edge Baytown LA 30314 United States of America");
+
+        verifier.buildExpected(StructuredPostal.CONTENT_ITEM_TYPE)
+                .put(StructuredPostal.TYPE, StructuredPostal.TYPE_HOME)
+                .put(StructuredPostal.COUNTRY, "United States of America")
+                .put(StructuredPostal.POSTCODE, "30314")
+                .put(StructuredPostal.REGION, "LA")
+                .put(StructuredPostal.CITY, "Baytown")
+                .put(StructuredPostal.STREET, "42 Plantation St.")
+                .put(StructuredPostal.FORMATTED_ADDRESS,
+                        "42 Plantation St. Baytown LA 30314 United States of America");
+
+        verifier.buildExpected(Email.CONTENT_ITEM_TYPE)
+                // "TYPE=INTERNET" -> TYPE_CUSTOM + the label "INTERNET"
+                .put(Email.TYPE, Email.TYPE_CUSTOM)
+                .put(Email.LABEL, "INTERNET")
+                .put(Email.DATA, "forrestgump@walladalla.com")
+                .put(Email.IS_PRIMARY, 1);
+
+        verifier.buildExpected(Email.CONTENT_ITEM_TYPE)
+                .put(Email.TYPE, Email.TYPE_MOBILE)
+                .put(Email.DATA, "cell@example.com");
+
+        verifier.buildExpected(Note.CONTENT_ITEM_TYPE)
+                .put(Note.NOTE, "The following note is the example from RFC 2045.");
+
+        verifier.buildExpected(Note.CONTENT_ITEM_TYPE)
+                .put(Note.NOTE,
+                        "Now's the time for all folk to come to the aid of their country.");
+
+        verifier.buildExpected(Photo.CONTENT_ITEM_TYPE)
+                // No information about its image format can be inserted.
+                .put(Photo.PHOTO, sPhotoByteArrayForComplicatedCase);
+
+        verifier.buildExpected(Event.CONTENT_ITEM_TYPE)
+                .put(Event.START_DATE, "19800101")
+                .put(Event.TYPE, Event.TYPE_BIRTHDAY);
+
+        verifier.buildExpected(Website.CONTENT_ITEM_TYPE)
+                .put(Website.URL, "http://www.example.com/")
+                .put(Website.TYPE, Website.TYPE_HOMEPAGE);
         verifier.verify(R.raw.v21_complicated, VCardConfig.VCARD_TYPE_V21_GENERIC_UTF8);
     }
 
@@ -743,40 +737,40 @@ public class VCardImporterTests extends VCardTestsBase {
         is.close();
         assertEquals(1, builder.vNodeList.size());
         PropertyNodesVerifier verifier = new PropertyNodesVerifier(this)
-            .addNodeWithOrder("VERSION", "3.0")
-            .addNodeWithOrder("FN", "And Roid")
-            .addNodeWithOrder("N", "And;Roid;;;", Arrays.asList("And", "Roid", "", "", ""))
-            .addNodeWithOrder("ORG", "Open;Handset; Alliance",
-                    Arrays.asList("Open", "Handset", " Alliance"))
-            .addNodeWithOrder("SORT-STRING", "android")
-            .addNodeWithOrder("TEL", "0300000000", new TypeSet("PREF", "VOICE"))
-            .addNodeWithOrder("CLASS", "PUBLIC")
-            .addNodeWithOrder("X-GNO", "0")
-            .addNodeWithOrder("X-GN", "group0")
-            .addNodeWithOrder("X-REDUCTION", "0")
-            .addNodeWithOrder("REV", "20081031T065854Z");
+                .addNodeWithOrder("VERSION", "3.0")
+                .addNodeWithOrder("FN", "And Roid")
+                .addNodeWithOrder("N", "And;Roid;;;", Arrays.asList("And", "Roid", "", "", ""))
+                .addNodeWithOrder("ORG", "Open;Handset; Alliance",
+                        Arrays.asList("Open", "Handset", " Alliance"))
+                .addNodeWithOrder("SORT-STRING", "android")
+                .addNodeWithOrder("TEL", "0300000000", new TypeSet("PREF", "VOICE"))
+                .addNodeWithOrder("CLASS", "PUBLIC")
+                .addNodeWithOrder("X-GNO", "0")
+                .addNodeWithOrder("X-GN", "group0")
+                .addNodeWithOrder("X-REDUCTION", "0")
+                .addNodeWithOrder("REV", "20081031T065854Z");
         verifier.verify(builder.vNodeList.get(0));
     }
 
     public void testV30Simple() throws IOException, VCardException {
-        ContactStructVerifier verifier = new ContactStructVerifier();
-        ContentValues contentValues =
-            verifier.createExpected(StructuredName.CONTENT_ITEM_TYPE);
-        contentValues.put(StructuredName.FAMILY_NAME, "And");
-        contentValues.put(StructuredName.GIVEN_NAME, "Roid");
-        contentValues.put(StructuredName.DISPLAY_NAME, "And Roid");
-        contentValues.put(StructuredName.PHONETIC_GIVEN_NAME, "android");
-
-        contentValues = verifier.createExpected(Organization.CONTENT_ITEM_TYPE);
-        contentValues.put(Organization.COMPANY, "Open");
-        contentValues.put(Organization.DEPARTMENT, "Handset  Alliance");
-        contentValues.put(Organization.TYPE, Organization.TYPE_WORK);
-
-        contentValues = verifier.createExpected(Phone.CONTENT_ITEM_TYPE);
-        contentValues.put(Phone.TYPE, Phone.TYPE_CUSTOM);
-        contentValues.put(Phone.LABEL, "VOICE");
-        contentValues.put(Phone.NUMBER, "030-000-0000");
-        contentValues.put(Phone.IS_PRIMARY, 1);
+        ContentValuesVerifier verifier = new ContentValuesVerifier();
+
+        verifier.buildExpected(StructuredName.CONTENT_ITEM_TYPE)
+                .put(StructuredName.FAMILY_NAME, "And")
+                .put(StructuredName.GIVEN_NAME, "Roid")
+                .put(StructuredName.DISPLAY_NAME, "And Roid")
+                .put(StructuredName.PHONETIC_GIVEN_NAME, "android");
+
+        verifier.buildExpected(Organization.CONTENT_ITEM_TYPE)
+                .put(Organization.COMPANY, "Open")
+                .put(Organization.DEPARTMENT, "Handset  Alliance")
+                .put(Organization.TYPE, Organization.TYPE_WORK);
+
+        verifier.buildExpected(Phone.CONTENT_ITEM_TYPE)
+                .put(Phone.TYPE, Phone.TYPE_CUSTOM)
+                .put(Phone.LABEL, "VOICE")
+                .put(Phone.NUMBER, "030-000-0000")
+                .put(Phone.IS_PRIMARY, 1);
         verifier.verify(R.raw.v30_simple, VCardConfig.VCARD_TYPE_V30_GENERIC_UTF8);
     }
 
@@ -789,47 +783,40 @@ public class VCardImporterTests extends VCardTestsBase {
         assertEquals(1, builder.vNodeList.size());
         ContentValues contentValuesForShiftJis = new ContentValues();
         contentValuesForShiftJis.put("CHARSET", "SHIFT_JIS");
-        ContentValues contentValuesForQP = new ContentValues();
-        contentValuesForQP.put("ENCODING", "QUOTED-PRINTABLE");
-        contentValuesForQP.put("CHARSET", "SHIFT_JIS");
         // Though Japanese careers append ";;;;" at the end of the value of "SOUND",
         // vCard 2.1/3.0 specification does not allow multiple values.
         // Do not need to handle it as multiple values.
         PropertyNodesVerifier verifier = new PropertyNodesVerifier(this)
-            .addNodeWithOrder("VERSION", "2.1", null, null, null, null, null)
-            .addNodeWithOrder("N", "\u5B89\u85E4\u30ED\u30A4\u30C9;;;;",
-                    Arrays.asList("\u5B89\u85E4\u30ED\u30A4\u30C9", "", "", "", ""),
-                    null, contentValuesForShiftJis, null, null)
-            .addNodeWithOrder("SOUND", "\uFF71\uFF9D\uFF84\uFF9E\uFF73\uFF9B\uFF72\uFF84\uFF9E;;;;",
-                    null, null, contentValuesForShiftJis,
-                    new TypeSet("X-IRMC-N"), null)
-            .addNodeWithOrder("TEL", "0300000000", null, null, null,
-                    new TypeSet("VOICE", "PREF"), null);
+                .addNodeWithOrder("VERSION", "2.1", null, null, null, null, null)
+                .addNodeWithOrder("N", "\u5B89\u85E4\u30ED\u30A4\u30C9;;;;",
+                        Arrays.asList("\u5B89\u85E4\u30ED\u30A4\u30C9", "", "", "", ""),
+                        null, contentValuesForShiftJis, null, null)
+                .addNodeWithOrder("SOUND",
+                        "\uFF71\uFF9D\uFF84\uFF9E\uFF73\uFF9B\uFF72\uFF84\uFF9E;;;;",
+                        null, null, contentValuesForShiftJis,
+                        new TypeSet("X-IRMC-N"), null)
+                .addNodeWithOrder("TEL", "0300000000", null, null, null,
+                        new TypeSet("VOICE", "PREF"), null);
         verifier.verify(builder.vNodeList.get(0));
     }
 
     private void testV21Japanese1Common(int resId, int vcardType, boolean japanese)
             throws IOException, VCardException {
-        ContactStructVerifier verifier = new ContactStructVerifier();
-
-        ContentValues contentValues =
-            verifier.createExpected(StructuredName.CONTENT_ITEM_TYPE);
-        contentValues.put(StructuredName.FAMILY_NAME, "\u5B89\u85E4\u30ED\u30A4\u30C9");
-        contentValues.put(StructuredName.DISPLAY_NAME, "\u5B89\u85E4\u30ED\u30A4\u30C9");
-        // While vCard parser does not split "SOUND" property values, ContactStruct care it.
-        contentValues.put(StructuredName.PHONETIC_FAMILY_NAME,
-                "\uFF71\uFF9D\uFF84\uFF9E\uFF73\uFF9B\uFF72\uFF84\uFF9E");
-
-        contentValues = verifier.createExpected(Phone.CONTENT_ITEM_TYPE);
-        // Phone number formatting is different.
-        if (japanese) {
-            contentValues.put(Phone.NUMBER, "03-0000-0000");
-        } else {
-            contentValues.put(Phone.NUMBER, "030-000-0000");
-        }
-        contentValues.put(Phone.TYPE, Phone.TYPE_CUSTOM);
-        contentValues.put(Phone.LABEL, "VOICE");
-        contentValues.put(Phone.IS_PRIMARY, 1);
+        ContentValuesVerifier verifier = new ContentValuesVerifier();
+        verifier.buildExpected(StructuredName.CONTENT_ITEM_TYPE)
+                .put(StructuredName.FAMILY_NAME, "\u5B89\u85E4\u30ED\u30A4\u30C9")
+                .put(StructuredName.DISPLAY_NAME, "\u5B89\u85E4\u30ED\u30A4\u30C9")
+                // While vCard parser does not split "SOUND" property values,
+                // ContactStruct care it.
+                .put(StructuredName.PHONETIC_FAMILY_NAME,
+                        "\uFF71\uFF9D\uFF84\uFF9E\uFF73\uFF9B\uFF72\uFF84\uFF9E");
+
+        verifier.buildExpected(Phone.CONTENT_ITEM_TYPE)
+                // Phone number formatting is different.
+                .put(Phone.NUMBER, (japanese ? "03-0000-0000" : "030-000-0000"))
+                .put(Phone.TYPE, Phone.TYPE_CUSTOM)
+                .put(Phone.LABEL, "VOICE")
+                .put(Phone.IS_PRIMARY, 1);
         verifier.verify(resId, vcardType);
     }
 
@@ -870,71 +857,67 @@ public class VCardImporterTests extends VCardTestsBase {
         assertEquals(1, builder.vNodeList.size());
         ContentValues contentValuesForShiftJis = new ContentValues();
         contentValuesForShiftJis.put("CHARSET", "SHIFT_JIS");
-        ContentValues contentValuesForQP = new ContentValues();
-        contentValuesForQP.put("ENCODING", "QUOTED-PRINTABLE");
-        contentValuesForQP.put("CHARSET", "SHIFT_JIS");
+        ContentValues contentValuesForQPAndSJ = new ContentValues();
+        contentValuesForQPAndSJ.put("ENCODING", "QUOTED-PRINTABLE");
+        contentValuesForQPAndSJ.put("CHARSET", "SHIFT_JIS");
         PropertyNodesVerifier verifier = new PropertyNodesVerifier(this)
-            .addNodeWithOrder("VERSION", "2.1")
-            .addNodeWithOrder("N", "\u5B89\u85E4;\u30ED\u30A4\u30C9\u0031;;;",
-                    Arrays.asList("\u5B89\u85E4", "\u30ED\u30A4\u30C9\u0031",
-                            "", "", ""),
-                    null, contentValuesForShiftJis, null, null)
-            .addNodeWithOrder("FN", "\u5B89\u85E4\u0020\u30ED\u30A4\u30C9\u0020\u0031",
-                    null, null, contentValuesForShiftJis, null, null)
-            .addNodeWithOrder("SOUND",
-                    "\uFF71\uFF9D\uFF84\uFF9E\uFF73;\uFF9B\uFF72\uFF84\uFF9E\u0031;;;",
-                    null, null, contentValuesForShiftJis,
-                    new TypeSet("X-IRMC-N"), null)
-            .addNodeWithOrder("ADR",
-                    ";\u6771\u4EAC\u90FD\u6E0B\u8C37\u533A\u685C" +
-                    "\u4E18\u753A\u0032\u0036\u002D\u0031\u30BB" +
-                    "\u30EB\u30EA\u30A2\u30F3\u30BF\u30EF\u30FC\u0036" +
-                    "\u968E;;;;150-8512;",
-                    Arrays.asList("",
-                            "\u6771\u4EAC\u90FD\u6E0B\u8C37\u533A\u685C" +
-                            "\u4E18\u753A\u0032\u0036\u002D\u0031\u30BB" +
-                            "\u30EB\u30EA\u30A2\u30F3\u30BF\u30EF\u30FC" +
-                            "\u0036\u968E", "", "", "", "150-8512", ""),
-                    null, contentValuesForQP, new TypeSet("HOME"), null)
-            .addNodeWithOrder("NOTE", "\u30E1\u30E2", null, null, contentValuesForQP, null, null);
+                .addNodeWithOrder("VERSION", "2.1")
+                .addNodeWithOrder("N", "\u5B89\u85E4;\u30ED\u30A4\u30C9\u0031;;;",
+                        Arrays.asList("\u5B89\u85E4", "\u30ED\u30A4\u30C9\u0031",
+                                "", "", ""),
+                        null, contentValuesForShiftJis, null, null)
+                .addNodeWithOrder("FN", "\u5B89\u85E4\u0020\u30ED\u30A4\u30C9\u0020\u0031",
+                        null, null, contentValuesForShiftJis, null, null)
+                .addNodeWithOrder("SOUND",
+                        "\uFF71\uFF9D\uFF84\uFF9E\uFF73;\uFF9B\uFF72\uFF84\uFF9E\u0031;;;",
+                        null, null, contentValuesForShiftJis,
+                        new TypeSet("X-IRMC-N"), null)
+                .addNodeWithOrder("ADR",
+                        ";\u6771\u4EAC\u90FD\u6E0B\u8C37\u533A\u685C" +
+                        "\u4E18\u753A\u0032\u0036\u002D\u0031\u30BB" +
+                        "\u30EB\u30EA\u30A2\u30F3\u30BF\u30EF\u30FC\u0036" +
+                        "\u968E;;;;150-8512;",
+                        Arrays.asList("",
+                                "\u6771\u4EAC\u90FD\u6E0B\u8C37\u533A\u685C" +
+                                "\u4E18\u753A\u0032\u0036\u002D\u0031\u30BB" +
+                                "\u30EB\u30EA\u30A2\u30F3\u30BF\u30EF\u30FC" +
+                                "\u0036\u968E", "", "", "", "150-8512", ""),
+                        null, contentValuesForQPAndSJ, new TypeSet("HOME"), null)
+                .addNodeWithOrder("NOTE", "\u30E1\u30E2", null, null,
+                        contentValuesForQPAndSJ, null, null);
         verifier.verify(builder.vNodeList.get(0));
     }
 
     public void testV21Japanese2_Type_Generic_Utf8() throws IOException, VCardException {
-        ContactStructVerifier verifier = new ContactStructVerifier();
-        ContentValues contentValues =
-            verifier.createExpected(StructuredName.CONTENT_ITEM_TYPE);
-        contentValues.put(StructuredName.FAMILY_NAME, "\u5B89\u85E4");
-        contentValues.put(StructuredName.GIVEN_NAME, "\u30ED\u30A4\u30C9\u0031");
-        contentValues.put(StructuredName.DISPLAY_NAME,
-                "\u5B89\u85E4\u0020\u30ED\u30A4\u30C9\u0020\u0031");
-        // ContactStruct should correctly split "SOUND" property into several elements,
-        // even though VCardParser side does not care it. 
-        contentValues.put(StructuredName.PHONETIC_FAMILY_NAME,
-                "\uFF71\uFF9D\uFF84\uFF9E\uFF73");
-        contentValues.put(StructuredName.PHONETIC_GIVEN_NAME,
-                "\uFF9B\uFF72\uFF84\uFF9E\u0031");
-
-        contentValues = verifier.createExpected(StructuredPostal.CONTENT_ITEM_TYPE);
-        contentValues.put(StructuredPostal.POSTCODE, "150-8512");
-        contentValues.put(StructuredPostal.NEIGHBORHOOD,
-                "\u6771\u4EAC\u90FD\u6E0B\u8C37\u533A\u685C" +
-                "\u4E18\u753A\u0032\u0036\u002D\u0031\u30BB" +
-                "\u30EB\u30EA\u30A2\u30F3\u30BF\u30EF\u30FC" +
-                "\u0036\u968E");
-        contentValues.put(StructuredPostal.FORMATTED_ADDRESS,
-                "\u6771\u4EAC\u90FD\u6E0B\u8C37\u533A\u685C" +
-                "\u4E18\u753A\u0032\u0036\u002D\u0031\u30BB" +
-                "\u30EB\u30EA\u30A2\u30F3\u30BF\u30EF\u30FC" +
-                "\u0036\u968E 150-8512");
-        contentValues.put(StructuredPostal.TYPE, StructuredPostal.TYPE_HOME);
-        contentValues = verifier.createExpected(Note.CONTENT_ITEM_TYPE);
-        contentValues.put(Note.NOTE, "\u30E1\u30E2");
+        ContentValuesVerifier verifier = new ContentValuesVerifier();
+        verifier.buildExpected(StructuredName.CONTENT_ITEM_TYPE)
+                .put(StructuredName.FAMILY_NAME, "\u5B89\u85E4")
+                .put(StructuredName.GIVEN_NAME, "\u30ED\u30A4\u30C9\u0031")
+                .put(StructuredName.DISPLAY_NAME,
+                        "\u5B89\u85E4\u0020\u30ED\u30A4\u30C9\u0020\u0031")
+                // ContactStruct should correctly split "SOUND" property into several elements,
+                // even though VCardParser side does not care it.
+                .put(StructuredName.PHONETIC_FAMILY_NAME, "\uFF71\uFF9D\uFF84\uFF9E\uFF73")
+                .put(StructuredName.PHONETIC_GIVEN_NAME, "\uFF9B\uFF72\uFF84\uFF9E\u0031");
+
+        verifier.buildExpected(StructuredPostal.CONTENT_ITEM_TYPE)
+                .put(StructuredPostal.POSTCODE, "150-8512")
+                .put(StructuredPostal.NEIGHBORHOOD,
+                        "\u6771\u4EAC\u90FD\u6E0B\u8C37\u533A\u685C" +
+                        "\u4E18\u753A\u0032\u0036\u002D\u0031\u30BB" +
+                        "\u30EB\u30EA\u30A2\u30F3\u30BF\u30EF\u30FC" +
+                        "\u0036\u968E")
+                .put(StructuredPostal.FORMATTED_ADDRESS,
+                        "\u6771\u4EAC\u90FD\u6E0B\u8C37\u533A\u685C" +
+                        "\u4E18\u753A\u0032\u0036\u002D\u0031\u30BB" +
+                        "\u30EB\u30EA\u30A2\u30F3\u30BF\u30EF\u30FC" +
+                        "\u0036\u968E 150-8512")
+                .put(StructuredPostal.TYPE, StructuredPostal.TYPE_HOME);
+        verifier.buildExpected(Note.CONTENT_ITEM_TYPE)
+                .put(Note.NOTE, "\u30E1\u30E2");
         verifier.verify(R.raw.v21_japanese_2, VCardConfig.VCARD_TYPE_V21_GENERIC_UTF8);
     }
 
-    // Following tests are old ones, though they still work fine.
-    
     public void testV21MultipleEntryCase() throws IOException, VCardException {
         VCardParser_V21 parser = new VCardParser_V21();
         VNodeBuilder builder = new VNodeBuilder();
@@ -945,47 +928,47 @@ public class VCardImporterTests extends VCardTestsBase {
         ContentValues contentValuesForShiftJis = new ContentValues();
         contentValuesForShiftJis.put("CHARSET", "SHIFT_JIS");
         PropertyNodesVerifier verifier = new PropertyNodesVerifier(this)
-            .addNodeWithOrder("VERSION", "2.1")
-            .addNodeWithOrder("N", "\u5B89\u85E4\u30ED\u30A4\u30C9\u0033;;;;",
-                    Arrays.asList("\u5B89\u85E4\u30ED\u30A4\u30C9\u0033", "", "", "", ""),
-                    null, contentValuesForShiftJis, null, null)
-            .addNodeWithOrder("SOUND",
-                    "\uFF71\uFF9D\uFF84\uFF9E\uFF73\uFF9B\uFF72\uFF84\uFF9E\u0033;;;;",
-                    null, null, contentValuesForShiftJis,
-                    new TypeSet("X-IRMC-N"), null)
-            .addNodeWithOrder("TEL", "9", new TypeSet("X-NEC-SECRET"))
-            .addNodeWithOrder("TEL", "10", new TypeSet("X-NEC-HOTEL"))
-            .addNodeWithOrder("TEL", "11", new TypeSet("X-NEC-SCHOOL"))
-            .addNodeWithOrder("TEL", "12", new TypeSet("FAX", "HOME"));
+                .addNodeWithOrder("VERSION", "2.1")
+                .addNodeWithOrder("N", "\u5B89\u85E4\u30ED\u30A4\u30C9\u0033;;;;",
+                        Arrays.asList("\u5B89\u85E4\u30ED\u30A4\u30C9\u0033", "", "", "", ""),
+                        null, contentValuesForShiftJis, null, null)
+                .addNodeWithOrder("SOUND",
+                        "\uFF71\uFF9D\uFF84\uFF9E\uFF73\uFF9B\uFF72\uFF84\uFF9E\u0033;;;;",
+                        null, null, contentValuesForShiftJis,
+                        new TypeSet("X-IRMC-N"), null)
+                .addNodeWithOrder("TEL", "9", new TypeSet("X-NEC-SECRET"))
+                .addNodeWithOrder("TEL", "10", new TypeSet("X-NEC-HOTEL"))
+                .addNodeWithOrder("TEL", "11", new TypeSet("X-NEC-SCHOOL"))
+                .addNodeWithOrder("TEL", "12", new TypeSet("FAX", "HOME"));
         verifier.verify(builder.vNodeList.get(0));
         
         verifier = new PropertyNodesVerifier(this)
-            .addNodeWithOrder("VERSION", "2.1")
-            .addNodeWithOrder("N", "\u5B89\u85E4\u30ED\u30A4\u30C9\u0034;;;;",
-                    Arrays.asList("\u5B89\u85E4\u30ED\u30A4\u30C9\u0034", "", "", "", ""),
-                    null, contentValuesForShiftJis, null, null)
-            .addNodeWithOrder("SOUND",
-                    "\uFF71\uFF9D\uFF84\uFF9E\uFF73\uFF9B\uFF72\uFF84\uFF9E\u0034;;;;",
-                    null, null, contentValuesForShiftJis,
-                    new TypeSet("X-IRMC-N"), null)
-            .addNodeWithOrder("TEL", "13", new TypeSet("MODEM"))
-            .addNodeWithOrder("TEL", "14", new TypeSet("PAGER"))
-            .addNodeWithOrder("TEL", "15", new TypeSet("X-NEC-FAMILY"))
-            .addNodeWithOrder("TEL", "16", new TypeSet("X-NEC-GIRL"));
+                .addNodeWithOrder("VERSION", "2.1")
+                .addNodeWithOrder("N", "\u5B89\u85E4\u30ED\u30A4\u30C9\u0034;;;;",
+                        Arrays.asList("\u5B89\u85E4\u30ED\u30A4\u30C9\u0034", "", "", "", ""),
+                        null, contentValuesForShiftJis, null, null)
+                .addNodeWithOrder("SOUND",
+                        "\uFF71\uFF9D\uFF84\uFF9E\uFF73\uFF9B\uFF72\uFF84\uFF9E\u0034;;;;",
+                        null, null, contentValuesForShiftJis,
+                        new TypeSet("X-IRMC-N"), null)
+                .addNodeWithOrder("TEL", "13", new TypeSet("MODEM"))
+                .addNodeWithOrder("TEL", "14", new TypeSet("PAGER"))
+                .addNodeWithOrder("TEL", "15", new TypeSet("X-NEC-FAMILY"))
+                .addNodeWithOrder("TEL", "16", new TypeSet("X-NEC-GIRL"));
         verifier.verify(builder.vNodeList.get(1));
         verifier = new PropertyNodesVerifier(this)
-            .addNodeWithOrder("VERSION", "2.1")
-            .addNodeWithOrder("N", "\u5B89\u85E4\u30ED\u30A4\u30C9\u0035;;;;",
-                    Arrays.asList("\u5B89\u85E4\u30ED\u30A4\u30C9\u0035", "", "", "", ""),
-                    null, contentValuesForShiftJis, null, null)
-            .addNodeWithOrder("SOUND",
-                    "\uFF71\uFF9D\uFF84\uFF9E\uFF73\uFF9B\uFF72\uFF84\uFF9E\u0035;;;;",
-                    null, null, contentValuesForShiftJis,
-                    new TypeSet("X-IRMC-N"), null)
-            .addNodeWithOrder("TEL", "17", new TypeSet("X-NEC-BOY"))
-            .addNodeWithOrder("TEL", "18", new TypeSet("X-NEC-FRIEND"))
-            .addNodeWithOrder("TEL", "19", new TypeSet("X-NEC-PHS"))
-            .addNodeWithOrder("TEL", "20", new TypeSet("X-NEC-RESTAURANT"));
+                .addNodeWithOrder("VERSION", "2.1")
+                .addNodeWithOrder("N", "\u5B89\u85E4\u30ED\u30A4\u30C9\u0035;;;;",
+                        Arrays.asList("\u5B89\u85E4\u30ED\u30A4\u30C9\u0035", "", "", "", ""),
+                        null, contentValuesForShiftJis, null, null)
+                .addNodeWithOrder("SOUND",
+                        "\uFF71\uFF9D\uFF84\uFF9E\uFF73\uFF9B\uFF72\uFF84\uFF9E\u0035;;;;",
+                        null, null, contentValuesForShiftJis,
+                        new TypeSet("X-IRMC-N"), null)
+                .addNodeWithOrder("TEL", "17", new TypeSet("X-NEC-BOY"))
+                .addNodeWithOrder("TEL", "18", new TypeSet("X-NEC-FRIEND"))
+                .addNodeWithOrder("TEL", "19", new TypeSet("X-NEC-PHS"))
+                .addNodeWithOrder("TEL", "20", new TypeSet("X-NEC-RESTAURANT"));
         verifier.verify(builder.vNodeList.get(2));
     }
 }
index 4c899b3..80340d3 100644 (file)
@@ -62,7 +62,6 @@ import android.test.mock.MockContentResolver;
 import android.test.mock.MockContext;
 import android.test.mock.MockCursor;
 import android.text.TextUtils;
-import android.util.Log;
 
 import junit.framework.TestCase;
 
@@ -173,6 +172,64 @@ class CustomMockContext extends MockContext {
     }
 }
 
+class ContentValuesBuilder {
+    private final ContentValues mContentValues;
+
+    public ContentValuesBuilder(final ContentValues contentValues) {
+        mContentValues = contentValues;
+    }
+
+    public ContentValuesBuilder put(String key, String value) {
+        mContentValues.put(key, value);
+        return this;
+    }
+
+    public ContentValuesBuilder put(String key, Byte value) {
+        mContentValues.put(key, value);
+        return this;
+    }
+
+    public ContentValuesBuilder put(String key, Short value) {
+        mContentValues.put(key, value);
+        return this;
+    }
+
+    public ContentValuesBuilder put(String key, Integer value) {
+        mContentValues.put(key, value);
+        return this;
+    }
+
+    public ContentValuesBuilder put(String key, Long value) {
+        mContentValues.put(key, value);
+        return this;
+    }
+
+    public ContentValuesBuilder put(String key, Float value) {
+        mContentValues.put(key, value);
+        return this;
+    }
+
+    public ContentValuesBuilder put(String key, Double value) {
+        mContentValues.put(key, value);
+        return this;
+    }
+
+    public ContentValuesBuilder put(String key, Boolean value) {
+        mContentValues.put(key, value);
+        return this;
+    }
+
+    public ContentValuesBuilder put(String key, byte[] value) {
+        mContentValues.put(key, value);
+        return this;
+    }
+
+    public ContentValuesBuilder putNull(String key) {
+        mContentValues.putNull(key);
+        return this;
+    }
+}
+
 /**
  * BaseClass for vCard unit tests with utility classes.
  * Please do not add each unit test here.
@@ -233,7 +290,7 @@ class CustomMockContext extends MockContext {
             }
 
             final Collection<ContentValues> contentValuesCollection =
-                mMimeTypeToExpectedContentValues.get(mimeType);
+                    mMimeTypeToExpectedContentValues.get(mimeType);
             contentValuesCollection.add(expectedContentValues);
         }
 
@@ -347,19 +404,19 @@ class CustomMockContext extends MockContext {
         }
     }
 
-    public class ContactStructVerifier {
+    public class ContentValuesVerifier {
         private final ImportVerificationResolver mResolver;
         // private final String mCharset;
 
-        public ContactStructVerifier() {
+        public ContentValuesVerifier() {
             mResolver = new ImportVerificationResolver();
         }
 
-        public ContentValues createExpected(String mimeType) {
+        public ContentValuesBuilder buildExpected(String mimeType) {
             ContentValues contentValues = new ContentValues();
             contentValues.put(Data.MIMETYPE, mimeType);
             mResolver.addExpectedContentValues(contentValues);
-            return contentValues;
+            return new ContentValuesBuilder(contentValues);
         }
 
         public void verify(int resId, int vCardType)
@@ -399,7 +456,7 @@ class CustomMockContext extends MockContext {
             addProvider(RawContacts.CONTENT_URI.getAuthority(), mProvider);
         }
 
-        public ContentValues buildData(String mimeType) {
+        public ContentValuesBuilder buildInput(String mimeType) {
             return mProvider.buildData(mimeType);
         }
     }
@@ -437,11 +494,11 @@ class CustomMockContext extends MockContext {
 
     public class ExportTestProvider extends MockContentProvider {
         List<ContentValues> mContentValuesList = new ArrayList<ContentValues>();
-        public ContentValues buildData(String mimeType) {
+        public ContentValuesBuilder buildData(String mimeType) {
             ContentValues contentValues = new ContentValues();
             contentValues.put(Data.MIMETYPE, mimeType);
             mContentValuesList.add(contentValues);
-            return contentValues;
+            return new ContentValuesBuilder(contentValues);
         }
 
         @Override
@@ -518,48 +575,49 @@ class CustomMockContext extends MockContext {
         }
     }
 
-    public static class VCardVerificationHandler implements VCardComposer.OneEntryHandler {
+    public class VCardVerificationHandler implements VCardComposer.OneEntryHandler {
         final private TestCase mTestCase;
         final private List<PropertyNodesVerifier> mPropertyNodesVerifierList;
         final private boolean mIsV30;
         // To allow duplication, use list instead of set.
         // TODO: support multiple vCard entries.
         final private List<String> mExpectedLineList;
-        final private ContactStructVerifier mContactStructVerifier;
+        final private List<ContentValuesVerifier> mContentValuesVerifierList;
         final private int mVCardType;
         int mCount;
 
         public VCardVerificationHandler(final TestCase testCase, final int version) {
-            this(testCase, null, version);
-        }
-
-        public VCardVerificationHandler(final TestCase testCase,
-                ContactStructVerifier contactStructVerifier, final int version) {
             mTestCase = testCase;
             mPropertyNodesVerifierList = new ArrayList<PropertyNodesVerifier>();
             mIsV30 = (version == V30);
             mExpectedLineList = new ArrayList<String>();
-            mContactStructVerifier = contactStructVerifier;
+            mContentValuesVerifierList = new ArrayList<ContentValuesVerifier>();
             mVCardType = (version == V30 ? VCardConfig.VCARD_TYPE_V30_GENERIC_UTF8
                     : VCardConfig.VCARD_TYPE_V21_GENERIC_UTF8);
             mCount = 1;
         }
 
-        public PropertyNodesVerifier addNewVerifier() {
+        public PropertyNodesVerifier addPropertyNodesVerifier() {
             PropertyNodesVerifier verifier = new PropertyNodesVerifier(mTestCase);
             mPropertyNodesVerifierList.add(verifier);
             verifier.addNodeWithOrder("VERSION", mIsV30 ? "3.0" : "2.1");
             return verifier;
         }
 
-        public PropertyNodesVerifier addNewVerifierWithEmptyName() {
-            PropertyNodesVerifier verifier = addNewVerifier();
+        public PropertyNodesVerifier addPropertyVerifierWithEmptyName() {
+            PropertyNodesVerifier verifier = addPropertyNodesVerifier();
             if (mIsV30) {
                 verifier.addNodeWithOrder("N", "").addNodeWithOrder("FN", "");
             }
             return verifier;
         }
 
+        public ContentValuesVerifier addContentValuesVerifier() {
+            ContentValuesVerifier verifier = new ContentValuesVerifier();
+            mContentValuesVerifierList.add(verifier);
+            return verifier;
+        }
+
         public VCardVerificationHandler addExpectedLine(String line) {
             mExpectedLineList.add(line);
             return this;
@@ -610,7 +668,7 @@ class CustomMockContext extends MockContext {
                         + mCount + " of the entries (No.1 is the first entry))");
             }
             PropertyNodesVerifier propertyNodesVerifier =
-                mPropertyNodesVerifierList.get(0);
+                    mPropertyNodesVerifierList.get(0);
             mPropertyNodesVerifierList.remove(0);
             VCardParser parser = (mIsV30 ? new VCardParser_V30(true) : new VCardParser_V21());
             VNodeBuilder builder = new VNodeBuilder();
@@ -621,10 +679,11 @@ class CustomMockContext extends MockContext {
                 is.close();
                 mTestCase.assertEquals(1, builder.vNodeList.size());
                 propertyNodesVerifier.verify(builder.vNodeList.get(0));
-                if (mContactStructVerifier != null) {
-                    Log.d("@@@", vcard);
+                if (!mContentValuesVerifierList.isEmpty()) {
+                    ContentValuesVerifier contentValuesVerifier =
+                            mContentValuesVerifierList.get(0);
                     is = new ByteArrayInputStream(vcard.getBytes("UTF-8"));
-                    mContactStructVerifier.verify(is, mVCardType);
+                    contentValuesVerifier.verify(is, mVCardType);
                     is.close();
                 }
             } catch (IOException e) {