def METHOD_NAME(show_plots, accuracy):
    testFailCount = 0  # zero unit test result counter
    testMessages = []  # create empty list to store test log messages
    # Create simulation variable names
    unitTaskName = "unitTask"  # arbitrary name (don't change)
    unitProcessName = "TestProcess"  # arbitrary name (don't change)
    #   Create a sim module as an empty container
    unitTestSim = SimulationBaseClass.SimBaseClass()
    #
    #  create the simulation process
    #
    testProcessRate = macros.sec2nano(1)  # update process rate update time
    testProc = unitTestSim.CreateNewProcess(unitProcessName)
    testProc.addTask(unitTestSim.CreateNewTask(unitTaskName, testProcessRate))
    #
    #   setup the simulation tasks/objects
    #
    #
    # Create RW speed message
    #
    speedMsgData = messaging.RWSpeedMsgPayload()
    speedMsgData.wheelSpeeds = [100, 200, 300]
    speedMsg = messaging.RWSpeedMsg().write(speedMsgData)
    numRW = 3
    #
    #   Setup the reaction wheel speed encoder
    #
    wheelSpeedEncoder = encoder.Encoder()
    wheelSpeedEncoder.ModelTag = 'rwSpeedsEncoder'
    wheelSpeedEncoder.clicksPerRotation = 2
    wheelSpeedEncoder.numRW = numRW
    wheelSpeedEncoder.rwSpeedInMsg.subscribeTo(speedMsg)
    # Add test module to runtime call list
    unitTestSim.AddModelToTask(unitTaskName, wheelSpeedEncoder)
    #
    # log data
    #
    # log the RW speeds
    wheelSpeedEncodedLog = wheelSpeedEncoder.rwSpeedOutMsg.recorder()
    unitTestSim.AddModelToTask(unitTaskName, wheelSpeedEncodedLog)
    #
    #   initialize Simulation
    #
    unitTestSim.InitializeSimulation()
    numSteps = 0
    # run the sim
    unitTestSim.TotalSim.SingleStepProcesses()
    numSteps += 1
    unitTestSim.TotalSim.SingleStepProcesses()
    numSteps += 1
    unitTestSim.TotalSim.SingleStepProcesses()
    numSteps += 1
    # update the encoder to be OFF
    wheelSpeedEncoder.rwSignalState = [encoder.SIGNAL_OFF]*numRW
    # run the sim
    unitTestSim.TotalSim.SingleStepProcesses()
    numSteps += 1
    # update the wheel speeds
    speedMsgData.wheelSpeeds = [500, 400, 300]
    speedMsg = messaging.RWSpeedMsg().write(speedMsgData)
    wheelSpeedEncoder.rwSpeedInMsg.subscribeTo(speedMsg)
    wheelSpeedEncoder.rwSignalState = [encoder.SIGNAL_NOMINAL] * numRW
    # run the sim
    unitTestSim.TotalSim.SingleStepProcesses()
    numSteps += 1
    # change the wheel speeds but make the encoder stuck
    speedMsgData.wheelSpeeds = [100, 200, 300]
    speedMsg = messaging.RWSpeedMsg().write(speedMsgData)
    wheelSpeedEncoder.rwSpeedInMsg.subscribeTo(speedMsg)
    wheelSpeedEncoder.rwSignalState = [encoder.SIGNAL_STUCK] * numRW
    # run the sim
    unitTestSim.TotalSim.SingleStepProcesses()
    numSteps += 1
    #
    # retrieve the logged data
    #
    wheelSpeedsEncoded = np.array(wheelSpeedEncodedLog.wheelSpeeds)
    #
    # set the truth vectors
    #
    trueWheelSpeedsEncoded = np.array([[100., 200., 300.],
                                       [ 97.38937226, 197.92033718, 298.45130209],
                                       [100.53096491, 201.06192983, 298.45130209],
                                       [0., 0., 0.],
                                       [499.51323192, 398.98226701, 298.45130209],
                                       [499.51323192, 398.98226701, 298.45130209]])
    #
    # compare the module results to the true values
    #
    fail = 0
    for i in range(numSteps):
        # check a vector values
        if not unitTestSupport.isArrayEqual(wheelSpeedsEncoded[i, 0:3], trueWheelSpeedsEncoded[i, :], 3, accuracy):
            fail += 1
    if fail > 0:
        testFailCount += 1
    if not testFailCount:
        print("PASSED")
    else:
        testMessages.append("FAILED: Encoder Test")
    # each test method requires a single assert method to be called
    # this check below just makes sure no sub-test failures were found
    return [testFailCount, ''.join(testMessages)]