ThriftBinaryCodec { public static byte[] encodeNonNull(TBase<?, ?> tBase) throws CodingException { requireNonNull(tBase); try { return new TSerializer(PROTOCOL_FACTORY).serialize(tBase); } catch (TException e) { throw new CodingException("Failed to serialize: " + tBase, e); } } private  ThriftBinaryCodec(); @Nullable static T decode(Class<T> clazz, @Nullable byte[] buffer); static T decodeNonNull(Class<T> clazz, byte[] buffer); @Nullable static byte[] encode(@Nullable TBase<?, ?> tBase); static byte[] encodeNonNull(TBase<?, ?> tBase); static byte[] deflateNonNull(TBase<?, ?> tBase); static T inflateNonNull(Class<T> clazz, byte[] buffer); static final TProtocolFactory PROTOCOL_FACTORY; }
@Test(expected = NullPointerException.class) public void testEncodeNonNull() throws CodingException { ThriftBinaryCodec.encodeNonNull(null); }