@Test public void testNameIsValid() { assertTrue(CustomerManagerEJB.nameIsValid("Jan")); assertFalse(CustomerManagerEJB.nameIsValid("Jan1")); assertTrue(CustomerManagerEJB.nameIsValid("Jan-Piet")); assertFalse(CustomerManagerEJB.nameIsValid("Jan_Piet")); assertTrue(CustomerManagerEJB.nameIsValid("gefräßig")); }
static boolean nameIsValid(String name) { return name.matches("[\\p{L}-]+"); }
CustomerManagerEJB { static boolean nameIsValid(String name) { return name.matches("[\\p{L}-]+"); } }
CustomerManagerEJB { static boolean nameIsValid(String name) { return name.matches("[\\p{L}-]+"); }  }
CustomerManagerEJB { static boolean nameIsValid(String name) { return name.matches("[\\p{L}-]+"); }  @TransactionAttribute(TransactionAttributeType.REQUIRED) void createCustomer(String name); @TransactionAttribute(TransactionAttributeType.NEVER) @SuppressWarnings("unchecked") List<Customer> listCustomers(); }
CustomerManagerEJB { static boolean nameIsValid(String name) { return name.matches("[\\p{L}-]+"); }  @TransactionAttribute(TransactionAttributeType.REQUIRED) void createCustomer(String name); @TransactionAttribute(TransactionAttributeType.NEVER) @SuppressWarnings("unchecked") List<Customer> listCustomers();  }