private static void testTransformation(final Transformation transformation) {
MatcherAssert.assertThat(transformation.getUuid(), Matchers.equalTo("42"));
MatcherAssert.assertThat(transformation.getFunctionType(), Matchers.equalTo(FunctionType.Transformation));
MatcherAssert.assertThat(transformation.getName(), Matchers.equalTo("transformation"));
MatcherAssert.assertThat(transformation.getDescription(), Matchers.equalTo("transformation"));
MatcherAssert.assertThat(transformation.getFunctionDescription(), Matchers.is(Matchers.nullValue()));
MatcherAssert.assertThat(transformation.getParameters(), Matchers.hasSize(1));
MatcherAssert.assertThat(transformation.getParameters(), Matchers.hasItems("transformationInputString"));
MatcherAssert.assertThat(transformation.getComponents(), Matchers.hasSize(3));
final Component c1 = CustomTransformationDeserializerTest.checkComponent(transformation, "1", "compose", "Add pre- or postfix to a string.",
Lists.newArrayList("prefix", "postfix"), Tuple.tuple("inputString", "variable_name"));
final Component c2 = CustomTransformationDeserializerTest.checkComponent(transformation, "2", "case", "Upper/lower-case transformation.",
Lists.newArrayList("to", "language"));
final Component c3 = CustomTransformationDeserializerTest
.checkComponent(transformation, "3", "count", "Returns the an increasing count for each received literal.",
Collections.<String>emptyList(), Tuple.tuple("inputString", "dataset"));
MatcherAssert.assertThat(c1.getInputComponents(), Matchers.is(Matchers.nullValue()));
MatcherAssert.assertThat(c1.getOutputComponents(), Matchers.hasSize(1));
MatcherAssert.assertThat(Iterators.getOnlyElement(c1.getOutputComponents().iterator()), Matchers.is(Matchers.sameInstance(c2)));
MatcherAssert.assertThat(c2.getInputComponents(), Matchers.hasSize(1));
MatcherAssert.assertThat(c2.getOutputComponents(), Matchers.is(Matchers.nullValue()));
MatcherAssert.assertThat(Iterators.getOnlyElement(c2.getInputComponents().iterator()), Matchers.is(Matchers.sameInstance(c1)));
MatcherAssert.assertThat(c3.getInputComponents(), Matchers.is(Matchers.nullValue()));
MatcherAssert.assertThat(c3.getOutputComponents(), Matchers.is(Matchers.nullValue()));
}