[java] implementing search functions.