Cron { @Override public String toString() { return "Cron {" + "expression='" + expression + '\'' + '}'; } Cron(String expression); String getExpression(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void expressionTest() { String expression = "* * 8 0 * *"; Cron cron = new Cron(expression); assertEquals( "Cron {" + "expression='" + expression + '\'' + '}', cron.toString()); }