ConcatFunction implements DDMExpressionFunction.Function1<Object[], String> { @Override public String apply(Object[] values) { return Stream.of( values ).filter( Validator::isNotNull ).map( Object::toString ).collect( Collectors.joining() ); }  @Override String apply(Object[] values); @Override String getName(); static final String NAME; }
@Test public void testApply1() { ConcatFunction concatFunction = new ConcatFunction(); String actualString = concatFunction.apply( new String[] {"liferay", "forms"}); Assert.assertEquals("liferayforms", actualString); }
@Test public void testApply2() { ConcatFunction concatFunction = new ConcatFunction(); String actualString = concatFunction.apply( new String[] {"liferay", null, "forms"}); Assert.assertEquals("liferayforms", actualString); }
@Test public void testApply3() { ConcatFunction concatFunction = new ConcatFunction(); String actualString = concatFunction.apply( new String[] {"liferay", null}); Assert.assertEquals("liferay", actualString); }
@Test public void testApply4() { ConcatFunction concatFunction = new ConcatFunction(); String actualString = concatFunction.apply(new String[] {null, null}); Assert.assertEquals("", actualString); }