PiiStringConversion extends Conversion<String> { @Override public String fromCharSequence(CharSequence value, Schema schema, LogicalType type) { return replacer.replace(value.toString()); }  @Override Class<String> getConvertedType(); @Override String getLogicalTypeName(); @Override String fromCharSequence(CharSequence value, Schema schema, LogicalType type);  }
@Test public void hash() throws Exception { doReturn("bar").when(replacer).replace("foo"); String result = underTest.fromCharSequence("foo", null, null); assertThat(result, is("bar")); }