### Question:
LQEvent extends LQModel { public static boolean hasValidName(String name, boolean raiseException) { boolean valid = name == null || name.length() == 0 || (name.charAt(0) != '_' && !name.contains("$") && !name.contains(".") && !name.contains("\0")); if(!valid) { LiquidTools.exceptionOrLog(raiseException, "Event name cannot start with \'_\' and cannot contain invalid chars: (. $ \\0)"); } return valid; } LQEvent(String name, HashMap<String,Object> attributes, Date date);  LQEvent(String name, HashMap<String,Object> attributes); void setName(String name); String getName(); JSONObject toJSON(); static boolean hasValidName(String name, boolean raiseException); static final String UNNAMED_EVENT; }### Answer:
@Test public void testValidName() { assertTrue( "Should be valid name", LQEvent.hasValidName("custom_event", false) ); }
@Test public void testInvalidEventNameUnderscore() { assertFalse( "( _ )in the beginning of the event name", LQEvent.hasValidName("_custom_event", false) ); }
@Test public void testInvalidEventNameDollar() { assertFalse( "Event name with $", LQEvent.hasValidName("custo$m_event", false) ); }
@Test public void testInvalidEventNameDot() { assertFalse( "Event name with .", LQEvent.hasValidName("custo$m_event", false) ); }
@Test public void testInvalidEventNameNullChar() { assertFalse( "Event name with \0", LQEvent.hasValidName("_custom_\0event", false) ); }