### Question:
EstimationSanityChecker { public void sanityCheck( Input.Estimates estimates ) { sanityCheckEstimateWithMaxId( estimates.numberOfNodes(), formats.node().getMaxId(), monitor::mayExceedNodeIdCapacity ); sanityCheckEstimateWithMaxId( estimates.numberOfRelationships(), formats.relationship().getMaxId(), monitor::mayExceedRelationshipIdCapacity ); } EstimationSanityChecker( RecordFormats formats, ImportLogic.Monitor monitor ); void sanityCheck( Input.Estimates estimates );  }### Answer:
@Test public void shouldWarnAboutCountGettingCloseToCapacity() { RecordFormats formats = Standard.LATEST_RECORD_FORMATS; Monitor monitor = mock( Monitor.class ); Estimates estimates = Inputs.knownEstimates( formats.node().getMaxId() - 1000, formats.relationship().getMaxId() - 1000, 0, 0, 0, 0, 0 ); new EstimationSanityChecker( formats, monitor ).sanityCheck( estimates ); verify( monitor ).mayExceedNodeIdCapacity( formats.node().getMaxId(), estimates.numberOfNodes() ); verify( monitor ).mayExceedRelationshipIdCapacity( formats.relationship().getMaxId(), estimates.numberOfRelationships() ); }
@Test public void shouldWarnAboutCounthigherThanCapacity() { RecordFormats formats = Standard.LATEST_RECORD_FORMATS; Monitor monitor = mock( Monitor.class ); Estimates estimates = Inputs.knownEstimates( formats.node().getMaxId() * 2, formats.relationship().getMaxId() * 2, 0, 0, 0, 0, 0 ); new EstimationSanityChecker( formats, monitor ).sanityCheck( estimates ); verify( monitor ).mayExceedNodeIdCapacity( formats.node().getMaxId(), estimates.numberOfNodes() ); verify( monitor ).mayExceedRelationshipIdCapacity( formats.relationship().getMaxId(), estimates.numberOfRelationships() ); }
@Test public void shouldNotWantIfCountWayLowerThanCapacity() { RecordFormats formats = Standard.LATEST_RECORD_FORMATS; Monitor monitor = mock( Monitor.class ); Estimates estimates = Inputs.knownEstimates( 1000, 1000, 0, 0, 0, 0, 0 ); new EstimationSanityChecker( formats, monitor ).sanityCheck( estimates ); verifyNoMoreInteractions( monitor ); }