### Question:
NativeSoftBodyUtil { public static IndexBuffer mapIndices(IntBuffer indexMap, IndexBuffer inputBuffer, IndexBuffer reuseBuffer) { int numIndices = inputBuffer.size(); IndexBuffer result; if (reuseBuffer == null) { int vertexCount = Integer.MAX_VALUE; result = IndexBuffer.createIndexBuffer(vertexCount, numIndices); } else { int reuseBufferSize = reuseBuffer.size(); if (reuseBufferSize < numIndices) { logger.log(Level.SEVERE, "outputSize={0}", reuseBufferSize); String message = String.format("Reuse buffer size must be " + "greater than or equal to %d.", numIndices); throw new IllegalArgumentException(message); } result = reuseBuffer; } for (int offset = 0; offset < numIndices; ++offset) { int oldIndex = inputBuffer.get(offset); int newIndex = indexMap.get(oldIndex); result.put(offset, newIndex); } result.getBuffer().limit(numIndices); return result; } private  NativeSoftBodyUtil(); static void appendFromLineMesh(Mesh mesh, PhysicsSoftBody softBody); static void appendFromNativeMesh(IndexedMesh mesh,
            PhysicsSoftBody softBody); static void appendFromTriMesh(Mesh mesh, PhysicsSoftBody softBody); static void appendTetras(PhysicsSoftBody softBody); static IntBuffer generateIndexMap(FloatBuffer positionBuffer); static IndexBuffer mapIndices(IntBuffer indexMap,
            IndexBuffer inputBuffer, IndexBuffer reuseBuffer); static FloatBuffer mapVertexData(IntBuffer indexMap,
            FloatBuffer inputBuffer, int numFloatsPerVertex); static void updateClusterMesh(PhysicsSoftBody body, Mesh store,
            boolean meshInLocalSpace); static void updateMesh(PhysicsSoftBody body,
            IntBuffer vertexToNodeMap, Mesh store, boolean meshInLocalSpace,
            boolean updateNormals, Transform physicsToMesh); static void updatePinMesh(PhysicsSoftBody body, Mesh store,
            boolean meshInLocalSpace); final static Logger logger; }### Answer:
@Test public void testMapIndices() { IntBuffer jme2bulletIndexMap = IntBuffer.wrap( new int[]{0, 1, 0, 2, 3, 3} ); IntBuffer facesIndex = IntBuffer.wrap( new int[]{0, 1, 5, 2, 4, 3} ); IntBuffer resultIndex = IntBuffer.wrap(new int[6]); NativeSoftBodyUtil.mapIndices(jme2bulletIndexMap, IndexBuffer.wrapIndexBuffer(facesIndex), IndexBuffer.wrapIndexBuffer(resultIndex)); for (int i = 0, size = facesIndex.capacity(); i < size; i++) { Assert.assertEquals(resultIndex.get(i), jme2bulletIndexMap.get(facesIndex.get(i))); } }