code: public static boolean isP2PKH(Script script) {
          List<ScriptChunk> chunks = script.chunks;
          if (chunks.size() != 5)
              return false;
          if (!chunks.get(0).equalsOpCode(OP_DUP))
              return false;
          if (!chunks.get(1).equalsOpCode(OP_HASH160))
              return false;
          byte[] chunk2data = chunks.get(2).data;
          if (chunk2data == null)
              return false;
          if (chunk2data.length != LegacyAddress.LENGTH)
              return false;
          if (!chunks.get(3).equalsOpCode(OP_EQUALVERIFY))
              return false;
          if (!chunks.get(4).equalsOpCode(OP_CHECKSIG))
              return false;
          return true;
      }
docs: Returns true if this script is of the form {@code DUP HASH160 <pubkey hash> EQUALVERIFY CHECKSIG}, ie, payment to an
  address like {@code 1VayNert3x1KzbpzMGt2qdqrAThiRovi8}. This form was originally intended for the case where you wish
  to send somebody money with a written code because their node is offline, but over time has become the standard
  way to make payments due to the short and recognizable base58 form addresses come in.