@Test public void testCompressionTranscoder() { String decoded = compressionTranscoder.decode(compressionTranscoder.encode(DATA)); Assert.assertEquals(DATA, decoded); Mockito.verify(compressor).compress(DATA.getBytes()); Mockito.verify(transcoder).encode(DATA); Mockito.verify(compressor).decompress(DATA.getBytes()); Mockito.verify(transcoder).decode(DATA.getBytes()); }
public CompressionTranscoder(final Transcoder<T> delegate, final Compressor compressor) { this.delegate = Objects.requireNonNull(delegate, "delegated transcoder may not be null"); this.compressor = compressor; }
CompressionTranscoder implements Transcoder<T> { public CompressionTranscoder(final Transcoder<T> delegate, final Compressor compressor) { this.delegate = Objects.requireNonNull(delegate, "delegated transcoder may not be null"); this.compressor = compressor; } }
CompressionTranscoder implements Transcoder<T> { public CompressionTranscoder(final Transcoder<T> delegate, final Compressor compressor) { this.delegate = Objects.requireNonNull(delegate, "delegated transcoder may not be null"); this.compressor = compressor; } CompressionTranscoder(final Transcoder<T> delegate, final Compressor compressor); }
CompressionTranscoder implements Transcoder<T> { public CompressionTranscoder(final Transcoder<T> delegate, final Compressor compressor) { this.delegate = Objects.requireNonNull(delegate, "delegated transcoder may not be null"); this.compressor = compressor; } CompressionTranscoder(final Transcoder<T> delegate, final Compressor compressor); @Override T decode(final byte[] bytes); @Override byte[] encode(final T t); }
CompressionTranscoder implements Transcoder<T> { public CompressionTranscoder(final Transcoder<T> delegate, final Compressor compressor) { this.delegate = Objects.requireNonNull(delegate, "delegated transcoder may not be null"); this.compressor = compressor; } CompressionTranscoder(final Transcoder<T> delegate, final Compressor compressor); @Override T decode(final byte[] bytes); @Override byte[] encode(final T t);  }