private static BidiFlow<int, long, ByteString, string, Task<int>> BidiMaterialized()
{
return BidiFlow.FromGraph(GraphDsl.Create(Sink.First<int>(), (b, s) =>
{
b.From(Source.Single(42).MapMaterializedValue(_=>Task.FromResult(0))).To(s);
var top = b.Add(Flow.Create<int>().Select(x => ((long) x) + 2));
var bottom = b.Add(Flow.Create<ByteString>().Select(x => x.DecodeString(Encoding.UTF8)));
return new BidiShape<int,long,ByteString, string>(top.Inlet, top.Outlet, bottom.Inlet, bottom.Outlet);
}));
}