@Test public void testEmptyConstructor() { StringException x = new StringException(); assertTrue("Error: The pattern cannot be empty".equals(x.toString())); x = new StringException(null); assertTrue("Error: The pattern cannot be empty".equals(x.toString())); }
public String toString() { if (this.patt == null) return "Error: The pattern cannot be empty"; else return this.patt; }
StringException extends Exception { public String toString() { if (this.patt == null) return "Error: The pattern cannot be empty"; else return this.patt; } }
StringException extends Exception { public String toString() { if (this.patt == null) return "Error: The pattern cannot be empty"; else return this.patt; } StringException();  StringException(String pattern); }
StringException extends Exception { public String toString() { if (this.patt == null) return "Error: The pattern cannot be empty"; else return this.patt; } StringException();  StringException(String pattern); String toString(); }
StringException extends Exception { public String toString() { if (this.patt == null) return "Error: The pattern cannot be empty"; else return this.patt; } StringException();  StringException(String pattern); String toString();  }