### Question:
UserDefinedFunctionImpl extends FunctionImpl implements UserDefinedFunction { @Override public void setCategory( final UnitOfWork transaction, final String newCategory ) throws KException { setStatementOption( transaction, StandardOption.CATEGORY.name(), newCategory ); } UserDefinedFunctionImpl( final UnitOfWork uow,
                                    final Repository repository,
                                    final String workspacePath ); @Override String getCategory( final UnitOfWork transaction ); @Override String getJavaClass( final UnitOfWork transaction ); @Override String getJavaMethod( final UnitOfWork transaction ); @Override Map< String, String > getStandardOptions(); @Override int getTypeId(); @Override KomodoType getTypeIdentifier( final UnitOfWork uow ); @Override Model getParent( final UnitOfWork transaction ); @Override boolean isStandardOption( final String name ); @Override void setCategory( final UnitOfWork transaction,
                             final String newCategory ); @Override void setJavaClass( final UnitOfWork transaction,
                              final String newJavaClass ); @Override void setJavaMethod( final UnitOfWork transaction,
                               final String newJavaMethod );  }### Answer:
@Test( expected = KException.class ) public void shouldNotAllowEmptyCategoryIfNotSet() throws Exception { this.function.setCategory( getTransaction(), StringConstants.EMPTY_STRING ); }
@Test( expected = KException.class ) public void shouldNotAllowNullCategoryIfNotSet() throws Exception { this.function.setCategory( getTransaction(), null ); }
@Test public void shouldNotCountStatementOptionsAsChildren() throws Exception { this.function.setCategory( getTransaction(), "blah" ); this.function.setStatementOption( getTransaction(), "sledge", "hammer" ); assertThat( this.function.getChildren( getTransaction() ).length, is( 0 ) ); }