DefaultTypeCache implements TypeCache { @Override public void put(IDataType type) throws AtlasException { 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 testPutTypeWithNullType() throws Exception { cache.put(null); fail("Null type should be not allowed in 'put'"); }
@Test(expectedExceptions = AtlasException.class) public void testPutTypeWithInvalidType() throws Exception { cache.put(DataTypes.BOOLEAN_TYPE); fail("type should only be an instance of ClassType | EnumType | StructType | TraitType in 'put'"); }