LimitViolation extends AbstractExtendable<LimitViolation> { public String toString() { return "Subject id: " + this.subjectId + ", Subject name: " + this.subjectName + ", limitType: " + this.limitType + ", limit: " + this.limit + ", limitName: " + this.limitName + ", acceptableDuration: " + this.acceptableDuration + ", limitReduction: " + this.limitReduction + ", value: " + this.value + ", side: " + this.side; } LimitViolation(String subjectId, @Nullable String subjectName, LimitViolationType limitType, @Nullable String limitName, int acceptableDuration,
                          double limit, float limitReduction, double value, @Nullable Branch.Side side);  LimitViolation(String subjectId, LimitViolationType limitType, String limitName, int acceptableDuration,
                          double limit, float limitReduction, double value, Branch.Side side);  LimitViolation(String subjectId, String subjectName, LimitViolationType limitType, double limit, float limitReduction, double value);  LimitViolation(String subjectId, LimitViolationType limitType, double limit, float limitReduction, double value); String getSubjectId(); @Nullable String getSubjectName(); LimitViolationType getLimitType(); double getLimit(); @Nullable String getLimitName(); int getAcceptableDuration(); float getLimitReduction(); double getValue(); @Nullable Branch.Side getSide(); String toString();  }
@Test public void testToString() { LimitViolation limitViolation1 = new LimitViolation("testId", null, LimitViolationType.HIGH_VOLTAGE, "high", Integer.MAX_VALUE, 420, 1, 500, null); LimitViolation limitViolation2 = new LimitViolation("testId", null, LimitViolationType.CURRENT, null, 6300, 1000, 1, 1100, Branch.Side.ONE); String expected1 = "Subject id: testId, Subject name: null, limitType: HIGH_VOLTAGE, limit: 420.0, limitName: high, acceptableDuration: 2147483647, limitReduction: 1.0, value: 500.0, side: null"; String expected2 = "Subject id: testId, Subject name: null, limitType: CURRENT, limit: 1000.0, limitName: null, acceptableDuration: 6300, limitReduction: 1.0, value: 1100.0, side: ONE"; assertEquals(expected1, limitViolation1.toString()); assertEquals(expected2, limitViolation2.toString()); }