Here you can find the source of assertCheckStrAndQuery(String str, String query)
private static void assertCheckStrAndQuery(String str, String query)
//package com.java2s; //License from project: Open Source License public class Main { static final String QUERY_CANNOT_BE_EMPTY_MESSAGE = "query cannot be empty"; static final String QUERY_LEN_SHOULD_BE_ONE_MESSAGE = "query parameter should be a single word"; static final String QUERY_CANNOT_BE_NULL_MESSAGE = "query cannot be null"; static final String STR_CANNOT_BE_NULL_MESSAGE = "str cannot be null"; private static final String WHITESPACE_DELIMITER = "\\s+"; /**//w ww .j a v a 2s .co m * Checks that str is not null, and query is not null, not empty, and is a single word. */ private static void assertCheckStrAndQuery(String str, String query) { assert str != null : STR_CANNOT_BE_NULL_MESSAGE; assert query != null : QUERY_CANNOT_BE_NULL_MESSAGE; assert !query.isEmpty() : QUERY_CANNOT_BE_EMPTY_MESSAGE; assert query.split(WHITESPACE_DELIMITER).length == 1 : QUERY_LEN_SHOULD_BE_ONE_MESSAGE; } }