@Test public void getClassNameWithoutPackage_LongPackage() { FactIdentifier factIdentifier = new FactIdentifier("test", "com.project.Test"); assertEquals(factIdentifier.getClassNameWithoutPackage(), "Test"); }
public String getClassNameWithoutPackage() { if (className.contains(".")) { return className.substring(className.lastIndexOf(".") + 1); } else { return className; } }
FactIdentifier { public String getClassNameWithoutPackage() { if (className.contains(".")) { return className.substring(className.lastIndexOf(".") + 1); } else { return className; } } }
FactIdentifier { public String getClassNameWithoutPackage() { if (className.contains(".")) { return className.substring(className.lastIndexOf(".") + 1); } else { return className; } } FactIdentifier();  FactIdentifier(String name, String className); }
FactIdentifier { public String getClassNameWithoutPackage() { if (className.contains(".")) { return className.substring(className.lastIndexOf(".") + 1); } else { return className; } } FactIdentifier();  FactIdentifier(String name, String className); String getName(); String getClassName(); String getClassNameWithoutPackage(); String getPackageWithoutClassName(); static FactIdentifier create(String name, String className); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); }
FactIdentifier { public String getClassNameWithoutPackage() { if (className.contains(".")) { return className.substring(className.lastIndexOf(".") + 1); } else { return className; } } FactIdentifier();  FactIdentifier(String name, String className); String getName(); String getClassName(); String getClassNameWithoutPackage(); String getPackageWithoutClassName(); static FactIdentifier create(String name, String className); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); static FactIdentifier INDEX; static FactIdentifier DESCRIPTION; static FactIdentifier EMPTY; }