ImportNoteBuilder { ImportNoteBuilder addMessage(ImportNoteMessage.Type type, String message) { if (!Strings.isNullOrEmpty(message)) { messages.add(new ImportNoteMessage(type, message)); } return this; }  ImportNoteBuilder addInfo(String message); ImportNoteBuilder addWarning(String message); ImportNoteBuilder addError(String message); ImportNoteBuilder setMustReview(boolean mustReview); ImportNoteBuilder setNeedsReview(boolean needsReview); @Override String toString();  }
@Test public void testAddMessage() { ImportNoteBuilder noteBuilder = new ImportNoteBuilder(); noteBuilder.addError("error"); noteBuilder.addInfo("info"); noteBuilder.addWarning("warning"); assertEquals("OK\n" + "[ERROR] error\n" + "[INFO] info\n" + "[WARNING] warning", noteBuilder.toString()); noteBuilder.setNeedsReview(true); assertEquals("NEEDS REVIEW\n" + "[ERROR] error\n" + "[INFO] info\n" + "[WARNING] warning", noteBuilder.toString()); noteBuilder.setMustReview(true); assertEquals("MUST REVIEW\n" + "[ERROR] error\n" + "[INFO] info\n" + "[WARNING] warning", noteBuilder.toString()); }