DefaultTypeCache implements TypeCache { @Override public void remove(String typeName) throws AtlasException { types_.remove(typeName); }  @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 = IllegalArgumentException.class) public void testCacheRemoveByNullCategory() throws Exception { cache.remove(null, CLASSTYPE_CUSTOMER); fail("Null type should be not allowed in 'remove'"); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testCacheRemoveByInvalidCategory() throws Exception { cache.remove(TypeCategory.PRIMITIVE, DataTypes.BOOLEAN_TYPE.getName()); fail("TypeCategory should only be one of TypeCategory.CLASS | ENUM | STRUCT | TRAIT in 'remove'"); }