KeyboardRow extends ArrayList<KeyboardButton> implements Validable { public void addAll(List<String> buttonNames) { buttonNames.forEach(name -> super.add(new KeyboardButton(name))); }  boolean add(String text); void add(int index, String text); void addAll(List<String> buttonNames); boolean contains(String text); int lastIndexOf(String text); int indexOf(String text); KeyboardButton set(int index, String text); boolean remove(String text); @Override void validate();  }
@Test void shouldAddAllButtons() { final KeyboardRow keyboardRow = new KeyboardRow(); keyboardRow.addAll(BUTTON_NAMES); assertEquals(2, keyboardRow.size()); assertEquals("Carlotta Valdes", keyboardRow.get(0).getText()); assertEquals("Jimmy Stewart", keyboardRow.get(1).getText()); }
@Test void shouldAddNoButtons() { final KeyboardRow keyboardRow = new KeyboardRow(); keyboardRow.addAll(new ArrayList<String>()); assertTrue(keyboardRow.isEmpty()); }