  @Test
  public void encodesPrimitiveArrays() throws IOException {

    // Exercise a bug where primitive arrays would throw an IOException.
    // https://github.com/segmentio/analytics-android/issues/507
    Map<String, Object> map =
        ImmutableMap.<String, Object>builder().put("a", new int[] {1, 2}).build();

    assertThat(cartographer.toJson(map))
        .isEqualTo("{\n" + "  \"a\": [\n" + "    1,\n" + "    2\n" + "  ]\n" + "}");
  }