### Question:
QualifierCoder { public static Qualifier decode(byte[] bytes){ Qualifier qualifier = new Qualifier(); if (2 == bytes.length){ qualifier.setType(1); int delta = ((bytes[0] & 0x3F) << 8 | (bytes[1] & 0xFC) << 0) >> 2; qualifier.setDelta(delta); } else { qualifier.setType(2); int delta = (0 & 0xFF) << 24 | (bytes[0] & 0x3F) << 16 | (bytes[1] & 0xFF) << 8 | (bytes[2] & 0xFF) << 0; qualifier.setDelta(delta); } return qualifier; }  static byte[] encode(Long timestamp, Integer baseTime); static Qualifier decode(byte[] bytes);  }### Answer:
@Test public void testDecode() { byte[] a = { 65, (byte) 236 }; Qualifier q = QualifierCoder.decode(a); assertTrue(1 == q.getType() && 123 == q.getDelta()); }
@Test public void testDecode0() { byte[] a = { 64, 0 }; Qualifier q = QualifierCoder.decode(a); assertTrue(1 == q.getType() && 0 == q.getDelta()); }
@Test public void testDecode1() { byte[] a = { (byte) 120, 64 }; Qualifier q = QualifierCoder.decode(a); assertTrue(1 == q.getType() && 3600 == q.getDelta()); }
@Test public void testDecode2() { byte[] a = { (byte) 120, 84 }; Qualifier q = QualifierCoder.decode(a); assertTrue(1 == q.getType() && 3605 == q.getDelta()); }
@Test public void testDecodeMilli() { byte[] a = { (byte) 129, (byte) 224, (byte) 121 }; Qualifier q = QualifierCoder.decode(a); assertTrue(2 == q.getType() && 123001 == q.getDelta()); }
@Test public void testDecodeMilli0() { byte[] a = { (byte) 128, 0, 0 }; Qualifier q = QualifierCoder.decode(a); assertTrue(2 == q.getType() && 0 == q.getDelta()); }
@Test public void testDecodeMilli1() { byte[] a = { (byte) 182, (byte) 238, (byte) 128 }; Qualifier q = QualifierCoder.decode(a); assertTrue(2 == q.getType() && 3600000 == q.getDelta()); }
@Test public void testDecodeMilli2() { byte[] a = { (byte) 183, 2, 8 }; Qualifier q = QualifierCoder.decode(a); assertTrue(2 == q.getType() && 3605000 == q.getDelta()); }