### Question:
QrData { public String getUri() { return "otpauth: uriEncode(type) + "/" + uriEncode(label) + "?" + "secret=" + uriEncode(secret) + "&issuer=" + uriEncode(issuer) + "&algorithm=" + uriEncode(algorithm) + "&digits=" + digits + "&period=" + period; } private  QrData(String type, String label, String secret, String issuer, String algorithm, int digits, int period); String getType(); String getLabel(); String getSecret(); String getIssuer(); String getAlgorithm(); int getDigits(); int getPeriod(); String getUri();  }### Answer:
@Test public void testUriGeneration() { QrData data = new QrData.Builder() .label("example@example.com") .secret("the-secret-here") .issuer("AppName AppCorp") .algorithm(HashingAlgorithm.SHA256) .digits(6) .period(30) .build(); assertEquals( "otpauth: data.getUri() ); }
@Test public void testNullFieldUriGeneration() { QrData data = new QrData.Builder() .label(null) .secret(null) .issuer("AppName AppCorp") .algorithm(HashingAlgorithm.SHA256) .digits(6) .period(30) .build(); assertEquals( "otpauth: data.getUri() ); }