### Question:
BaseCardComponent implements CardComponent { String truncate(final String value, final int limit) { if (value.length() > limit) { return "..." + value.substring(value.length() - limit); } return value; } BaseCardComponent(final V contentView,
                             final Event<RefreshDecisionComponents> refreshDecisionComponentsEvent); @PostConstruct void init(); void setup(final DMNCardsGridComponent grid,
                      final R includedModel); @Override HasCssName getIcon(); @Override String getTitle(); @Override String getUUID(); @Override HTMLElement getContent(); @Override Function<String, Boolean> onTitleChanged(); void remove();  }### Answer:
@Test public void testTruncateWhenItIsTruncated() { final String actualTruncate = card.truncate("123456", 5); final String expectedTruncate = "...23456"; assertEquals(expectedTruncate, actualTruncate); }
@Test public void testTruncateWhenItIsNotTruncated() { final String actualTruncate = card.truncate("12345", 5); final String expectedTruncate = "12345"; assertEquals(expectedTruncate, actualTruncate); }