SetStatementValidator { private static String trimUpdate(final String setter) { final int lastIndexOfUpdate = setter.lastIndexOf(";update("); if (lastIndexOfUpdate >= 0) { return setter.substring(0, lastIndexOfUpdate); } else { return setter; } } private  SetStatementValidator(); static boolean validate(final List<String> setters);  }
@Test public void trimUpdate() { final List<String> setters = new ArrayList<>(); setters.add("$person.setHelloMsg(@{param2});update($person)\n"); assertTrue(SetStatementValidator.validate(setters)); }