PaddedCell { public boolean misbehaved() { boolean isWellBehaved = type == Type.CONVERGE && steps.size() <= 1; return !isWellBehaved; } private  PaddedCell(File file, Type type, List<String> steps); File file(); Type type(); List<String> steps(); static PaddedCell check(Formatter formatter, File file); static PaddedCell check(Formatter formatter, File file, String originalUnix); boolean misbehaved(); boolean isResolvable(); String canonical(); String userMessage(); static DirtyState calculateDirtyState(Formatter formatter, File file); static DirtyState calculateDirtyState(Formatter formatter, File file, byte[] rawBytes); static DirtyState isClean();  }
@Test public void pingPong() throws IOException { misbehaved(input -> input.equals("A") ? "B" : "A", "CCC", CYCLE, "A,B", "A"); }
@Test public void fourState() throws IOException { misbehaved(input -> { switch (input) { case "A": return "B"; case "B": return "C"; case "C": return "D"; default: return "A"; } }, "CCC", CYCLE, "A,B,C,D", "A"); }
@Test public void converging() throws IOException { misbehaved(input -> { if (input.isEmpty()) { return input; } else { return input.substring(0, input.length() - 1); } }, "CCC", CONVERGE, "CC,C,", ""); }
@Test public void diverging() throws IOException { misbehaved(input -> input + " ", "", DIVERGE, " , , , , , , , , , ", null); }