### Question:
RelyingParty { public static RelyingPartyBuilder.MandatoryStages builder() { return new RelyingPartyBuilder.MandatoryStages(); } private  RelyingParty(
        @NonNull RelyingPartyIdentity identity,
        Set<String> origins,
        @NonNull CredentialRepository credentialRepository,
        @NonNull Optional<AppId> appId,
        @NonNull Optional<AttestationConveyancePreference> attestationConveyancePreference,
        @NonNull Optional<MetadataService> metadataService, List<PublicKeyCredentialParameters> preferredPubkeyParams,
        boolean allowOriginPort,
        boolean allowOriginSubdomain,
        boolean allowUnrequestedExtensions,
        boolean allowUntrustedAttestation,
        boolean validateSignatureCounter
    ); PublicKeyCredentialCreationOptions startRegistration(StartRegistrationOptions startRegistrationOptions); RegistrationResult finishRegistration(FinishRegistrationOptions finishRegistrationOptions); AssertionRequest startAssertion(StartAssertionOptions startAssertionOptions); AssertionResult finishAssertion(FinishAssertionOptions finishAssertionOptions); static RelyingPartyBuilder.MandatoryStages builder();  }### Answer:
@Test(expected = NullPointerException.class) public void itHasTheseBuilderMethods() throws InvalidAppIdException { final MetadataService metadataService = new MetadataService() { @Override public Attestation getAttestation(List<X509Certificate> attestationCertificateChain) throws CertificateEncodingException { return null; } }; RelyingParty.builder() .identity(null) .credentialRepository(null) .origins(Collections.emptySet()) .appId(new AppId("https: .appId(Optional.of(new AppId("https: .attestationConveyancePreference(AttestationConveyancePreference.DIRECT) .attestationConveyancePreference(Optional.of(AttestationConveyancePreference.DIRECT)) .metadataService(metadataService) .metadataService(Optional.of(metadataService)) .preferredPubkeyParams(Collections.emptyList()) .allowUnrequestedExtensions(true) .allowUntrustedAttestation(true) .validateSignatureCounter(true) ; }
@Test public void originsIsImmutable() { Set<String> origins = new HashSet<>(); RelyingParty rp = RelyingParty.builder() .identity(RelyingPartyIdentity.builder().id("localhost").name("Test").build()) .credentialRepository(new CredentialRepository() { @Override public Set<PublicKeyCredentialDescriptor> getCredentialIdsForUsername(String username) { return null; } @Override public Optional<ByteArray> getUserHandleForUsername(String username) { return Optional.empty(); } @Override public Optional<String> getUsernameForUserHandle(ByteArray userHandle) { return Optional.empty(); } @Override public Optional<RegisteredCredential> lookup(ByteArray credentialId, ByteArray userHandle) { return Optional.empty(); } @Override public Set<RegisteredCredential> lookupAll(ByteArray credentialId) { return null; } }) .origins(origins) .build() ; assertEquals(0, rp.getOrigins().size()); origins.add("test"); assertEquals(0, rp.getOrigins().size()); try { rp.getOrigins().add("test"); fail("Expected UnsupportedOperationException to be thrown"); } catch (UnsupportedOperationException e) { assertEquals(0, rp.getOrigins().size()); } }