DefaultTypeCache implements TypeCache { @Override public void putAll(Collection<IDataType> types) throws AtlasException { for (IDataType type : types) { assertValidType(type); types_.put(type.getName(), type); } }  @Override boolean has(String typeName); @Override boolean has(TypeCategory typeCategory, String typeName); @Override IDataType get(String typeName); @Override IDataType get(TypeCategory typeCategory, String typeName); @Override Collection<String> getTypeNames(Map<TYPE_FILTER, String> filterMap); @Override Collection<String> getAllTypeNames(); @Override void put(IDataType type); @Override void putAll(Collection<IDataType> types); @Override void remove(String typeName); @Override void remove(TypeCategory typeCategory, String typeName); @Override void clear(); @Override IDataType onTypeFault(String typeName);  }
@Test(expectedExceptions = AtlasException.class) public void testCacheBulkInsertWithNullType() throws Exception { List<IDataType> allTypes = new ArrayList<>(); allTypes.add(null); cache = new DefaultTypeCache(); cache.putAll(allTypes); fail("Null type should be not allowed in 'putAll'"); }
@Test(expectedExceptions = AtlasException.class) public void testCacheBulkInsertWithInvalidType() throws Exception { List<IDataType> allTypes = new ArrayList<>(); allTypes.add(DataTypes.BOOLEAN_TYPE); cache = new DefaultTypeCache(); cache.putAll(allTypes); fail("type should only one of ClassType | EnumType | StructType | TraitType in 'putAll'"); }