Arn { public Builder toBuilder() { return builder().withPartition(getPartition()) .withService(getService()) .withAccountId(getAccountId()) .withRegion(getRegion()) .withResource(getResourceAsString()); } private  Arn(Builder builder); String getPartition(); String getService(); String getRegion(); String getAccountId(); ArnResource getResource(); String getResourceAsString(); Builder toBuilder(); static Builder builder(); static Arn fromString(String arn); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void toBuilder() { Arn arn1 = Arn.builder() .withPartition("aws") .withService("s3") .withRegion("us-east-1") .withAccountId("123456789012") .withResource("bucket:finks:1") .build(); Arn arn2 = arn1.toBuilder().build(); assertThat(arn1, is(arn2)); }