@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."); //To change body of generated methods, choose Tools | Templates.
    }
    @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."); //To change body of generated methods, choose Tools | Templates.
    }
  };
  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."); //To change body of generated methods, choose Tools | Templates.
    }
    @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."); //To change body of generated methods, choose Tools | Templates.
    }
  };
  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"));
}