Redoing I10a82fd8fdc16febcd880bfcf519843d5562f8e6 with more flags to keep test only methods.
This reverts commit c237ae8c85. Reason: We need more flags for unit tests
c237ae8c85