### Question:
CredentialBuilder implements Builder<Credential> { public static CredentialBuilder createFromExisting(final Credential credential) { return new CredentialBuilder(new ModifyOnce<>(credential.getName()), new ModifyOnce<>(credential.getType()), new ArrayList<>(credential.getConfigurationEntries())); } private  CredentialBuilder(final ModifyOnce<String> name,
            final ModifyOnce<String> type,
            final List<ConfigurationEntry> configurationEntries); static CredentialBuilder create(); static CredentialBuilder createFromExisting(final Credential credential); CredentialBuilder withName(final String name); CredentialBuilder withType(final String type); CredentialBuilder withConfigurationEntry(final String name,
                                                    final String description); @Override Credential build();  }### Answer:
@Test public void testCreateFromExisting() { final Credential credential = CredentialBuilder.create() .withName("hive2") .withType("hive") .withConfigurationEntry("jdbcUrl", "jdbc: .build(); final Credential fromExisting = CredentialBuilder.createFromExisting(credential).build(); assertEquals("hive2", fromExisting.getName()); assertEquals("hive", fromExisting.getType()); assertEquals("jdbcUrl", fromExisting.getConfigurationEntries().get(0).getName()); assertEquals("jdbc: }