@Test public void testExtractName() { final String name1 = "org.java.SomeClass"; final DataObject dataObject = new DataObject(name1); final String expected1 = "SomeClass"; final String actual1 = dataObject.getClassNameWithoutPackage(); assertEquals(expected1, actual1); final String name2 = "SomeOtherClass"; final String expected2 = "SomeOtherClass"; final DataObject dataObject2 = new DataObject(name2); final String actual2 = dataObject2.getClassNameWithoutPackage(); assertEquals(expected2, actual2); }
public String getClassNameWithoutPackage() { int lastIndex = 0; if (classType.contains(".")) { lastIndex = classType.lastIndexOf('.') + 1; } return classType.substring(lastIndex); }
DataObject { public String getClassNameWithoutPackage() { int lastIndex = 0; if (classType.contains(".")) { lastIndex = classType.lastIndexOf('.') + 1; } return classType.substring(lastIndex); } }
DataObject { public String getClassNameWithoutPackage() { int lastIndex = 0; if (classType.contains(".")) { lastIndex = classType.lastIndexOf('.') + 1; } return classType.substring(lastIndex); } DataObject();  DataObject(final String classType); }
DataObject { public String getClassNameWithoutPackage() { int lastIndex = 0; if (classType.contains(".")) { lastIndex = classType.lastIndexOf('.') + 1; } return classType.substring(lastIndex); } DataObject();  DataObject(final String classType); String getClassType(); void setClassType(final String classType); List<DataObjectProperty> getProperties(); void setProperties(final List<DataObjectProperty> properties); String getClassNameWithoutPackage(); }
DataObject { public String getClassNameWithoutPackage() { int lastIndex = 0; if (classType.contains(".")) { lastIndex = classType.lastIndexOf('.') + 1; } return classType.substring(lastIndex); } DataObject();  DataObject(final String classType); String getClassType(); void setClassType(final String classType); List<DataObjectProperty> getProperties(); void setProperties(final List<DataObjectProperty> properties); String getClassNameWithoutPackage();  }