IncreaseRespPars extends AbstractPoResponseParser { public int getNewValue() { byte[] newValueBuffer = getApduResponse().getDataOut(); if (newValueBuffer.length == 3) { return ByteArrayUtil.threeBytesToInt(newValueBuffer, 0); } else { throw new IllegalStateException( "No counter value available in response to the Increase command."); } } IncreaseRespPars(ApduResponse response, IncreaseCmdBuild builder); int getNewValue();  }
@Test public void increaseRespPars_getNewValue() { IncreaseRespPars increaseRespPars = new IncreaseRespPars(new ApduResponse(ByteArrayUtil.fromHex(APDU_INCREASE), null), null); increaseRespPars.checkStatus(); assertThat(increaseRespPars.getNewValue()).isEqualTo(NEW_VALUE); }