AccessorModels { static int computeCommonByteStride( Iterable<? extends AccessorModel> accessorModels) { int commonByteStride = 1; for (AccessorModel accessorModel : accessorModels) { int elementSize = accessorModel.getElementSizeInBytes(); commonByteStride = Math.max(commonByteStride, elementSize); } return commonByteStride; } private  AccessorModels();   }
@Test public void testCommonByteStride() { DefaultAccessorModel accessorModel0 = new DefaultAccessorModel( GltfConstants.GL_FLOAT, 0, ElementType.VEC3); accessorModel0.setByteStride(3 * Float.BYTES); DefaultAccessorModel accessorModel1 = new DefaultAccessorModel( GltfConstants.GL_FLOAT, 0, ElementType.VEC2); accessorModel1.setByteStride(2 * Float.BYTES); DefaultAccessorModel accessorModel2 = new DefaultAccessorModel( GltfConstants.GL_FLOAT, 0, ElementType.VEC3); accessorModel2.setByteStride(3 * Float.BYTES); List<AccessorModel> accessorModels = Arrays.asList(accessorModel0, accessorModel1, accessorModel2); int expectedCommonByteStride = 12; int actualCommonByteStride = AccessorModels.computeCommonByteStride(accessorModels); assertEquals(expectedCommonByteStride, actualCommonByteStride); }