BinaryFormat { public static Predicate decode(byte[] buf) { Objects.requireNonNull(buf, "buf"); Slime slime = com.yahoo.slime.BinaryFormat.decode(buf); return decode(slime.get()); }  static byte[] encode(Predicate predicate); static Predicate decode(byte[] buf);  }
@Test public void requireThatDecodeNullThrows() { try { BinaryFormat.decode(null); fail(); } catch (NullPointerException e) { assertEquals("buf", e.getMessage()); } }
@Test public void requireThatDecodeEmptyThrows() { try { BinaryFormat.decode(new byte[0]); fail(); } catch (UnsupportedOperationException e) { assertEquals("0", e.getMessage()); } }