@Test public void testObjectToStringValid() { Person person = new Person("foobar", "Jim", "Bob", "Smith", "JimmyBob"); assertEquals("Jim Bob Smith JimmyBob", sut.objectToString(person)); }
@Override public String objectToString(final Object personObj) { if (personObj == null || !(personObj instanceof Person)) { return null; } Person person = (Person) personObj; return getValue(person.getFirstName()) + " " + getValue(person.getMiddleName()) + " " + getValue(person.getLastName()) + " " + getValue(person.getPreferredName()); }
PersonNameClassBridge implements StringBridge { @Override public String objectToString(final Object personObj) { if (personObj == null || !(personObj instanceof Person)) { return null; } Person person = (Person) personObj; return getValue(person.getFirstName()) + " " + getValue(person.getMiddleName()) + " " + getValue(person.getLastName()) + " " + getValue(person.getPreferredName()); } }
PersonNameClassBridge implements StringBridge { @Override public String objectToString(final Object personObj) { if (personObj == null || !(personObj instanceof Person)) { return null; } Person person = (Person) personObj; return getValue(person.getFirstName()) + " " + getValue(person.getMiddleName()) + " " + getValue(person.getLastName()) + " " + getValue(person.getPreferredName()); }  }
PersonNameClassBridge implements StringBridge { @Override public String objectToString(final Object personObj) { if (personObj == null || !(personObj instanceof Person)) { return null; } Person person = (Person) personObj; return getValue(person.getFirstName()) + " " + getValue(person.getMiddleName()) + " " + getValue(person.getLastName()) + " " + getValue(person.getPreferredName()); }  @Override String objectToString(final Object personObj); }
PersonNameClassBridge implements StringBridge { @Override public String objectToString(final Object personObj) { if (personObj == null || !(personObj instanceof Person)) { return null; } Person person = (Person) personObj; return getValue(person.getFirstName()) + " " + getValue(person.getMiddleName()) + " " + getValue(person.getLastName()) + " " + getValue(person.getPreferredName()); }  @Override String objectToString(final Object personObj);  }