code: @Override
  	public CPInstance[] findByLtD_S_PrevAndNext(long CPInstanceId,
  		Date displayDate, int status,
  		OrderByComparator<CPInstance> orderByComparator)
  		throws NoSuchCPInstanceException {
  		CPInstance cpInstance = findByPrimaryKey(CPInstanceId);
  
  		Session session = null;
  
  		try {
  			session = openSession();
  
  			CPInstance[] array = new CPInstanceImpl[3];
  
  			array[0] = getByLtD_S_PrevAndNext(session, cpInstance, displayDate,
  					status, orderByComparator, true);
  
  			array[1] = cpInstance;
  
  			array[2] = getByLtD_S_PrevAndNext(session, cpInstance, displayDate,
  					status, orderByComparator, false);
  
  			return array;
  		}
  		catch (Exception e) {
  			throw processException(e);
  		}
  		finally {
  			closeSession(session);
  		}
  	}
docs: Returns the cp instances before and after the current cp instance in the ordered set where displayDate &lt; &#63; and status = &#63;.
  
  @param CPInstanceId the primary key of the current cp instance
  @param displayDate the display date
  @param status the status
  @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
  @return the previous, current, and next cp instance
  @throws NoSuchCPInstanceException if a cp instance with the primary key could not be found