private final void debugOutput(BackingUpPrintStream... streams) { for (int index = 0; ; index++) { if (streams[0].getContentItem(index) == null && streams[1].getContentItem(index) == null) { return; } System.out.println("---"); for (BackingUpPrintStream stream : streams) { System.out.println(stream.getContentItem(index)); } } }
private final boolean streamsHaveSimilarContent(BackingUpPrintStream... streams) { for (int index = 0; ; index++) { String firstStringItem = streams[0].getContentItem(index); if (firstStringItem == null) { for (BackingUpPrintStream stream : streams) { if (stream.getContentItem(index) != null) { return false; } } return true; } else { for (BackingUpPrintStream stream : streams) { try { Double.valueOf(firstStringItem); if (!firstStringItem.equals(stream.getContentItem(index))) { return false; } } catch (NumberFormatException e) { } } } } }