Define a Java class to solve this problem:
Given a String and a Character, remove all instances of the Character in the String
Solve this two ways:
- Iterate through the String, one character at a time
- Find a method in the String class that can solve this in one line
Write methods for each solution.
Afterwards, write a TestNG or JUnit class for each solution which tests these methods.
Include both positive and negative cases for validations.