ThriftBinaryCodec { public static <T extends TBase<T, ?>> T decodeNonNull(Class<T> clazz, byte[] buffer) throws CodingException { requireNonNull(clazz); requireNonNull(buffer); try { T t = newInstance(clazz); new TDeserializer(PROTOCOL_FACTORY).deserialize(t, buffer); return t; } catch (TException e) { throw new CodingException("Failed to deserialize thrift object.", 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 testDecodeNonNull() throws CodingException { ThriftBinaryCodec.decodeNonNull(ScheduledTask.class, null); }