### Question:
CorbaUtils { public static TypeCode getTypeCode(ORB orb, QName type, CorbaTypeMap typeMap) { Stack<QName> seenTypes = new Stack<>(); return getTypeCode(orb, type, null, typeMap, seenTypes); } private  CorbaUtils(); static QName getEmptyQName(); static TypeCode getTypeCode(ORB orb, QName type, CorbaTypeMap typeMap); static TypeCode getTypeCode(ORB orb,
                                       QName type,
                                       CorbaTypeMap typeMap,
                                       Stack<QName> seenTypes); static TypeCode getTypeCode(ORB orb,
                                       QName type,
                                       CorbaType obj,
                                       CorbaTypeMap typeMap); static TypeCode getTypeCode(ORB orb,
                                       QName type,
                                       CorbaType obj,
                                       CorbaTypeMap typeMap,
                                       Stack<QName> seenTypes); static TypeCode getPrimitiveTypeCode(ORB orb, QName type); static TypeCode getComplexTypeCode(ORB orb,
                                              QName type,
                                              Object obj,
                                              CorbaTypeMap typeMap,
                                              Stack<QName> seenTypes); static TypeCode getUnionTypeCode(ORB orb,
                                            Object obj,
                                            CorbaTypeMap typeMap,
                                            Stack<QName> seenTypes); static String getTypeCodeName(String name); static boolean isPrimitiveIdlType(QName idltype); static boolean isPrimitiveTypeCode(TypeCode tc); static CorbaType getCorbaType(QName idlType, CorbaTypeMap typeMap); static CorbaTypeMap createCorbaTypeMap(List<TypeMappingType> tmTypes); static boolean isValidURL(String url); static String getUniquePOAName(QName serviceName, String portName, String poaName); static boolean isIOR(String location); static String exportObjectReference(org.omg.CORBA.Object obj, ORB orb); static org.omg.CORBA.Object importObjectReference(ORB orb,
                                                             String url); static org.omg.CORBA.Object importObjectReferenceFromFile(ORB orb,
                                                                     String url); static XmlSchemaType getXmlSchemaType(ServiceInfo serviceInfo, QName name); static boolean isElementFormQualified(ServiceInfo serviceInfo, String uri); static boolean isAttributeFormQualified(ServiceInfo serviceInfo, String uri); static QName processQName(QName qname, ServiceInfo serviceInfo); static NVList nvListFromStreamables(ORB orb, CorbaStreamable[] streamables);  }### Answer:
@Test public void testErrorConditionNullTypeQName() { try { CorbaUtils.getTypeCode(orb, null, new CorbaTypeMap("dud:namespace")); fail("expect exception on null type"); } catch (CorbaBindingException expected) { } CorbaTypeMap typeMap = new CorbaTypeMap("dud:namespace"); QName seen = new QName("bla", "Bla"); Stack<QName> seenTypes = new Stack<>(); seenTypes.add(seen); try { CorbaUtils.getTypeCode(orb, null, typeMap, seenTypes); fail("expect exception on null type"); } catch (CorbaBindingException expected) { assertTrue("enclosed type is present", expected.getMessage().indexOf(seen.toString()) != -1); } CorbaType ctype = new CorbaType(); try { CorbaUtils.getTypeCode(orb, null, ctype, typeMap); fail("expect exception on null type"); } catch (CorbaBindingException expected) { assertTrue("enclosed corba type is present", expected.getMessage().indexOf(ctype.toString()) != -1); } }