Java 程序:
/*
 * Copyright (c) 2003 Systems Union Holdings Ltd. All rights reserved.
 * Systems Union Proprietary / Confidential. Use is subject to license terms.
 */
package com.systemsunion.precheck.exercise1;/**
 * Class or interface description
 *
 * @author
 */
public class Supplier {    public Supplier(Integer supplierCode) {
        this.suppliercode = supplierCode;
    }    public Supplier(Integer supplierCode, String zipCode) {
        this.zipCode= zipCode;
        this.suppliercode = supplierCode;
    }    public Supplier(String name, String zipCode, String telephone) {
        this.name = name;
        this.zipCode = zipCode;
        this.telephone = telephone;
    }    public Supplier(String name, String zipCode, String telephone, Integer suppliercode) {
        this.name = name;
        this.zipCode = zipCode;
        this.telephone = telephone;
        this.suppliercode = suppliercode;
    }    public Integer GetSupplierCode() {
        return this.suppliercode;
    }    public void SetSupplierCode(Integer i) {
        this.suppliercode = i;
    }
    private String name;
    private String zipCode;
    private String telephone;
    // supplierCode is mandatory, every supplier must have one
    private Integer suppliercode;}
JUnit测试程序:/*
 * Copyright (c) 2003 Systems Union Holdings Ltd. All rights reserved.
 * Systems Union Proprietary / Confidential. Use is subject to license terms.
 */
package com.systemsunion.precheck.exercise1;import junit.framework.TestCase;/**
 * Class or interface description
 *
 */
public class TestCase_Supplier extends TestCase {    public TestCase_Supplier(String name) {
        super(name);
    }    protected void setUp() throws Exception {
    }    protected void tearDown() throws Exception {
    }    public void testConstuctionWithNull() throws Exception {
    
        fail("Implement me");
    }    public void testCreateWithGoodInteger() throws Exception {
        Supplier mySupplier = new Supplier(new Integer(6));
        assertEquals("Supplier value wrong", new Integer(6), mySupplier.GetSupplierCode());
    }    public void testEqualIncludesSupplierCodeOnly() throws Exception {
        fail("Not implemented");
    }
}