@Test
public void testEncodeDuration() {

  Long d1 = 2743414L;
  assertEquals(d1, decodeDuration(encodeDuration(d1).getValue()));
  Long d2 = 78534795325L;
  assertEquals(d2, decodeDuration(encodeDuration(d2).getValue()));
  Long d3 = 234L;
  assertEquals(d3, decodeDuration(encodeDuration(d3).getValue()));
  assertEquals(new Long(1 * 1000 * 60 * 60 + 10 * 1000 * 60 + 5 * 1000), decodeDuration("01:10:05"));
  assertEquals(Opt.some(DublinCore.ENC_SCHEME_ISO8601), encodeDuration(d3).getEncodingScheme());
  assertNull(decodeDuration(DublinCoreValue.mk("bla")));
  assertNull(decodeDuration(DublinCoreValue.mk(encodeDuration(d1).getValue(), DublinCore.LANGUAGE_UNDEFINED,
          DublinCore.ENC_SCHEME_BOX)));
}