### Question:
IdBriefErrorTemplate implements PrettyPrintable { @Override public String toPrettyString() { StringBuilder sb = new StringBuilder(); if (idKey != null && StringUtils.isNotBlank(idValue)) { sb.append(idKey.getConstant()).append(": ").append(this.idValue).append("\n"); } sb.append(this.briefError.toPrettyString()); return sb.toString(); }  @Override String toPrettyString();  }### Answer:
@Test public void testToPrettyString() { final IdBriefErrorTemplateKey testQueryIdKey = IdBriefErrorTemplateKey.QUERY_ID; final String testQueryIdValue = "TestQueryIdValue"; final BriefError mockBriefError = mock(BriefError.class); final String testBriefErrorPrettyString = "TestLensBriefErrorPrettyString"; when(mockBriefError.toPrettyString()).thenReturn(testBriefErrorPrettyString); IdBriefErrorTemplate template = new IdBriefErrorTemplate(testQueryIdKey, testQueryIdValue, mockBriefError); final String actualPrettyString = template.toPrettyString(); final String expectedPrettyString = "Query Id: TestQueryIdValue\nTestLensBriefErrorPrettyString"; assertEquals(actualPrettyString, expectedPrettyString); }