design: is it a code smell to expose a public method only for testing purposes?

Is it a code smell if the consumers of a class do not need a particular public method of that class, but having the method significantly simplifies their testing?

Consider the following example:

HugeBlackBox class {
build () {}

public getPartOfTheState () {} // <- the method is only intended for testing

// mostly private methods

In case the previous class smells, what are the suggested refactoring techniques when faced with such situations?