@Test
public void merge() {

    assertEquals(Collections.singletonList(
            new NumberElement("10, 40", CSLLabel.CHAPTER, true)),
            NumberParser.parse("ch. 10, ch. 40"));
    assertEquals(Collections.singletonList(
            new NumberElement("10, 40", CSLLabel.SECTION, true)),
            NumberParser.parse("sec. 10, sec. 40"));
    assertEquals(Collections.singletonList(
            new NumberElement("10\u201312, 40", CSLLabel.SECTION, true)),
            NumberParser.parse("sec. 10-12, sec. 40"));
    assertEquals(Arrays.asList(
            new NumberElement("10, ", CSLLabel.CHAPTER, false),
            new NumberElement("40", CSLLabel.SECTION, false)),
            NumberParser.parse("ch. 10, sec. 40"));
    assertEquals(Arrays.asList(
            new NumberElement("10, 40, ", CSLLabel.CHAPTER, true),
            new NumberElement("2", CSLLabel.SECTION, false)),
            NumberParser.parse("ch. 10, ch. 40, sec. 2"));
    assertEquals(Arrays.asList(
            new NumberElement("10, ", CSLLabel.CHAPTER, false),
            new NumberElement("40, ", CSLLabel.SECTION, false),
            new NumberElement("2", CSLLabel.CHAPTER, false)),
            NumberParser.parse("ch. 10, sec. 40, ch. 2"));
}