private int findChunkPosition(final MemoryChunk chunk) {
    Preconditions.checkNotNull(chunk, "Error: Memory chunk can't be null");

    final long address = chunk.getAddress();

    for (int i = 0; i < getNumberOfChunks(); i++) {
      if (address < m_chunks.get(i).getAddress()) {
        return i;
      }
    }

    return m_chunks.size();
  }
Finds the position of a chunk in the sorted list of memory chunks. The returned value is the
index of the list where the chunk would fit in.

@param chunk The chunk ins question.
@return The index where the chunk would fit into the list.
@throws NullPointerException Thrown if the memory chunk is null.
java/zylib/src/main/java/com/google/security/zynamics/zylib/general/memmanager/Memory.java