### Question:
MaxStepCriteria implements IBreakCriteria { @Override public boolean shouldBreak(IHierarchicalNodeLayout layout) { if(layout.getDelegate()==null) return false; if(layout.getDelegate().getCounter()>maxSteps) return true; else return false; } MaxStepCriteria();  MaxStepCriteria(int maxSteps); @Override boolean shouldBreak(IHierarchicalNodeLayout layout); @Override void onBreak(); int getMaxSteps();  }### Answer:
@Test public void testMaxSteps(){ IHierarchicalNodeLayout mockLayout = mockLayoutCounter(3); MaxStepCriteria c = new MaxStepCriteria(2); Assert.assertFalse(c.shouldBreak(mockLayout)); Assert.assertFalse(c.shouldBreak(mockLayout)); Assert.assertFalse(c.shouldBreak(mockLayout)); Assert.assertTrue(c.shouldBreak(mockLayout)); }