Update CompareOrUpdateResult with NULL NULL Check

Add a test to CompareOrUpdateResult where the new and old item
list are both NULL.

Test: Updated unit test
Change-Id: I6821028409d29ab864af52685629630cbf16db3b
This commit is contained in:
Tyler Wear 2020-01-28 16:38:01 -08:00
commit 3767434b21
2 changed files with 6 additions and 1 deletions

View file

@ -111,6 +111,7 @@ public final class LinkPropertiesUtils {
}
}
}
removed.addAll(updateTracker.values());
}

View file

@ -254,5 +254,9 @@ public final class LinkPropertiesUtilsTest {
result = new CompareOrUpdateResult<String, String>(oldItems, null, extractPrefix);
assertCompareOrUpdateResult(result,
emptyList, strArray("hello123", "howareyou669", "goodbye5678"), emptyList);
// Null -> null: all lists empty.
result = new CompareOrUpdateResult<String, String>(null, null, extractPrefix);
assertCompareOrUpdateResult(result, emptyList, emptyList, emptyList);
}
}
}