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