I Have a UserEntity class which implements the IUserEntity interface.
In the UserEntity class I have a static map:
private static Map<IUserEntity.IIdentifiable, IUserEntity> staticUserEntityMap = new HashMap<>(); In the IUserEntity interface I would like to write a method like that:
public Collection<IUserEntity> getUsers(); And in the class :
public static Collection<IUserEntity> getUsers(){ return staticUserEntityMap.values(); } But I can't declare static methods in the interface and I can't change the method signature in the UserEntity class.
How can I do this ?
public Collection<IUserEntity> getUsers(){ return staticUserEntityMap.values(); }