### Question:
ImmutableKeyValuePairs { @Override public String toString() { final StringBuilder sb = new StringBuilder("{"); List<Object> data = data(); for (int i = 0; i < data.size(); i += 2) { sb.append(data.get(i)).append("=").append(data.get(i + 1)).append(", "); } if (sb.length() > 1) { sb.setLength(sb.length() - 2); } sb.append("}"); return sb.toString(); }  int size(); boolean isEmpty(); @Nullable @SuppressWarnings("unchecked") V get(K key); @Override String toString();  }### Answer:
@Test void toStringIsCorrect() { assertThat(new TestPairs(Collections.emptyList()).toString()).isEqualTo("{}"); assertThat(new TestPairs(Arrays.asList("one", 55)).toString()).isEqualTo("{one=55}"); assertThat(new TestPairs(Arrays.asList("one", 55, "two", "b")).toString()) .isEqualTo("{one=55, two=b}"); assertThat(new TestPairs(Arrays.asList("one", 55, "two", "b")).toString()) .isEqualTo(ImmutableMap.of("one", 55, "two", "b").toString()); }