@Test public void text_longer_than_max_is_shortend_to_maximum() { assertEquals("I am reduced", sanitizerToTest.sanitize("I am reduced in my length", "I am reduced".length())); assertEquals("I", sanitizerToTest.sanitize("I am reduced in my length", 1)); }
public String sanitize(Object maybeContaminated, int maxLength) { String objAsString = null; if (maybeContaminated!=null) { objAsString = maybeContaminated.toString(); } return sanitize(objAsString, maxLength); }
LogSanitizer { public String sanitize(Object maybeContaminated, int maxLength) { String objAsString = null; if (maybeContaminated!=null) { objAsString = maybeContaminated.toString(); } return sanitize(objAsString, maxLength); } }
LogSanitizer { public String sanitize(Object maybeContaminated, int maxLength) { String objAsString = null; if (maybeContaminated!=null) { objAsString = maybeContaminated.toString(); } return sanitize(objAsString, maxLength); }  }
LogSanitizer { public String sanitize(Object maybeContaminated, int maxLength) { String objAsString = null; if (maybeContaminated!=null) { objAsString = maybeContaminated.toString(); } return sanitize(objAsString, maxLength); }  String sanitize(Object maybeContaminated, int maxLength); String sanitize(String maybeContaminated, int maxLength); }
LogSanitizer { public String sanitize(Object maybeContaminated, int maxLength) { String objAsString = null; if (maybeContaminated!=null) { objAsString = maybeContaminated.toString(); } return sanitize(objAsString, maxLength); }  String sanitize(Object maybeContaminated, int maxLength); String sanitize(String maybeContaminated, int maxLength);  }