@Override
    public String getOtp() throws OtpInfoException {
        checkSecret();

        try {
            OTP otp = HOTP.generateOTP(getSecret(), getAlgorithm(true), getDigits(), getCounter());
            return otp.toString();
        } catch (NoSuchAlgorithmException | InvalidKeyException e) {
            throw new RuntimeException(e);
        }
    }
@Test
    public void testHotpInfoOtp() throws OtpInfoException {
        for (int i = 0; i < HOTPTest.VECTORS.length; i++) {
            HotpInfo info = new HotpInfo(HOTPTest.SECRET, OtpInfo.DEFAULT_ALGORITHM, OtpInfo.DEFAULT_DIGITS, i);
            assertEquals(info.getOtp(), HOTPTest.VECTORS[i]);
        }
    }