### Question:
Security { public static void printPreContingencyViolations(SecurityAnalysisResult result, Network network, Writer writer, TableFormatterFactory formatterFactory, LimitViolationFilter limitViolationFilter) { printPreContingencyViolations(result, network, writer, formatterFactory, TableFormatterConfig.load(), limitViolationFilter); } private  Security(); static List<LimitViolation> checkLimits(Network network); static List<LimitViolation> checkLimits(Network network, float limitReduction); static List<LimitViolation> checkLimits(Network network, CurrentLimitType currentLimitType, float limitReduction); static List<LimitViolation> checkLimits(Network network, Set<CurrentLimitType> currentLimitTypes, float limitReduction); static String printLimitsViolations(Network network); static String printLimitsViolations(Network network, boolean writeName); static String printLimitsViolations(Network network, LimitViolationFilter filter); static String printLimitsViolations(List<LimitViolation> violations, Network network); static String printLimitsViolations(List<LimitViolation> violations, Network network, LimitViolationFilter filter); static String printLimitsViolations(List<LimitViolation> violations, Network network, LimitViolationFilter filter, TableFormatterConfig formatterConfig); static String printLimitsViolations(List<LimitViolation> violations, Network network, LimitViolationWriteConfig printConfig); static void printPreContingencyViolations(SecurityAnalysisResult result, Network network, Writer writer, TableFormatterFactory formatterFactory,
                                                     LimitViolationFilter limitViolationFilter); static void printPreContingencyViolations(SecurityAnalysisResult result, Network network, Writer writer, TableFormatterFactory formatterFactory,
                                                     TableFormatterConfig formatterConfig, LimitViolationFilter limitViolationFilter); static void printPreContingencyViolations(SecurityAnalysisResult result, Network network, Writer writer, TableFormatterFactory formatterFactory,
                                                     LimitViolationWriteConfig printConfig); static void printPostContingencyViolations(SecurityAnalysisResult result, Network network, Writer writer, TableFormatterFactory formatterFactory,
            LimitViolationFilter limitViolationFilter); static void printPostContingencyViolations(SecurityAnalysisResult result, Network network, Writer writer, TableFormatterFactory formatterFactory,
                                                      LimitViolationFilter limitViolationFilter, boolean filterPreContingencyViolations); static void printPostContingencyViolations(SecurityAnalysisResult result, Network network, Writer writer, TableFormatterFactory formatterFactory,
                                                      TableFormatterConfig formatterConfig, LimitViolationFilter limitViolationFilter, boolean filterPreContingencyViolations); static void printPostContingencyViolations(SecurityAnalysisResult result, Network network, Writer writer, TableFormatterFactory formatterFactory,
                                                      PostContingencyLimitViolationWriteConfig writeConfig); static void print(SecurityAnalysisResult result, Network network, Writer writer, TableFormatterFactory tableFormatterFactory, TableFormatterConfig tableFormatterConfig); static void print(SecurityAnalysisResult result, Network network, Writer writer, TableFormatterFactory tableFormatterFactory,
                             PostContingencyLimitViolationWriteConfig writeConfig);  }### Answer:
@Test public void printPreContingencyViolations() throws Exception { StringWriter writer = new StringWriter(); try { Security.printPreContingencyViolations(result, network, writer, formatterFactory, formatterConfig, null); } finally { writer.close(); } assertEquals(String.join(System.lineSeparator(), "Pre-contingency violations", "Action,Equipment (1),End,Country,Base voltage,Violation type,Violation name,Value,Limit,abs(value-limit),Loading rate %", "action1,,,,,,,,,,", ",NHV1_NHV2_1,VLHV1,FR,380,CURRENT,Permanent limit,1100.0000,950.0000,150.0000,110.00"), writer.toString().trim()); }