SQLStatisticsEventValidator { public static boolean isKeyTooLong(final String statisticKey) { return statisticKey.length() > SQLStatisticConstants.STAT_VAL_SRC_NAME_COLUMN_LENGTH; }  static List<String> validateEvent(final StatisticEvent statisticEvent); static String cleanString(final String dirtyString); static boolean isKeyTooLong(final String statisticKey);  }
@Test void testIsKeyToLong_tooLong() { final StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < SQLStatisticConstants.STAT_VAL_SRC_NAME_COLUMN_LENGTH + 1; i++) { stringBuilder.append("x"); } assertThat(SQLStatisticsEventValidator.isKeyTooLong(stringBuilder.toString())).isTrue(); }
@Test void testIsKeyToLong_notTooLong() { final StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("x"); assertThat(SQLStatisticsEventValidator.isKeyTooLong(stringBuilder.toString())).isFalse(); }