code: private static String checkPayToPubKey(byte[] scriptPubKey) {
  if ((scriptPubKey.length>0) && ((scriptPubKey[scriptPubKey.length-1] & 0xFF)==0xAC)) {
  		byte[] publicKey =Arrays.copyOfRange(scriptPubKey, 0, scriptPubKey.length-1);
  		return "bitcoinpubkey_"+BitcoinUtil.convertByteArrayToHexString(publicKey);
  	}
  	return null;
  }
docs: *
  Checks if scriptPubKey is about a transaction for paying to a public key
  
  @param scriptPubKey of transaction
  
  @return null, if transaction not about paying to hash, a string starting with "bitcoinpubkey_" and ending with the hex values as String of the public key