### Question:
AttributeCompressionStrategy implements BlobStrategy { public byte[] perform(byte[] blob) throws TokenStrategyFailedException { Reject.ifTrue(blob == null); if (!isTokenValidForCompression(blob)) { return blob; } return performUpdate(blob, replacement); } @Inject  AttributeCompressionStrategy(TokenBlobUtils blobUtils); byte[] perform(byte[] blob); byte[] reverse(byte[] blob); static String getInitials(String name); static Collection<Field> getAllValidFields(Class c);  }### Answer:
@Test (expectedExceptions = IllegalArgumentException.class) public void shouldNotPerformWithNullData() throws TokenStrategyFailedException { compression.perform(null); }
@Test public void shouldOnlyApplyToJSONlikeText() throws TokenStrategyFailedException, UnsupportedEncodingException { byte[] bytes = getBytes("badger"); assertThat(compression.perform(bytes)).isEqualTo(bytes); }
@Test public void shouldCompressBlobContents() throws TokenStrategyFailedException, UnsupportedEncodingException { byte[] first = getBytes("{\"sessionID\":badger}"); assertThat(compression.perform(first).length).isLessThan(first.length); }