1 7 package com.inversoft.util.test; 8 9 10 import com.inversoft.util.BaseException; 11 12 13 public class Bean { 14 15 private String name; 16 17 18 public Bean() { 19 } 20 21 public Bean(String name) { 22 this.name = name; 23 } 24 25 public String getName() { 26 return name; 27 } 28 29 public void setName(String name) { 30 this.name = name; 31 } 32 33 public void throwCheckedMethod() throws BaseException { 34 throw new BaseException(); 35 } 36 37 public void throwUncheckedMethod() { 38 throw new NullPointerException (); 39 } 40 41 public void assertMethod() { 42 throw new AssertionError (); 43 } 44 45 private void hidden() { 46 47 } 48 49 public boolean equals(Object object) { 50 51 if (object == null) { 52 return false; 53 } 54 55 if (object instanceof Bean) { 56 Bean bean = (Bean) object; 57 58 if (name == bean.getName()) { 59 return true; 60 } 61 62 if (name != null) { 63 return name.equals(bean.getName()); 64 } 65 } 66 67 return false; 68 } 69 70 public String toString() { 71 return name; 72 } 73 } 74 | Popular Tags |