### Question:
LogcatAppender extends UnsynchronizedAppenderBase<ILoggingEvent> { protected String getTag(ILoggingEvent event) { String tag = (this.tagEncoder != null) ? this.tagEncoder.getLayout().doLayout(event) : event.getLoggerName(); if (checkLoggable && (tag.length() > MAX_TAG_LENGTH)) { tag = tag.substring(0, MAX_TAG_LENGTH - 1) + "*"; } return tag; } LogcatAppender(); @Override void start(); void append(ILoggingEvent event); PatternLayoutEncoder getEncoder(); void setEncoder(PatternLayoutEncoder encoder); PatternLayoutEncoder getTagEncoder(); void setTagEncoder(PatternLayoutEncoder encoder); void setCheckLoggable(boolean enable); boolean getCheckLoggable();  }### Answer:
@Test public void longTagAllowedIfNotCheckLoggable() { LoggingEvent event = new LoggingEvent(); event.setMessage(TAG); boolean checkLoggable = false; setTagPattern(TAG, checkLoggable); String actualTag = logcatAppender.getTag(event); assertThat(TRUNCATED_TAG, is(not(actualTag))); assertThat(TAG, is(actualTag)); }
@Test public void longTagTruncatedIfCheckLoggable() { LoggingEvent event = new LoggingEvent(); event.setMessage(TAG); boolean checkLoggable = true; setTagPattern(TAG, checkLoggable); String actualTag = logcatAppender.getTag(event); assertThat(TRUNCATED_TAG, is(actualTag)); assertThat(TAG, is(not(actualTag))); }