public void setBuffer(VertexBuffer vb) {
        if (buffers.containsKey(vb.getBufferType().ordinal())) {
            throw new IllegalArgumentException("Buffer type already set: " + vb.getBufferType());
        }

        buffers.put(vb.getBufferType().ordinal(), vb);
        buffersList.add(vb);
        updateCounts();
    }
Sets the {@link VertexBuffer} on the mesh.
This will update the vertex/triangle counts if needed.

@param vb The buffer to set
@throws IllegalArgumentException If the buffer type is already set
jme3-core/src/main/java/com/jme3/scene/Mesh.java