public virtual void test_withName() { RatesCurveGroupDefinition test = RatesCurveGroupDefinition.builder().name(CurveGroupName.of("Test")).addDiscountCurve(CURVE_DEFN1, GBP).build(); RatesCurveGroupDefinition expected = RatesCurveGroupDefinition.builder().name(CurveGroupName.of("NewName")).addDiscountCurve(CURVE_DEFN1, GBP).build(); RatesCurveGroupDefinition withNewName = test.withName(CurveGroupName.of("NewName")); assertEquals(withNewName, expected); }