Ejemplo n.º 1
0
 @Override
 public void set(OptionalLong optional) {
   if (optional != null && optional.isPresent()) {
     wrapper.set(optional.getAsLong());
   } else {
     wrapper.set(null);
   }
 }
 @Test
 public void testParseHexOptionalOk() throws Exception {
   long i = 0x14;
   String s = Long.toHexString(i);
   OptionalLong ret = ParseLong.parseHexOptional(s);
   assertTrue(ret.isPresent());
   assertEquals(i, ret.getAsLong());
 }