public String toJsonString(Object object) {
    return String.valueOf(toJson(object));
  }
@Test
  public void testCustomPattern() {
    Obfuscator obfuscator = new Obfuscator("verycustomized", Collections.singletonList(Pattern.compile("^value$")));
    String output = obfuscator.toJsonString(_nestedMap);
    Assert.assertFalse(output.contains(VALUE));
    Assert.assertTrue(output.contains("verycustomized"));
    Assert.assertTrue(output.contains(SECRET));
  }