### Question:
ThriftValidate { public static void prepareUser(User user) throws SW360Exception { assertNotEmpty(user.getEmail()); user.setType(TYPE_USER); user.unsetCommentMadeDuringModerationRequest(); } private  ThriftValidate(); static void prepareTodo(Obligation oblig); static void prepareLicense(License license); static void prepareUser(User user); static void prepareVendor(Vendor vendor); static void prepareComponent(Component component); static List<Component> prepareComponents(Collection<Component> components); static void prepareRelease(Release release); static Release ensureEccInformationIsSet(Release release); static List<Release> prepareReleases(Collection<Release> components); static void validateAttachment(AttachmentContent attachment); static void validateNewLicense(License license); static void validateExistingLicense(License license); static void prepareProject(Project project); static void prepareProjectObligation(ObligationList obligation);  }### Answer:
@Test(expected = SW360Exception.class) public void testPrepareUserExceptionThrownIfNoEmailAddress() throws Exception { User blankUser = new User(); prepareUser(blankUser); }
@Test public void testPrepareUser() throws Exception { User user = new User(); user.setEmail(DUMMY_EMAIL_ADDRESS); user.setCommentMadeDuringModerationRequest(DUMMY_MODERATION_COMMENT); prepareUser(user); assertNull(user.getId()); assertEquals(TYPE_USER, user.getType()); assertFalse(user.isSetCommentMadeDuringModerationRequest()); }