JBBPCustomFieldTypeProcessorAggregator implements JBBPCustomFieldTypeProcessor { @Override public String[] getCustomFieldTypes() { return this.types; } JBBPCustomFieldTypeProcessorAggregator(final JBBPCustomFieldTypeProcessor... processors); @Override String[] getCustomFieldTypes(); @Override boolean isAllowed(final JBBPFieldTypeParameterContainer fieldType, final String fieldName, final int extraData, final boolean isArray); @Override JBBPAbstractField readCustomFieldType(JBBPBitInputStream in, JBBPBitOrder bitOrder, int parserFlags, JBBPFieldTypeParameterContainer fieldType, JBBPNamedFieldInfo fieldName, int extraData, boolean readWholeStream, int arrayLength);  }
@Test public void testJoiningTypes() throws Exception { final JBBPCustomFieldTypeProcessor proc1 = new JBBPCustomFieldTypeProcessor() { @Override public String[] getCustomFieldTypes() { return new String[] {"type1", "type2", "type3"}; } @Override public boolean isAllowed(JBBPFieldTypeParameterContainer fieldType, String fieldName, int extraData, boolean isArray) { throw new UnsupportedOperationException("Not supported yet."); } @Override public JBBPAbstractField readCustomFieldType(JBBPBitInputStream in, JBBPBitOrder bitOrder, int parserFlags, JBBPFieldTypeParameterContainer customTypeFieldInfo, JBBPNamedFieldInfo fieldName, int extraData, boolean readWholeStream, int arrayLength) throws IOException { throw new UnsupportedOperationException("Not supported yet."); } }; final JBBPCustomFieldTypeProcessor proc2 = new JBBPCustomFieldTypeProcessor() { @Override public String[] getCustomFieldTypes() { return new String[] {"type4", "type5", "type6"}; } @Override public boolean isAllowed(JBBPFieldTypeParameterContainer fieldType, String fieldName, int extraData, boolean isArray) { throw new UnsupportedOperationException("Not supported yet."); } @Override public JBBPAbstractField readCustomFieldType(JBBPBitInputStream in, JBBPBitOrder bitOrder, int parserFlags, JBBPFieldTypeParameterContainer customTypeFieldInfo, JBBPNamedFieldInfo fieldName, int extraData, boolean readWholeStream, int arrayLength) throws IOException { throw new UnsupportedOperationException("Not supported yet."); } }; final List<String> types = Arrays.asList(new JBBPCustomFieldTypeProcessorAggregator(proc1, proc2).getCustomFieldTypes()); assertEquals(6, types.size()); assertTrue(types.contains("type1")); assertTrue(types.contains("type2")); assertTrue(types.contains("type3")); assertTrue(types.contains("type4")); assertTrue(types.contains("type5")); assertTrue(types.contains("type6")); }