Expression { public static boolean isExpression(String value) { return !Strings.isNullOrEmpty(value) && value.trim().length() != 0 && value.contains(EXPRESSION_START) && value.indexOf(EXPRESSION_END) > 1; } private  Expression(String prefix, String key, String defaultValue, String suffix); static boolean isExpression(String value); static Expression of(String value); String getKey(); String getDefaultValue(); String getPrefix(); String getSuffix(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void isExpression() throws Exception { assertFalse(Expression.isExpression(null)); assertFalse(Expression.isExpression("")); assertFalse(Expression.isExpression(" ")); assertFalse(Expression.isExpression("foo")); assertTrue(Expression.isExpression("${foo}")); assertTrue(Expression.isExpression("${foo}/bar")); assertTrue(Expression.isExpression("my/${foo}/bar")); }