EncoderUtils { public static List<BioAssemblyData> generateBioassemblies(StructureDataInterface structureDataInterface) { int numBioassemblies = structureDataInterface.getNumBioassemblies(); List<BioAssemblyData> outList = new ArrayList<>(); for (int i=0; i<numBioassemblies; i++) { BioAssemblyData bioassembly = new BioAssemblyData(structureDataInterface.getBioassemblyName(i)); outList.add(bioassembly); int numTrans = structureDataInterface.getNumTransInBioassembly(i); for (int j=0; j<numTrans; j++) { addTransform(bioassembly, structureDataInterface.getChainIndexListForTransform(i, j), structureDataInterface.getMatrixForTransform(i, j)); } } return outList; }  static Group[] generateGroupList(StructureDataInterface structureDataInterface); static List<BioAssemblyData> generateBioassemblies(StructureDataInterface structureDataInterface); static Entity[] generateEntityList(StructureDataInterface structureDataInterface); static String getTypeFromChainId(StructureDataInterface structureDataInterface, int chainInd); static byte[] encodeByteArr(FloatCodecs inputCodec, float[] inputData, int param); static byte[] encodeByteArr(IntCodecs inputCodec, int[] inputData, int param); static byte[] encodeByteArr(CharCodecs inputCodec, char[] inputData, int param); static byte[] encodeByteArr(StringCodecs inputCodec, String[] inputData, int param); static void transferBioassembly(StructureDataInterface structureDataInterface,
			AdapterToStructureData adapterToStructureData); static final int NULL_PARAM; }
@Test public void testGenerateBioassemblies() { List<BioAssemblyData> bioAssemblyData = new ArrayList<>(); BioAssemblyData bioAssemblyOne = new BioAssemblyData("1"); bioAssemblyData.add(bioAssemblyOne); List<BioAssemblyTransformation> bioAssemblyOneTransforms = new ArrayList<>(); BioAssemblyTransformation bioassOneTransOne = new BioAssemblyTransformation(); bioassOneTransOne.setChainIndexList(new int[]{1, 2, 3, 4}); bioassOneTransOne.setMatrix(new double[]{1.0, 2.0, 3.0, 4.0}); bioAssemblyOneTransforms.add(bioassOneTransOne); BioAssemblyTransformation bioassOneTransTwo = new BioAssemblyTransformation(); bioassOneTransTwo.setChainIndexList(new int[]{5, 7, 11}); bioassOneTransTwo.setMatrix(new double[]{5.0, 2.0, 8.0, 4.0}); bioAssemblyOneTransforms.add(bioassOneTransTwo); bioAssemblyOne.setTransformList(bioAssemblyOneTransforms); AdapterToStructureData adapterToStructureData = new AdapterToStructureData(); adapterToStructureData.initStructure(0, 0, 0, 0, 0, "DUMMY"); for (int i = 0; i < bioAssemblyData.size(); i++) { for (int j = 0; j < bioAssemblyData.get(i).getTransformList().size(); j++) { adapterToStructureData.setBioAssemblyTrans(i, bioAssemblyData.get(i).getTransformList().get(j).getChainIndexList(), bioAssemblyData.get(i).getTransformList().get(j).getMatrix(), bioAssemblyData.get(i).getName()); } } List<BioAssemblyData> generateBioass = EncoderUtils.generateBioassemblies(adapterToStructureData); assertEquals(bioAssemblyData.get(0).getName(), generateBioass.get(0).getName()); assertArrayEquals(bioAssemblyData.get(0).getTransformList().get(0).getChainIndexList(), generateBioass.get(0).getTransformList().get(0).getChainIndexList()); assertArrayEquals(bioAssemblyData.get(0).getTransformList().get(0).getMatrix(), generateBioass.get(0).getTransformList().get(0).getMatrix(), 0.0); }