@Test public void testCreateExpression() { Expression expression = Expression.createExpression("hello", "there"); assertEquals("hello", expression.getExpression()); assertEquals("there", expression.getLanguage()); expression = Expression.createExpression("hello", null); assertEquals("hello", expression.getExpression()); assertNull(expression.getLanguage()); expression = Expression.createExpression(null, "there"); assertNull(expression); }
public static Expression createExpression(String expression, String language) { if (expression != null) { return new Expression(expression, language); } return null; }
Expression { public static Expression createExpression(String expression, String language) { if (expression != null) { return new Expression(expression, language); } return null; } }
Expression { public static Expression createExpression(String expression, String language) { if (expression != null) { return new Expression(expression, language); } return null; } Expression(String expression, String language);  Expression(String expression);  Expression(Expression toCopy); }
Expression { public static Expression createExpression(String expression, String language) { if (expression != null) { return new Expression(expression, language); } return null; } Expression(String expression, String language);  Expression(String expression);  Expression(Expression toCopy); static Expression createExpressionFromDescribedExpression(String describedExpression); static Expression createExpression(String expression, String language); String getExpression(); String getLanguage(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); }
Expression { public static Expression createExpression(String expression, String language) { if (expression != null) { return new Expression(expression, language); } return null; } Expression(String expression, String language);  Expression(String expression);  Expression(Expression toCopy); static Expression createExpressionFromDescribedExpression(String describedExpression); static Expression createExpression(String expression, String language); String getExpression(); String getLanguage(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }