@Test
  public void testParseTimestampMapFloat() {
    TimestampFloatMap expected = new TimestampFloatMap();
    expected.put(1.0, 1f);
    expected.put(3.0, 2f);
    expected.put(5.0, 3f);
    expected.put(6.0, 4f);

    assertEqualTimestampMaps(
        expected,
        TimestampsParser.parseTimestampMap(Float.class, "[1, 1]; [3, 2]; [5, '3']; [6, \"4\"]"));
    assertEqualTimestampMaps(
        expected,
        TimestampsParser.parseTimestampMap(float.class, "[1, 1]; [3, 2]; [5, '3']; [6, \"4\"]"));
  }
  @Test
  public void testParseTimestampMapDouble() {
    TimestampDoubleMap expected = new TimestampDoubleMap();
    expected.put(1.0, 1d);
    expected.put(3.0, 2d);
    expected.put(5.0, 3d);
    expected.put(6.0, 4d);

    assertEqualTimestampMaps(
        expected,
        TimestampsParser.parseTimestampMap(Double.class, "[1, 1]; [3, 2]; [5, '3']; [6, \"4\"]"));
    assertEqualTimestampMaps(
        expected,
        TimestampsParser.parseTimestampMap(double.class, "[1, 1]; [3, 2]; [5, '3']; [6, \"4\"]"));
  }
  @Test
  public void testParseTimestampMapLong() {
    TimestampLongMap expected = new TimestampLongMap();
    expected.put(1.0, 1l);
    expected.put(3.0, 2l);
    expected.put(5.0, 3l);
    expected.put(6.0, 4l);

    assertEqualTimestampMaps(
        expected,
        TimestampsParser.parseTimestampMap(Long.class, "[1, 1]; [3, 2]; [5, '3']; [6, \"4\"]"));
    assertEqualTimestampMaps(
        expected,
        TimestampsParser.parseTimestampMap(long.class, "[1, 1]; [3, 2]; [5, '3']; [6, \"4\"]"));
  }
  @Test
  public void testParseTimestampMapInteger() {
    TimestampIntegerMap expected = new TimestampIntegerMap();
    expected.put(1.0, 1);
    expected.put(3.0, 2);
    expected.put(5.0, 3);
    expected.put(6.0, 4);

    assertEqualTimestampMaps(
        expected,
        TimestampsParser.parseTimestampMap(Integer.class, "[1, 1]; [3, 2]; [5, '3']; [6, \"4\"]"));
    assertEqualTimestampMaps(
        expected,
        TimestampsParser.parseTimestampMap(int.class, "[1, 1]; [3, 2]; [5, '3']; [6, \"4\"]"));
  }
  @Test
  public void testParseTimestampMapShort() {
    TimestampShortMap expected = new TimestampShortMap();
    expected.put(1.0, (short) 1);
    expected.put(3.0, (short) 2);
    expected.put(5.0, (short) 3);
    expected.put(6.0, (short) 4);

    assertEqualTimestampMaps(
        expected,
        TimestampsParser.parseTimestampMap(Short.class, "[1, 1]; [3, 2]; [5, '3']; [6, \"4\"]"));
    assertEqualTimestampMaps(
        expected,
        TimestampsParser.parseTimestampMap(short.class, "[1, 1]; [3, 2]; [5, '3']; [6, \"4\"]"));
  }
  @Test
  public void testParseTimestampMapByte() {
    TimestampByteMap expected = new TimestampByteMap();
    expected.put(1.0, (byte) 1);
    expected.put(3.0, (byte) 2);
    expected.put(6.0, (byte) 3);
    expected.put(7.0, (byte) 4);

    assertEqualTimestampMaps(
        expected,
        TimestampsParser.parseTimestampMap(Byte.class, "[1, 1]; [3, 2]; [6, '3']; [7, \"4\"]"));
    assertEqualTimestampMaps(
        expected,
        TimestampsParser.parseTimestampMap(byte.class, "[1, 1]; [3, 2]; [6, '3']; [7, \"4\"]"));
  }
  @Test
  public void testParseTimestampMapChar() {
    TimestampCharMap expected = new TimestampCharMap();
    expected.put(1.0, 'a');
    expected.put(3.0, 'b');
    expected.put(5.0, 'c');
    expected.put(6.0, 'd');

    assertEqualTimestampMaps(
        expected,
        TimestampsParser.parseTimestampMap(
            Character.class, "[1, a]; [3, b]; [5, 'c']; [6, \"d\"]"));
    assertEqualTimestampMaps(
        expected,
        TimestampsParser.parseTimestampMap(char.class, "[1, a]; [3, b]; [5, 'c']; [6, \"d\"]"));
  }
  @Test
  public void testParseTimestampMapBoolean() {
    TimestampBooleanMap expected = new TimestampBooleanMap();
    expected.put(1.0, true);
    expected.put(3.0, false);
    expected.put(5.0, false);
    expected.put(6.0, true);

    assertEqualTimestampMaps(
        expected,
        TimestampsParser.parseTimestampMap(
            Boolean.class, "[1, true]; [3, false]; [5, '0']; [6, \"1\"]"));
    assertEqualTimestampMaps(
        expected,
        TimestampsParser.parseTimestampMap(
            boolean.class, "[1, true]; [3, false]; [5, '0']; [6, \"1\"]"));
  }
  @Test
  public void testParseTimestampMapString() {
    TimestampStringMap expected = new TimestampStringMap();
    expected.put(1.0, "Value1");
    expected.put(3.0, "Value2");
    expected.put(5.0, "Value 3");
    expected.put(6.0, " Value 4 ");

    assertEqualTimestampMaps(
        expected,
        TimestampsParser.parseTimestampMap(
            String.class, "[1, Value1]; [3, 'Value2']; [5, Value 3]; [6, \" Value 4 \"]"));
  }
 private String parseTimestampMapToString(String str, Class type) {
   return TimestampsParser.parseTimestampMap(type, str).toString();
 }
 @Test(expected = IllegalArgumentException.class)
 public void testParseTimestampUnsupportedType() {
   TimestampsParser.parseTimestampMap(Date.class, "[1, 1]; [3, 2]; [5, '3']; [6, \"4\"]");
 }
 @Test(expected = IllegalArgumentException.class)
 public void testParseTimestampMapCharBadFormat() {
   TimestampsParser.parseTimestampMap(Character.class, "[1, abc]");
 }
 @Test(expected = IllegalArgumentException.class)
 public void testParseTimestampMapDoubleBadFormat() {
   TimestampsParser.parseTimestampMap(Double.class, "[1, 4oe]");
 }
 @Test(expected = IllegalArgumentException.class)
 public void testParseTimestampMapFloatBadFormat() {
   TimestampsParser.parseTimestampMap(Float.class, "[1, 1..4]");
 }
 @Test(expected = IllegalArgumentException.class)
 public void testParseTimestampMapLongBadFormat() {
   TimestampsParser.parseTimestampMap(Long.class, "[1, a]");
 }