### Question:
RepositoryCommonValidations { public static IUser normalizeUserInfo( IUser user ) { user.setLogin( user.getLogin().trim() ); user.setName( user.getName().trim() ); return user; }  static boolean checkUserInfo( IUser user ); static IUser normalizeUserInfo( IUser user );  }### Answer:
@Test( expected = NullPointerException.class ) public void normalizeUserInfo_Null() { RepositoryCommonValidations.normalizeUserInfo( null ); }
@Test public void normalizeUserInfo_Valid() { IUser normalized = RepositoryCommonValidations.normalizeUserInfo( user( "login", "name" ) ); assertEquals( "login", normalized.getLogin() ); assertEquals( "login", normalized.getName() ); }
@Test public void normalizeUserInfo_WithSpaces() { IUser normalized = RepositoryCommonValidations.normalizeUserInfo( user( " login \t\n ", "name" ) ); assertEquals( "login", normalized.getLogin() ); assertEquals( "login", normalized.getName() ); }