@Test public void variantBuildMethodProducesNewInstances() throws Exception { final Variant original=defaultVariantBuilder().variant(); final Variant copy=Variants.from(original).variant(); assertThat(copy,not(sameInstance(original))); checkDefaultValues(copy); }
public static VariantBuilder from(Variant variant) { requireNonNull(variant,"Variant cannot be null"); return builder(). type(variant.type()). charset(variant.charset()). language(variant.language()); }
Variants { public static VariantBuilder from(Variant variant) { requireNonNull(variant,"Variant cannot be null"); return builder(). type(variant.type()). charset(variant.charset()). language(variant.language()); } }
Variants { public static VariantBuilder from(Variant variant) { requireNonNull(variant,"Variant cannot be null"); return builder(). type(variant.type()). charset(variant.charset()). language(variant.language()); } private  Variants(); }
Variants { public static VariantBuilder from(Variant variant) { requireNonNull(variant,"Variant cannot be null"); return builder(). type(variant.type()). charset(variant.charset()). language(variant.language()); } private  Variants(); static boolean equals(final Variant v1, final Variant v2); static MediaType contentType(Variant variant); static VariantBuilder builder(); static VariantBuilder from(Variant variant); }
Variants { public static VariantBuilder from(Variant variant) { requireNonNull(variant,"Variant cannot be null"); return builder(). type(variant.type()). charset(variant.charset()). language(variant.language()); } private  Variants(); static boolean equals(final Variant v1, final Variant v2); static MediaType contentType(Variant variant); static VariantBuilder builder(); static VariantBuilder from(Variant variant);  }