Test Class
@Test
public void testCharRemover() {
TextModifier remover = new CharRemover('x');
StringBuilder buff = new StringBuilder("a bx xd xx");
remover.modifyText(buff);
Assert.assertEquals("a b d ", buff.toString());
}
-------------------------------------------------------
/**
* Removes all occurrences of the character passed to the constructor
* from the input when {@link TextModifier#modifyText(StringBuilder)}
* is called.
*/
public class CharRemover implements TextModifier {
// TODO
public CharRemover(char charToRemove) {
// TODO
}
----------------------------------------------------
I am confused where to start. I know that I have to take in the string and remove the "x" and then return the string. But thats about it.