adding consistency chck java program