void (final DependencyContext context, final PrintStream stream) { final OrderProvider op = new OrderProvider(context); forEachEntry((vs, value) -> op.register(value)); final int[] keys = op.get(); for (final int a : keys) { final Collection<V> b = get(a); stream.print(" Key: "); stream.println(context.getValue(a)); stream.println(" Values:"); final List<String> list = new LinkedList<>(); for (final V value : b) { if (value instanceof Streamable) { final ByteArrayOutputStream baos = new ByteArrayOutputStream(); final PrintStream s = new PrintStream(baos); ((Streamable)value).toStream(context, s); list.add(baos.toString()); } else { list.add(value.toString()); } } Collections.sort(list); for (final String l : list) { stream.print(l); } stream.println(" End Of Values"); } }